submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s928077733
p03963
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long k = sc.nextLong(); long sum = k; for (int = 0; i < n-1; i++) { sum *= (k-1); } System.out.println(sum); } }
Main.java:11: error: not a statement for (int = 0; i < n-1; i++) { ^ Main.java:11: error: ';' expected for (int = 0; i < n-1; i++) { ^ Main.java:11: error: illegal start of expression for (int = 0; i < n-1; i++) { ^ Main.java:11: error: not a statement for (int = 0; i < n-1; i++) { ^ Main.java:11: error: ')' expected for (int = 0; i < n-1; i++) { ^ Main.java:11: error: ';' expected for (int = 0; i < n-1; i++) { ^ 6 errors
s060257196
p03963
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int K = sc.nextInt(); int ans = 1; for(int i=0; i<N; i++) { if(i == 0) ans *= K; else ans *= K-1; } System.out.println(ans); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s861841283
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K; cin >> N >> K; int sum = 1; int a = 1; for (int i = 1; i <= N; i++){ sum *= i; } for (int i = 1; i <= K; i++){ a *= i; } int A = sum / a; cout << << endl; }
a.cc: In function 'int main()': a.cc:16:12: error: expected primary-expression before '<<' token 16 | cout << << endl; | ^~
s349508696
p03963
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n>> k; int u=1; for (int i = k; i >=k-2; i--) { u *= i; } cout << u << endl; return 0; }
a.cc:1:26: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { cin.tie(0); ios::sync_with_stdio(false); | ^~~~~ a.cc:3:1: error: 'cin' does not name a type 3 | cin >> n>> k; | ^~~ a.cc:5:1: error: expected unqualified-id before 'for' 5 | for (int i = k; i >=k-2; i--) { | ^~~ a.cc:5:17: error: 'i' does not name a type 5 | for (int i = k; i >=k-2; i--) { | ^ a.cc:5:26: error: 'i' does not name a type 5 | for (int i = k; i >=k-2; i--) { | ^ a.cc:8:1: error: 'cout' does not name a type 8 | cout << u << endl; return 0; } | ^~~~ a.cc:8:20: error: expected unqualified-id before 'return' 8 | cout << u << endl; return 0; } | ^~~~~~ a.cc:8:30: error: expected declaration before '}' token 8 | cout << u << endl; return 0; } | ^
s515105099
p03963
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; int main(){ int N; K; cin >> N >> K; long long int ans = N; for(int i = 0; i < K - 1; i++) ans *= (N-1); cout << ans; }
a.cc: In function 'int main()': a.cc:8:10: error: 'K' was not declared in this scope 8 | int N; K; | ^
s536649156
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >>b ; int c = 1; for (int i = 0; i <b ;i++) c *= (a-1); cout << c << endl; }​
a.cc:18:2: error: '\U0000200b' does not name a type 18 | }​ |
s688313289
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >>b ; cout << b*((b-1)^(a-1)) << endl;
a.cc: In function 'int main()': a.cc:10:35: error: expected '}' at end of input 10 | cout << b*((b-1)^(a-1)) << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s403645488
p03963
C++
#include <bits/stdc++.h> typedef unsigned long long int ull; typedef long double ldb; typedef long long int ll; #define for01(k,n) for (ll i=k; i<n; i++) #define for02(k,n) for (ll j=k; j<n; j++) #define for03(k,n) for (ll k=k; k<n; k++) #define for11(k,n) for (ll i=k; i<=n; i++) #define for12(k,n) for (ll j=k; j<=n; j++) #define for13(k,n) for (ll k=k; k<=n; k++) #define pb push_back #define mp make_pair #define pf push_front #define popf pop_front #define popb pop_back #define vll vector<ll> #define F first #define S second #define pp pair <ll, ll> #define lb lower_bound #define ub upper_bound #define emp empty() #define beg begin() #define en end() #define si size() #define bk back() #define deci(n) fixed<<setprecision(n) #define p0(a) cout << a << " " #define p1(a) cout << a << "\n" #define MAX LLONG_MAX #define MIN LLONG_MIN using namespace std; int main() { ll n,k; cin >> n >> k; if(k >= n) { ll p = k; for(ll i = 0; i<n;i++) p = p * (k-1); } else { ll p = 1; for(ll i = 1 ; i <= n; i++) p = p * i; } p1(p); return 0; }
a.cc: In function 'int main()': a.cc:60:6: error: 'p' was not declared in this scope 60 | p1(p); | ^ a.cc:33:23: note: in definition of macro 'p1' 33 | #define p1(a) cout << a << "\n" | ^
s406529052
p03963
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll N, K; cin >> N >> K; cout << K * pow((K - 1), N - 1)) << endl; }
a.cc: In function 'int main()': a.cc:11:36: error: expected ';' before ')' token 11 | cout << K * pow((K - 1), N - 1)) << endl; | ^ | ;
s201306926
p03963
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { int N, K; cin >> N >> K; ans = K; for (int i = 1; i < N; i++){ ans *= K - 1; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | ans = K; | ^~~ | abs
s894742103
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int c = 1; for(i=0; i<n; i++){ if(i==0){ c *= k; }else if(i<n-1){ c *= (k-1); }else{ c *= (k-2); } } cout << c << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | for(i=0; i<n; i++){ | ^
s083562921
p03963
C++
#include <bits/stdc++.h> using namespace std; int sum(vector<int> scores) { int a=0; for(int i=0;i<scores.size();i++){ a+=scores.at(i); } return a; } void output(int sum_a, int sum_b, int sum_c) { cout<<sum_a*sum_b*sum_c<<endl; } vector<int> input(int N) { vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } return vec; int factor(int k){ int s = 1; for (int i = 1; i <= k; i++){ s *= i; } return s; } } int main(){ int n,k; cin>>n>>k; cout<<n*pow(n-1,k-1)<<endl; }
a.cc: In function 'std::vector<int> input(int)': a.cc:21:18: error: a function-definition is not allowed here before '{' token 21 | int factor(int k){ | ^
s886093503
p03963
C++
#include <bits/stdc++.h> using namespace std; int sum(vector<int> scores) { int a=0; for(int i=0;i<scores.size();i++){ a+=scores.at(i); } return a; } void output(int sum_a, int sum_b, int sum_c) { cout<<sum_a*sum_b*sum_c<<endl; } vector<int> input(int N) { vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } return vec; } int main(){ int n,k; cin>>n>>k; cout<<n*(n-1)**(k-1)<<endl; }
a.cc: In function 'int main()': a.cc:25:17: error: invalid type argument of unary '*' (have 'int') 25 | cout<<n*(n-1)**(k-1)<<endl; | ^~~~~~
s935192315
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t n,k; cin >> n >> k; cout << k * power(k - 1,n - 1) << endl; }
a.cc: In function 'int main()': a.cc:6:15: error: 'power' was not declared in this scope 6 | cout << k * power(k - 1,n - 1) << endl; | ^~~~~
s926611973
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, K; cin >> N >> K; long long answer = 1; for (int i = 0; i < N; i++){ answer = answer * (K - 1) } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:11:34: error: expected ';' before '}' token 11 | answer = answer * (K - 1) | ^ | ; 12 | } | ~
s391487021
p03963
C++
#include<bits/stdc++.h> using namespace std; int main() { long long a,b,c; cin>>a>>b; cout<<b*pow(b-1,a-1);<<endl; }
a.cc: In function 'int main()': a.cc:8:26: error: expected primary-expression before '<<' token 8 | cout<<b*pow(b-1,a-1);<<endl; | ^~
s207344793
p03963
C++
#include<bits/stdc++.h> using namespace std; template<typename T>inline void read(T &x){ register short f=1;x=0;char c=getchar(); while(!isdigit(c)){if(c=='-')f=-1;c=getchar();} while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar(); x*=f; } template<typename T>inline void write(T x){ if(x<0)putchar('-'),x=-x; if(x>9)write(x/10); putchar(x%10+'0'); } template<typename T>inline void writeln(T x){ write(x),putchar('\n'); } long long a,b; int main(){ read(a),read(b); write(b*pow(b-1,a-1)); return 0; }
a.cc: In function 'void read(T&)': a.cc:4:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register short f=1;x=0;char c=getchar(); | ^ a.cc: In instantiation of 'void read(T&) [with T = long long int]': a.cc:19:6: required from here 19 | read(a),read(b); | ~~~~^~~ a.cc:4:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register short f=1;x=0;char c=getchar(); | ^ a.cc: In instantiation of 'void write(T) [with T = double]': a.cc:20:7: required from here 20 | write(b*pow(b-1,a-1)); | ~~~~~^~~~~~~~~~~~~~~~ a.cc:12:18: error: invalid operands of types 'double' and 'int' to binary 'operator%' 12 | putchar(x%10+'0'); | ~^~~
s329449949
p03963
C++
#include<iostream> #include<algorithm> #include<vector> #include<string.h> #include<cstdlib> #include<map> #include<fstream> #include<string> #include<sstream> #include<iomanip> #include<cmath> using namespace std; long long dp[3][100100] = {}; const long long INF = 1LL << 60; #define MOD 1000000007 template<class T> inline bool chmin(T & a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } /** * @fn * 最大値を取ります.Vector<int>を渡すこと. */ long long int imax(vector<int> a) { int MAX = -10000000; for (int i = 0; i < a.size(); i++) { if (MAX < a.at(i)) MAX = a.at(i); } return MAX; } /** * @fn * 最小値を取ります.Vector<int>を渡すこと. */ long long int imin(vector<int> a) { int MIN = 1000000000; for (int i = 0; i < a.size(); i++) { if (MIN > a.at(i)) MIN = a.at(i); } return MIN; } long long int absmin(vector<int> a, long long int b) { int mini = 100000000; int d = 0; for (int i = 0; i < a.size(); i++) { if (mini > abs(a.at(i) - b)) { mini = abs(a.at(i) - b); d = i; } } return d; } int gcd(int a, int b) { if (a < b) swap(a, b); if (b < 1) return -1; if (a % b == 0) return b; return gcd(b, a % b); } //ここまでライブラリ //ここから本文 long long int tpimin(vector<int> a) { int MIN = 1000000000; int number = 0; for (int i = 0; i < a.size(); i++) { if (MIN > a.at(i)) MIN = a.at(i); number = i; } return number; } int main() { long long n, k; cin >> n >> k; cout << long long (k * pow(k - 1, n - 1)) << endl; }
a.cc: In function 'int main()': a.cc:84:17: error: expected primary-expression before 'long' 84 | cout << long long (k * pow(k - 1, n - 1)) << endl; | ^~~~
s098608857
p03963
C++
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <stack> #include <map> #include <set> #include <algorithm> #include <numeric> #include <math.h> #include <stdio.h> #include <ctype.h> #include <ios> #include <iomanip> using namespace std; #define N_MAX (100000) #define LL_MAX_NUM (1LL<<60) #define INF 1e7 typedef long long ll; typedef long long int lli; int main() { int n, k; cin >> n >> k; ll ans = k; for (int i = 2; i <= n; i++) { ans *= (k -1) } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:29:22: error: expected ';' before '}' token 29 | ans *= (k -1) | ^ | ; 30 | } | ~
s888272558
p03963
C++
using namespace std; int main() { int color;int n; cin>>n >>color; if (n==1) { cout<<color; } if (n==2) { cout<<color*(color-1); } if (n>2) { cout<<color*(color-1)*n; } return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope 5 | cin>>n >>color; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:9:9: error: 'cout' was not declared in this scope 9 | cout<<color; | ^~~~ a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:13:9: error: 'cout' was not declared in this scope 13 | cout<<color*(color-1); | ^~~~ a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout<<color*(color-1)*n; | ^~~~ a.cc:17:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s132734969
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,X; cin >> N >> X; long long out; out = X * pow(X-1,N-1) cout << out << endl; }
a.cc: In function 'int main()': a.cc:9:25: error: expected ';' before 'cout' 9 | out = X * pow(X-1,N-1) | ^ | ; 10 | 11 | cout << out << endl; | ~~~~
s330835721
p03963
C++
include <bits/stdc++.h> using namespace std; int main() { int n,k; cin >>n>>k; long long ans = k; for(int i = 1;i<=n-1;i++){ ans = ans *(k-1); } cout << ans <<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >>n>>k; | ^~~ a.cc:11:3: error: 'cout' was not declared in this scope 11 | cout << ans <<endl; | ^~~~ a.cc:11:17: error: 'endl' was not declared in this scope 11 | cout << ans <<endl; | ^~~~
s180498179
p03963
C
#include <stdi.h> int main(void){ int a, b, c = 1; scanf("%d", &a); scanf("%d", &b); c = b; a--; while(a > 0){ c *= b - 1; a--; } printf("%d\n", c); return 0; }
main.c:1:10: fatal error: stdi.h: No such file or directory 1 | #include <stdi.h> | ^~~~~~~~ compilation terminated.
s205555577
p03963
C++
#include<stdio.h> #include<iostream> #include<algorithm> #include<functional> using namespace std; int main(void) { int N, K; int ans = 1; cin >> N >> K; for (int i = 0; i < N; I++) { if (i == 0) { ans = ans * K; } else { ans *= K - 1; } } printf("%d", ans); return 0; }
a.cc: In function 'int main()': a.cc:11:32: error: 'I' was not declared in this scope 11 | for (int i = 0; i < N; I++) { | ^
s482472701
p03963
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ll n,k,sum=0 cin>>n>>k; sum+=k; for(int i=1;i<n;i++) sum*=k-1; cout<<sum; return 0;}
a.cc: In function 'int main()': a.cc:6:4: error: expected ',' or ';' before 'cin' 6 | cin>>n>>k; | ^~~
s461883443
p03963
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ld long double #define ull unsigned long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) // (i, 10) i=0~i=9まで #define repr(i, n) for (int i = n; i >= 0; i--) // (i, 10) i=10~i=0まで #define FOR(i, m, n) for (int i = m; i < n; i++) // (i, 3, 10) i=3~i=9まで #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((int)(x).size()) #define pb push_back #define ret return typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vii; typedef vector<long long> vl; // 総数を1000000007で割った余り const long long mod = 1e9 + 7; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) int main() { // cin.tie(0); // ios::sync_with_stdio(false); // cout << fixed << setprecision(0); // 入力 ll n, k; cin >> n >> k; // 処理#include <bits/stdc++.h> using namespace std; using ll = long long; #define ld long double #define ull unsigned long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) // (i, 10) i=0~i=9まで #define repr(i, n) for (int i = n; i >= 0; i--) // (i, 10) i=10~i=0まで #define FOR(i, m, n) for (int i = m; i < n; i++) // (i, 3, 10) i=3~i=9まで #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((int)(x).size()) #define pb push_back #define ret return typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vii; typedef vector<long long> vl; // 総数を1000000007で割った余り const long long mod = 1e9 + 7; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) int main() { // cin.tie(0); // ios::sync_with_stdio(false); // cout << fixed << setprecision(0); // 入力 ll n, k; cin >> n >> k; // 処理 // 出力 cout << k * pow(k - 1, n - 1) << endl; return 0; } cout << k * pow(k - 1, n - 1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:68:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 68 | int main() { | ^~ a.cc:68:9: note: remove parentheses to default-initialize a variable 68 | int main() { | ^~ | -- a.cc:68:9: note: or replace parentheses with braces to value-initialize a variable a.cc:68:12: error: a function-definition is not allowed here before '{' token 68 | int main() { | ^
s658957628
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int int a,b; cin>>a>>b; long long f=1; for(int i=1;i<=a;i++){ if(i==1)f*=b; else f*=(b-1); } cout<<fixed<<setprecision(0)<<f; return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: two or more data types in declaration of 'a' 4 | int int a,b; | ^~~ a.cc:4:1: error: two or more data types in declaration of 'b' a.cc:5:6: error: 'a' was not declared in this scope 5 | cin>>a>>b; | ^ a.cc:5:9: error: 'b' was not declared in this scope 5 | cin>>a>>b; | ^
s108856317
p03963
C++
#include <bits/stdc++.h> #include<algorithm> #include<math.h> #include<string> #include<iostream> #include <vector> #include <cstdlib> using namespace std; template <class T> using V = vector<T>; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } const long long INF = 1LL << 60; using ll = long long; using db = double; using st = string; using ch = char; using bl = bool; using vll = V<ll>; using vpll =V<pair<ll,ll>>; using vst = V<st>; using vdb = V<db>; using vch = V<ch>; using vbl = V<bl>; #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define rFOR(i,a,b) for(ll i=(a);i>(b);i--) #define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2) #define bgn begin() #define en end() #define SORT(a) sort((a).bgn,(a).en) #define REV(a) reverse((a).bgn,(a).en) #define M(a,b) max(a,b) #define rM(a,b) min(a,b) #define fi first #define se second #define sz size() #define gcd(a,b) __gcd(a,b) #define co(a) cout<<a<<endl; #define ci(a) cin>>a; ll sum(ll n) { ll m=0; FOR(i,0,20){ m+=n%10; n/=10; if(n==0){ break; } } return m; } ll combi(ll n,ll m) { ll ans=1; rFOR(i,n,n-m){ ans*=i; } FOR(i,1,m+1){ ans/=i; } return ans; } ll lcm(ll a,ll b){ ll n; n=a/gcd(a,b)*b; return n; } /****************************************\ | Thank you for viewing my code:) | | Written by RedSpica a.k.a. RanseMirage | | Twitter:@asakaakasaka | \****************************************/ signed main() { ll n,m; Ci(n>>m); ll ans=1; ans*=pow(m-1,n-1); ans*=m; co(m) }
a.cc: In function 'int main()': a.cc:100:9: error: 'Ci' was not declared in this scope; did you mean 'ci'? 100 | Ci(n>>m); | ^~ | ci
s737732558
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, k; cin >> n >> k; int ans=k; if(n!!=1){ for(int i=1;i<n;i++){ ans*=k-1; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:7: error: expected ')' before '!' token 7 | if(n!!=1){ | ~ ^ | )
s641071777
p03963
C++
#include<iostream> using namespace std; int main(){ int n, k; cin >> n >> k; doubleint ans = 1; for(int i = 1; i <= n; i++){ if(i = 1) ans *= k; else ans *= k-1; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'doubleint' was not declared in this scope; did you mean 'double'? 7 | doubleint ans = 1; | ^~~~~~~~~ | double a.cc:9:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | if(i = 1) ans *= k; | ^~~ | abs a.cc:10:10: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | else ans *= k-1; | ^~~ | abs a.cc:13:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | cout << ans << endl; | ^~~ | abs
s592816976
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; cout << long pow(K-1,N-1)*K << endl; }
a.cc: In function 'int main()': a.cc:7:11: error: expected primary-expression before 'long' 7 | cout << long pow(K-1,N-1)*K << endl; | ^~~~
s795340497
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; cout << long pow(K-1,N-1)*K << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: expected primary-expression before 'long' 7 | cout << long pow(K-1,N-1)*K << endl; | ^~~~
s284421223
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; cout << long long pow(K-1,N-1)*K << endl; }
a.cc: In function 'int main()': a.cc:7:11: error: expected primary-expression before 'long' 7 | cout << long long pow(K-1,N-1)*K << endl; | ^~~~
s559056855
p03963
C++
#include<bits/stdc++.h> using namespace std; long long a,b,c; int main(){ cin>>a>>b; c=b*pow(b-1,a-1) cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:21: error: expected ';' before 'cout' 6 | c=b*pow(b-1,a-1) | ^ | ; 7 | cout<<c<<endl; | ~~~~
s195791745
p03963
C++
#include <iostream> using namespace std; int main() { int N,K,a,b,e; cin >>N>>K; for(int i=1;i<N;i++){ if(N==1){ a=N*K }else{ e=K+(N-1)*rr(K) } } int rr(int b){ int c=N-1; b=K-1; while(c>0){ b=b*b; c-=1 } return b; } cout << e; }
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before '}' token 9 | a=N*K | ^ | ; 10 | }else{ | ~ a.cc:11:15: error: 'rr' was not declared in this scope 11 | e=K+(N-1)*rr(K) | ^~ a.cc:14:18: error: a function-definition is not allowed here before '{' token 14 | int rr(int b){ | ^
s872820696
p03963
C++
#include <bits/stdc++.h> #define cinf(n,x,y) for(int i=0;i<(n);i++) cin >> x[i]>>y[i]; typedef long long int ll; using namespace std; int main(){ int n,k; cin >>n >>K; int ans=1; ans*=k*pow(k-1,n-1); cout << ans <<endl; }
a.cc: In function 'int main()': a.cc:7:28: error: 'K' was not declared in this scope 7 | int n,k; cin >>n >>K; | ^
s067183339
p03963
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <stdio.h> #include <set> #include <vector> using namespace std; int main(){ int n, k; cin>>n>>k; tori = 0; int i; int tmp = 0; for(i=2; i<=k; i++){ tori += i*pow(i-1,n-1); } cout<<tori<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'tori' was not declared in this scope 13 | tori = 0; | ^~~~
s596195688
p03963
C++
/* BISMILLAHIR RAHMANIR RAHIM */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base :: sync_with_stdio(0); ll n, k; cin >> n >> k; ll res = 1; for(ll i = 1; i <= k; i++, m--) { res *= m; } cout << res << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:36: error: 'm' was not declared in this scope 12 | for(ll i = 1; i <= k; i++, m--) { | ^
s471852609
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int A; A = K for (int i = 0; i < N - 1; i++) { A *= (K - 1); } return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: expected ';' before 'for' 8 | A = K | ^ | ; 9 | for (int i = 0; i < N - 1; i++) { | ~~~ a.cc:9:19: error: 'i' was not declared in this scope 9 | for (int i = 0; i < N - 1; i++) { | ^
s774143394
p03963
C++
#include<iostream> #include<cmath> using namespace std; int main(){ int N,K; cin>>N>>K; int ans=K*pow(K-1,N-1) cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:2: error: expected ',' or ';' before 'cout' 8 | cout<<ans<<endl; | ^~~~
s253334583
p03963
C++
#include <iostream> using namespace std; int main(){ int a,b,ans=1; cin>>a>>b; for(i=1;i<a;i++) ans*=(b-1); cout<<b*ans<<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=1;i<a;i++) | ^
s046358542
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, k, a; cin >> n >> k; n = k*pow(k-1, n-1) printf("%d", n); return 0; }
a.cc: In function 'int main()': a.cc:7:24: error: expected ';' before 'printf' 7 | n = k*pow(k-1, n-1) | ^ | ; 8 | printf("%d", n); | ~~~~~~
s767647194
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, k, a; cin >> n >> k; n = k*pow(k-1, n-1) printf("%d",) n; return 0; }
a.cc: In function 'int main()': a.cc:7:24: error: expected ';' before 'printf' 7 | n = k*pow(k-1, n-1) | ^ | ; 8 | printf("%d",) n; | ~~~~~~
s197431907
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,K; cin>>N>>K; long long ans=K; for(int i=2;i<N+1;i++){ ans *= K-1; } cout << ans <<endl; retun 0; }
a.cc: In function 'int main()': a.cc:16:3: error: 'retun' was not declared in this scope 16 | retun 0; | ^~~~~
s963506737
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; long long ans = K; for (int i = 0; i < N-1; i++) ans *= K-1; cout << and << "\n"; }
a.cc: In function 'int main()': a.cc:8:15: error: expected identifier before '<<' token 8 | cout << and << "\n"; | ^~
s802765495
p03963
C++
#include<iostream> using namespace std; int main(){ ll ans; ll a,b; cin >> a >> b; if(a == 1) ans = b; else ans = b + (b-1)*(a-2); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:4:3: error: 'll' was not declared in this scope 4 | ll ans; | ^~ a.cc:5:5: error: expected ';' before 'a' 5 | ll a,b; | ^~ | ; a.cc:6:10: error: 'a' was not declared in this scope 6 | cin >> a >> b; | ^ a.cc:6:15: error: 'b' was not declared in this scope 6 | cin >> a >> b; | ^ a.cc:7:14: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | if(a == 1) ans = b; | ^~~ | abs a.cc:8:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | else ans = b + (b-1)*(a-2); | ^~~ | abs a.cc:9:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | cout << ans << endl; | ^~~ | abs
s596572850
p03963
C++
#include<iostream> using namespace std; int main() { int N,K; cin >> N >> K; cout << K * ( K - 1 ) ^ ( N - 1 ) << endl; }
a.cc: In function 'int main()': a.cc:7:37: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 7 | cout << K * ( K - 1 ) ^ ( N - 1 ) << endl; | ~~~~~~~~~~^~~~~~~
s800133404
p03963
C++
#include <iostream> #include <sstream> #include <vector> //#include <numeric> //#include <algorithm> #include <cmath> #include <string> //#include <map> //#include <iomanip> using namespace std; //関数getinputdata宣言 vector<vector<string>> getinputdata(); vector<vector<int>> getinputdata2(); vector<vector<double>> getinputdata3(); void abc046_b(vector<vector<int>> v) { int n = v[0][0]; int k = v[1][0]; double val = pow(double(k - 1), double(n - 1)); val*=k cout << val << endl; } int main() { // vector<vector < string>> vec_arr_result; vector<vector<int>> vec_arr_result; vec_arr_result = getinputdata2(); abc046_b(vec_arr_result); return 0; } //関数getinputdata実装 vector<vector<double>> getinputdata3() { string str; string ret; stringstream ss; vector<string> v1; vector<vector<double>> vec_arr; //標準入力から入力がある間ループ処理でvector配列にデータ格納 while (getline(cin, str)) { v1.push_back(str); } //stringstreamを利用してvector配列v1をスペースで分解処理 for (string s : v1) { vector<double> array_data; ss << s; while (!ss.eof()) { ss >> ret; array_data.push_back(atof(ret.c_str())); } //vector配列に追加 vec_arr.push_back(array_data); //バッファクリア ss.str(""); //ストリームクリア ss.clear(stringstream::goodbit); } return vec_arr; } //関数getinputdata実装 vector<vector<int>> getinputdata2() { string str; string ret; stringstream ss; vector<string> v1; vector<vector<int>> vec_arr; //標準入力から入力がある間ループ処理でvector配列にデータ格納 while (getline(cin, str)) { v1.push_back(str); } //stringstreamを利用してvector配列v1をスペースで分解処理 for (string s : v1) { vector<int> array_data; ss << s; while (!ss.eof()) { ss >> ret; array_data.push_back(atoi(ret.c_str())); } //vector配列に追加 vec_arr.push_back(array_data); //バッファクリア ss.str(""); //ストリームクリア ss.clear(stringstream::goodbit); } return vec_arr; } //関数getinputdata実装 vector<vector < string >> getinputdata() { string str; string ret; stringstream ss; vector<string> v1; vector<vector < string>> vec_arr; //標準入力から入力がある間ループ処理でvector配列にデータ格納 while (getline(cin, str)) { v1.push_back(str); } //stringstreamを利用してvector配列v1をスペースで分解処理 for (string s : v1) { vector<string> array_data; ss << s; while (!ss.eof()) { ss >> ret; array_data.push_back(ret); } //vector配列に追加 vec_arr.push_back(array_data); //バッファクリア ss.str(""); //ストリームクリア ss.clear(stringstream::goodbit); } return vec_arr; }
a.cc: In function 'void abc046_b(std::vector<std::vector<int> >)': a.cc:23:11: error: expected ';' before 'cout' 23 | val*=k | ^ | ; 24 | 25 | cout << val << endl; | ~~~~
s228231373
p03963
C++
#include<iostream> using namespace std; int main(){ int n,k,sum=1; cin>>n>>k; if(n==1)cout<<k<<endl; else { for(int i=1;i<n++i)sum*=(k-1); cout<<k*sum<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: expected ';' before 'i' 9 | for(int i=1;i<n++i)sum*=(k-1); | ^ | ;
s571364623
p03963
C++
#inclue<iostream> using namespace std; int main(){ int n,k,sum=1; cin>>n>>k; if(n==1)cout<<k<<endl; else { for(int i=1;i<n++i)sum*=(k-1); cout<<k*sum<<endl; } return 0; }
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include? 1 | #inclue<iostream> | ^~~~~~ | include a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin>>n>>k; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inclue<iostream> a.cc:7:17: error: 'cout' was not declared in this scope 7 | if(n==1)cout<<k<<endl; | ^~~~ a.cc:7:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:26: error: 'endl' was not declared in this scope 7 | if(n==1)cout<<k<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #inclue<iostream> a.cc:9:26: error: expected ';' before 'i' 9 | for(int i=1;i<n++i)sum*=(k-1); | ^ | ; a.cc:10:9: error: 'cout' was not declared in this scope 10 | cout<<k*sum<<endl; | ^~~~ a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:10:22: error: 'endl' was not declared in this scope 10 | cout<<k*sum<<endl; | ^~~~ a.cc:10:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s298904347
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,K; cin >> N >> K; long long Ans=K; for(int i=1,i<N;i++){ Ans *=(K-1); } cout << Ans << endl; }
a.cc: In function 'int main()': a.cc:8:16: error: expected ';' before '<' token 8 | for(int i=1,i<N;i++){ | ^ | ; a.cc:8:16: error: expected primary-expression before '<' token
s229795055
p03963
C++
#include<iostream> using namespace std; int main(){ int n, k; cin >> n >> k; long long int ans; ans = pow(k-1, n-1) * k; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'pow' was not declared in this scope 9 | ans = pow(k-1, n-1) * k; | ^~~
s514236849
p03963
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); long n=Long.parseLong(sc.next()); long a=Long.parseLong(sc.next()); n-=1; int ans=a; for(int i=0;i<n;i++)ans*=(a-1); System.out.println(ans); } }
Main.java:8: error: incompatible types: possible lossy conversion from long to int int ans=a; ^ 1 error
s328106800
p03963
C
N,K = map(int,input().split()) print(K*pow(K-1,N-1))
main.c:1:1: warning: data definition has no type or storage class 1 | N,K = map(int,input().split()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'K' [-Wimplicit-int] 1 | N,K = map(int,input().split()) | ^ main.c:1:7: error: implicit declaration of function 'map' [-Wimplicit-function-declaration] 1 | N,K = map(int,input().split()) | ^~~ main.c:1:11: error: expected expression before 'int' 1 | N,K = map(int,input().split()) | ^~~ main.c:2:1: error: expected ',' or ';' before 'print' 2 | print(K*pow(K-1,N-1)) | ^~~~~
s766129899
p03963
C++
#include "pch.h" #include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; long long output = k; n--; for (int i = 0; i < n; i++) { output *= (k - 1); } cout << output << endl; }
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s859504505
p03963
C
#include<stdio.h> int main(){ int N, K, i, r; scanf("%d %d", &N, &K); r = K; for (i = 1; i < N){ r *= K - 1; } printf("%d\n", r); return 0; }
main.c: In function 'main': main.c:9:20: error: expected ';' before ')' token 9 | for (i = 1; i < N){ | ^ | ;
s174608561
p03963
C++
#include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include <iomanip> #include <numeric> #include <assert.h> #include <bitset> #include <list> using namespace std; int main() { int n, k; cin >> n >> k; int ans = k * pow(k - 1, n - 1); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:29:23: error: 'pow' was not declared in this scope 29 | int ans = k * pow(k - 1, n - 1); | ^~~
s382565148
p03963
C++
#include<iostream> using namespace std int main(){ int n,k; cin>>n>>k; int c; c=k; for(int i=2;i<=n;i++){ c*=(k-1); } cout<<c; return 0; }
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | int main(){ | ~~~
s507331942
p03963
C++
#include<iostream> using namespace std int main(){ int n,k; cin>>n>>k; int c; c=k; for(int i=2;i<=n;i++){ c*=(k-1); cout<<c; return 0; }
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | int main(){ | ~~~ a.cc: In function 'int main()': a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s630895778
p03963
C++
#include<iostrem> using namespace std int main(){ int n,k; cin>>n>>k; int c; c=k; for(int i=2;i<=n;i++){ c*=(k-1); cout<<c; return 0; }
a.cc:1:9: fatal error: iostrem: No such file or directory 1 | #include<iostrem> | ^~~~~~~~~ compilation terminated.
s306090958
p03963
C++
#include <iostream> #include <algorithm> int main() { int N, K; std::cin >> N >> K; long long ans = std::pow(K-1, N-1) * K; std::cout << ans << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: 'pow' is not a member of 'std' 9 | long long ans = std::pow(K-1, N-1) * K; | ^~~
s485343106
p03963
C++
#include <iostream> #include <string> #include <algorithm> int main() { int n,k; std::cin >> n >> k; std::cout <<k*(pow(k-1,n-1))<<std::endl; }
a.cc: In function 'int main()': a.cc:9:24: error: 'pow' was not declared in this scope 9 | std::cout <<k*(pow(k-1,n-1))<<std::endl; | ^~~
s930053680
p03963
C++
#include <iostream> #include <string> #include <algorithm> int main() { int n,k; std::cin >> n >> k; std::cout <<k*(pow(k-1,n-1))<<std::endl; }
a.cc: In function 'int main()': a.cc:9:24: error: 'pow' was not declared in this scope 9 | std::cout <<k*(pow(k-1,n-1))<<std::endl; | ^~~
s099641637
p03963
C++
#include <iostream> #include <string> #include <algorithm> int main() { int n,k; std::cin >> n >> k; std::cout <<k*pow(k-1,n-1)<<std::endl; }
a.cc: In function 'int main()': a.cc:9:23: error: 'pow' was not declared in this scope 9 | std::cout <<k*pow(k-1,n-1)<<std::endl; | ^~~
s585441483
p03963
C++
#include <iostream> #include <string> #include <algorithm> int main() { int n,k; std::cin >> n >> k; std::cout <<k*std::pow(k-1,n-1)<<std::endl; }
a.cc: In function 'int main()': a.cc:9:28: error: 'pow' is not a member of 'std' 9 | std::cout <<k*std::pow(k-1,n-1)<<std::endl; | ^~~
s087318386
p03963
C++
#include<iostream> using namespace std; int main() { int n, k; cin >> n >> k; int res = int(k * pow(k - 1, n - 1)); cout << res << endl; }
a.cc: In function 'int main()': a.cc:7:27: error: 'pow' was not declared in this scope 7 | int res = int(k * pow(k - 1, n - 1)); | ^~~
s518298053
p03963
C++
#include<iostream> using namespace std; int main() { int n, k; cin >> n >> k; cout << int(k * pow(k-1, n-1)) << endl; }
a.cc: In function 'int main()': a.cc:8:25: error: 'pow' was not declared in this scope 8 | cout << int(k * pow(k-1, n-1)) << endl; | ^~~
s826258294
p03963
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { int N, K; cin >> N >> K; cout << K*pow((K-1),(N-1)) << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:15: error: 'pow' was not declared in this scope 13 | cout << K*pow((K-1),(N-1)) << endl; | ^~~
s313555464
p03963
C++
#include<iostream> using namespace std; int main() { int N, K; cin >> N >> K; cout << K*pow((K-1),(N-1)) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: 'pow' was not declared in this scope 9 | cout << K*pow((K-1),(N-1)) << endl; | ^~~
s303045754
p03963
C++
#include <algorithm> #include <vector> #include <string> #include <set> #include <stdlib.h> using namespace std; int main(){ int N; int K; cin >> N >> K; int ans = 1; for(int i = 1; i < N; i++){ ans *= (K - 1); } ans = ans * K; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'cin' was not declared in this scope 12 | cin >> N >> K; | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <stdlib.h> +++ |+#include <iostream> 6 | using namespace std; a.cc:19:9: error: 'cout' was not declared in this scope 19 | cout << ans << endl; | ^~~~ a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:19:24: error: 'endl' was not declared in this scope 19 | cout << ans << endl; | ^~~~ a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 5 | #include <stdlib.h> +++ |+#include <ostream> 6 | using namespace std;
s561423755
p03963
C++
#include <cstdio> int main() { int n = 0,k = 0; scanf ("%d %d",&n,&k); if (n>1)printf ("%d",n*(n-1)*(k-1)); else printf("%d",k); return 0; }
a.cc: In function 'int main()': a.cc:7:28: error: expected ';' before '\U0000ff1b' 7 | else printf("%d",k); | ^~ | ;
s598801478
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; int ans=b; for(i=1;i<a;i++){ ans *= (b-1) ; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=1;i<a;i++){ | ^
s285291113
p03963
C++
#include<iostream> int main(){ int numB; int numC; int x; std::cin>>numB>>numC; x=numC*std::pow(numC-1,numB-1); std::cout<<"A:"<<x<<std::endl; }
a.cc: In function 'int main()': a.cc:10:15: error: 'pow' is not a member of 'std' 10 | x=numC*std::pow(numC-1,numB-1); | ^~~
s992587668
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,i; cin>>n>>k; int ans=k; for(int i=1;i<n;i++){ ans *=I (k-1); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:23: error: 'I' was not declared in this scope 8 | ans *=I (k-1); | ^
s147311255
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; int ans=k; for(int i=1;i<n;i++){ ans*=I(k-1); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: 'I' was not declared in this scope 8 | ans*=I(k-1); | ^
s330787043
p03963
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; int main(){ int n,k,s; cin>>n>>k; s=k; for(int 2;i<=n;i++){ s*=(k-1); } cout<<s; return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: expected unqualified-id before numeric constant 10 | for(int 2;i<=n;i++){ | ^ a.cc:10:16: error: expected ';' before numeric constant 10 | for(int 2;i<=n;i++){ | ^~ | ; a.cc:10:19: error: 'i' was not declared in this scope 10 | for(int 2;i<=n;i++){ | ^ a.cc:10:23: error: expected ')' before ';' token 10 | for(int 2;i<=n;i++){ | ~ ^ | ) a.cc:10:24: error: 'i' was not declared in this scope 10 | for(int 2;i<=n;i++){ | ^
s264598280
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int i,k,s=1; cin>>n>>k; s=k; for(int i=2;i<=n;i++) { s*=(s-1); } cout<<s; return 0; }
a.cc: In function 'int main()': a.cc:5:10: error: 'n' was not declared in this scope 5 | cin>>n>>k; | ^
s208957081
p03963
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; ll ans; int main(){ int n,k,s; cin>>n>>k; s=k; for(int 2;i<=n;i++){ s*=(k-1); } cout<<s; return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: expected unqualified-id before numeric constant 11 | for(int 2;i<=n;i++){ | ^ a.cc:11:16: error: expected ';' before numeric constant 11 | for(int 2;i<=n;i++){ | ^~ | ; a.cc:11:19: error: 'i' was not declared in this scope 11 | for(int 2;i<=n;i++){ | ^ a.cc:11:23: error: expected ')' before ';' token 11 | for(int 2;i<=n;i++){ | ~ ^ | ) a.cc:11:24: error: 'i' was not declared in this scope 11 | for(int 2;i<=n;i++){ | ^
s212606150
p03963
C++
#include<Stdio.h> #include<math.h> #include<iostream> using namespace std; int main() { long long n, k, ans, q = 1; int i; scanf("%lld %lld", &n, &k); for(i = 1; i <= n - 1; i++) q = q * (k - 1); ans = k * q; printf("%lld\n", ans); return 0; }
a.cc:1:9: fatal error: Stdio.h: No such file or directory 1 | #include<Stdio.h> | ^~~~~~~~~ compilation terminated.
s092677092
p03963
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; int main(){ int N, K, ans; cin >> N >> K; ans = K * pow(K-1, N-1); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: 'pow' was not declared in this scope 13 | ans = K * pow(K-1, N-1); | ^~~
s328710528
p03963
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define ll long long #define pb(a) push_back(a) #define INF 1000000000 using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,K; cin >> N >> K; ll ans=0; if(N==1) ans=K; else ans= K * pow(K-1,N-1) cout << ans << endl; }
a.cc: In function 'int main()': a.cc:27:29: error: expected ';' before 'cout' 27 | else ans= K * pow(K-1,N-1) | ^ | ; 28 | cout << ans << endl; | ~~~~
s643551358
p03963
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define ll long long #define pb(a) push_back(a) #define INF 1000000000 using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,K; cin >> N >> K; ll ans=0; if(N==1) ans=N; else ans= N * pow(N-1,N-1) cout << ans << endl; }
a.cc: In function 'int main()': a.cc:27:29: error: expected ';' before 'cout' 27 | else ans= N * pow(N-1,N-1) | ^ | ; 28 | cout << ans << endl; | ~~~~
s844485157
p03963
C++
#include<iostream> using namespace std; int main() { long long int a,b; cin>>a>>b; cout<<b*pow(b-1,a-1)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: 'pow' was not declared in this scope 7 | cout<<b*pow(b-1,a-1)<<endl; | ^~~
s187881018
p03963
C++
#include <iostream> using namespace std; int main() { long long N, K, ans; cin >> N >> K; ans = K * pow((K - 1), N-1); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:19: error: 'pow' was not declared in this scope 7 | ans = K * pow((K - 1), N-1); | ^~~
s721653979
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int a,b; cin>>a>>b; int ret = b; for (int i = 0; i < n; ++i) { ret*=b-1; } cout<<ret<<endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:8:25: error: 'n' was not declared in this scope 8 | for (int i = 0; i < n; ++i) | ^
s528425745
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int n,k; cin>>k*pow(k-1,n-1)<<endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:6:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'}) 6 | cin>>k*pow(k-1,n-1)<<endl; | ~~~^~~~~~~~~~~~~~~~ | | | | | __gnu_cxx::__promote<double>::__type {aka double} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'double&' to an rvalue of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed: a.cc:6:11: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__gnu_cxx::__promote<double>::__type' {aka 'double'} 6 | cin>>k*pow(k-1,n-1)<<endl; | ~^~~~~~~~~~~~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istr
s933154120
p03963
C++
#include<iostream> #include<algorithm> #include<math.h> #include<string> #include<vector> using namespace std; int main() { int N, K; cin >> N >> K; cout << long long(K * pow(K - 1, N - 1)) << endl; cin >> N; }
a.cc: In function 'int main()': a.cc:9:17: error: expected primary-expression before 'long' 9 | cout << long long(K * pow(K - 1, N - 1)) << endl; | ^~~~
s128113050
p03963
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,k; cin >> n >> k; ans = k; for(int i=1;i<n;i++)ans*=k-1; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | ans = k; | ^~~ | abs
s918327167
p03963
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <list> #include <iomanip> #include <queue> #include <functional> #include <cassert> using namespace std; using ll = unsigned long long; int main() { int n; int k; cin >> n >> k; unsigned long long ans = k * pow(k - 1, n - 1); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:38: error: 'pow' was not declared in this scope 22 | unsigned long long ans = k * pow(k - 1, n - 1); | ^~~
s709193181
p03963
C++
#include <iostream> #include <sstream> #include <math.h> using namespace std; int main(){ int n,k; cin >> n >> k ; int i, ans; ans = 1 ; if (n == 1) { cout << k << endl; } else{ ans = ans * k; for (int i =0; i < n; i++){ ans = ans * k } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:16: error: expected ';' before '}' token 15 | ans = ans * k | ^ | ; 16 | } | ~
s501528668
p03963
Java
import java.math.BigInteger; import java.util.Scanner; import java.io.*; public class Main { public static void main(String args[]) { Scanner cin = new Scanner(System.in); int n,i=1,x,t=1008,k; BigInteger a,b,c; n=cin.nextInt(); k=cin.nextInt(); c=BigInteger.ONE ; b=BigInteger.ONE ; a=BigInteger.ZERO; b=BigInteger.valueOf(k-1); c=b.pow(n-1); b=BigInteger.valueOf(k); a=b.multiply(c); System.out.println(a); } } }
Main.java:23: error: class, interface, enum, or record expected } ^ 1 error
s477602841
p03963
Java
import java.math.BigInteger; import java.util.Scanner; import java.io.*; public class Main { public static void main(String args[]) { Scanner cin = new Scanner(System.in); int n,i=1,x,t=1008,k; BigInteger a,b,c; n=cin.nextInt(); k=cin.nextInt(); c=BigInteger.ONE ; b=BigInteger.ONE ; a=BigInteger.ZERO; b=BigInteger.valueOf(k-1); c=b.pow(n-1); b=b.add(a); a=b.multiply(c); System.out.println(a); } } }
Main.java:23: error: class, interface, enum, or record expected } ^ 1 error
s711361128
p03963
C++
#include <iostream> using namespace std; int main() { int n, w; cin >> n << w; int ans = 1; for (int i = 1; i <= n; ++i) { if(i == 1) ans *= w; else ans *= w-1; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 7 | cin >> n << w; | ~~~~~~~~ ^~ ~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:7:12: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin >> n << w; | ~~~~~~~~~^~~~ a.cc:7:12: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:7: note: cannot convert 'std::cin.std::basic_istream<char>::operator>>(n)' (type 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | cin >> n << w; | ~~~~^~~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:7:15: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:15: required from here 7 | cin >> n << w; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s867086549
p03963
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> using namespace std; int main (void) { int N,K; cin >> N >> K; int ans=K; if (n==1){ cout << ans; return 0; } for (int i=1; i<N; i++) { ans=ans*(K-1); } cout << ans; }
a.cc: In function 'int main()': a.cc:12:7: error: 'n' was not declared in this scope 12 | if (n==1){ | ^
s042423145
p03963
C++
#include<iostream> using namespace std; int main(){ int n,k; cin>>n>>k; int ans=k; for(int i=1;i<n) ans=ans*(k-1); cout<<ans; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before ')' token 7 | for(int i=1;i<n) ans=ans*(k-1); | ^ | ;
s979112433
p03963
C++
#include<iostream> using namespace std; int main(){ int N,K; cin>>N>>K; if(N==1)cout<<K<<endl; else{ int ans=K*pow(N-1,K-1); cout<<ans<<endl; } }
a.cc: In function 'int main()': a.cc:8:15: error: 'pow' was not declared in this scope 8 | int ans=K*pow(N-1,K-1); | ^~~
s222232711
p03963
C++
#include<iostream> using namespace std; int main(){ int N,K; cin>>N>>K if(N==1)cout<<K<<endl; else{ int ans=K*pow(N-1,K-1); cout<<ans<<endl; } }
a.cc: In function 'int main()': a.cc:5:12: error: expected ';' before 'if' 5 | cin>>N>>K | ^ | ; 6 | if(N==1)cout<<K<<endl; | ~~ a.cc:7:3: error: 'else' without a previous 'if' 7 | else{ | ^~~~ a.cc:8:15: error: 'pow' was not declared in this scope 8 | int ans=K*pow(N-1,K-1); | ^~~
s599590950
p03963
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int ans = k; for(int i = 0; i < n-1; i++) { ans *= (k-1) } System.out.println(ans); } }
Main.java:10: error: ';' expected ans *= (k-1) ^ 1 error
s271844322
p03963
C++
#include <cstdio> #include <iostream> #include <cstring> #include <algorithm> using namespace std; int main(){ long long N,K; scanf("%lld %lld",&N,&K); long long ans=K; for(long long i=1;i<=N;i++){ ans=ans*(K-1); } printf("%lld\n",ans) return 0; }
a.cc: In function 'int main()': a.cc:13:23: error: expected ';' before 'return' 13 | printf("%lld\n",ans) | ^ | ; 14 | return 0; | ~~~~~~
s517814668
p03963
C++
#include <iostream> #include <string> #include <algorithm> #define MOD 1000000007; using namespace std; int main() { int N, K; cin >> N >> K; int M = pow(K - 1, N - 1); cout << K * M; return 0; } int pow(int A, int B) { if (B % 2 == 1) { return pow(A*A, B / 2)* A; } else if (B == 0) { return 1; } else if (B % 2 == 0) { return pow(A*A, B / 2); } }
a.cc: In function 'int main()': a.cc:12:17: error: 'pow' was not declared in this scope 12 | int M = pow(K - 1, N - 1); | ^~~ a.cc: In function 'int pow(int, int)': a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type] 33 | } | ^