submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s997247666
p03962
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); if(a==b$$b==c&&c==a){ System.out.println(1); }else if(a==b||b==c||c==a){ System.out.println(2); }else if(a!=b&&b!=c&&c!=a){ System.out.println(3) } } }
Main.java:13: error: ';' expected System.out.println(3) ^ 1 error
s286955596
p03962
Java
public class Main { public static void main(String[] args) { int a[] = new int[3]; Scanner sc = new Scanner(System.in); a[0] = sc.nextInt(); a[1] = sc.nextInt(); a[2] = sc.nextInt(); Arrays.sort(a); if(a[0]==a[1] && a[1]==a[2]) System.out.println("1"); else if(a[0]==a[1] || a[1]==a[2])System.out.println("2"); else System.out.println("3"); } }
Main.java:6: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:10: error: cannot find symbol Arrays.sort(a); ^ symbol: variable Arrays location: class Main 3 errors
s286994484
p03962
C++
#include<iostream> using namespace std; bool use[110]; int main(){ int i=3,x,ans while(i>0){ cin>>x;if(!use[x])++ans; use[x]=true; --i; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: expected initializer before 'while' 6 | while(i>0){ | ^~~~~ a.cc:11:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | cout<<ans<<endl; | ^~~ | abs
s369318719
p03962
C++
#include <iostream> using namespace std; int main(void){ int a,b,c,s=0; int[101] arr={}; cin >> a >> b >> c; int[a]=1; int[b]=1; int[c]=1; for(int i=0;i<101;i++){ s+=arr[i]; } cout << s; return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: expected identifier before numeric constant 6 | int[101] arr={}; | ^~~ a.cc:6:13: error: expected ']' before numeric constant 6 | int[101] arr={}; | ^~~ | ] a.cc:6:12: error: structured binding declaration cannot have type 'int' 6 | int[101] arr={}; | ^ a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:6:12: error: empty structured binding declaration a.cc:6:18: error: expected initializer before 'arr' 6 | int[101] arr={}; | ^~~ a.cc:8:12: error: structured binding declaration cannot have type 'int' 8 | int[a]=1; | ^~~ a.cc:8:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:8:13: error: conflicting declaration 'auto a' 8 | int[a]=1; | ^ a.cc:5:13: note: previous declaration as 'int a' 5 | int a,b,c,s=0; | ^ a.cc:9:12: error: structured binding declaration cannot have type 'int' 9 | int[b]=1; | ^~~ a.cc:9:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:9:13: error: conflicting declaration 'auto b' 9 | int[b]=1; | ^ a.cc:5:15: note: previous declaration as 'int b' 5 | int a,b,c,s=0; | ^ a.cc:10:12: error: structured binding declaration cannot have type 'int' 10 | int[c]=1; | ^~~ a.cc:10:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:10:13: error: conflicting declaration 'auto c' 10 | int[c]=1; | ^ a.cc:5:17: note: previous declaration as 'int c' 5 | int a,b,c,s=0; | ^ a.cc:12:20: error: 'arr' was not declared in this scope 12 | s+=arr[i]; | ^~~
s535515263
p03962
C++
#include <iostream> using namespace std; int main(void){ int a,b,c,s=0; int[101] arr={}; cin >> a >> b >> c; int[a]=1; int[b]=1; int[c]=1; for(int i=0;i<101;i++){ s+=arr[i] } cout << s; return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: expected identifier before numeric constant 6 | int[101] arr={}; | ^~~ a.cc:6:13: error: expected ']' before numeric constant 6 | int[101] arr={}; | ^~~ | ] a.cc:6:12: error: structured binding declaration cannot have type 'int' 6 | int[101] arr={}; | ^ a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:6:12: error: empty structured binding declaration a.cc:6:18: error: expected initializer before 'arr' 6 | int[101] arr={}; | ^~~ a.cc:8:12: error: structured binding declaration cannot have type 'int' 8 | int[a]=1; | ^~~ a.cc:8:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:8:13: error: conflicting declaration 'auto a' 8 | int[a]=1; | ^ a.cc:5:13: note: previous declaration as 'int a' 5 | int a,b,c,s=0; | ^ a.cc:9:12: error: structured binding declaration cannot have type 'int' 9 | int[b]=1; | ^~~ a.cc:9:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:9:13: error: conflicting declaration 'auto b' 9 | int[b]=1; | ^ a.cc:5:15: note: previous declaration as 'int b' 5 | int a,b,c,s=0; | ^ a.cc:10:12: error: structured binding declaration cannot have type 'int' 10 | int[c]=1; | ^~~ a.cc:10:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:10:13: error: conflicting declaration 'auto c' 10 | int[c]=1; | ^ a.cc:5:17: note: previous declaration as 'int c' 5 | int a,b,c,s=0; | ^ a.cc:12:20: error: 'arr' was not declared in this scope 12 | s+=arr[i] | ^~~
s057978917
p03962
C++
#include<iostream> using namespace std; bool use[110]; int main(){ int i=3,x,ans while(i<3){ cin>>x;if(!use[x])++ans; use[x]=true; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: expected initializer before 'while' 6 | while(i<3){ | ^~~~~ a.cc:10:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | cout<<ans<<endl; | ^~~ | abs
s550415755
p03962
C++
include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int cnt = 3; if (a==b) cnt--; if (a==c) cnt--; if (b==c) cnt--; printf("%d\n", cnt); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s199471456
p03962
C++
#include "bits/stdc++.h" #ifdef LOCAL_DEBUG #include "bits/mytest.h" #endif using namespace std; #pragma region user_defined #define CLR(arr,val) fill(arr.begin(),arr.end(),val); #define CLR0(arr) CLR(arr,0) #define d2clear(arr,data) for(int i =0;i<arr.size();i++){for(int j =0;j<arr[i].size();j++){arr[i][j]=data;}} #define d2print(arr) for(int i =0;i<arr.size();i++){for(int j =0;j<arr[i].size();j++){cout<<arr[i][j];} cout<<endl;} #define d2array(name,type,rows,cols,data) vector< vector<type> > name(rows,vector<type>(cols,data)) #define forit(arr,it) for(auto it=arr.begin();it!=arr.end();it++) #define rforit(arr,it) for(auto it=arr.rbegin();it!=arr.rend();it++) #define LL long long #define A(n) n.begin(),n.end() #define maxn(a,b) ((a)=((a)>(b)?(a):(b))) #define minn(a,b) ((a)=((a)<(b)?(a):(b))) #define min(a,b) ( (a)<(b)?(a):(b) ) #define max(a,b) ( (a)>(b)?(a):(b) ) #define last(a) a[a.size()-1] #define first(a) a[0] #define println(a) cout<<a<<endl; #define mp(a,b) make_pair(a,b) #pragma endregion //#define MULTI_CASE class Solution{ void solve(istream & cin = std::cin, ostream & cout = std::cout){ int a, b, c; cin >> a >> b >> c; vector<int> arr(101, 0); arr[a] = 1; arr[b] = 1; arr[c] = 1; int cnt = 0; for (int i = 0; i <=100; i++) { cnt += arr[i]; } cout << cnt << endl; } } int main() { #ifdef LOCAL_DEBUG MyTest::Judge::JudgeNormal judge; MyTest::Config config; config.judge = &judge; MyTest::Test test(config); const string ITEM_NAME("A.cpp"); const string FILE_NAME(__FILE__); auto it=FILE_NAME.find_last_of('\\'); auto inputfile = FILE_NAME.substr(0, it + 1) + ITEM_NAME.substr(0, ITEM_NAME.find_last_of('.')) + "_input.txt"; auto outputfile = FILE_NAME.substr(0, it + 1) + ITEM_NAME.substr(0, ITEM_NAME.find_last_of('.')) + "_output.txt"; freopen(inputfile.c_str(), "r", stdin); //freopen(outputfile.c_str(), "w", stdout); while (test.ReadCaseInOneFile()) { test.Begin(); Solution s; s.solve(test.Input(),test.Output()); test.End(); } test.DisplayInfo(); #else //online judge #ifdef MULTI_CASE int t;cin>>t; while(t--){ Solution s; s.solve(); } #else Solution s; s.solve(); #endif #endif return 0; }
a.cc:52:2: error: expected ';' after class definition 52 | } | ^ | ; a.cc: In function 'int main()': a.cc:87:16: error: 'void Solution::solve(std::istream&, std::ostream&)' is private within this context 87 | s.solve(); | ~~~~~~~^~ a.cc:38:14: note: declared private here 38 | void solve(istream & cin = std::cin, ostream & cout = std::cout){ | ^~~~~
s570729082
p03962
C++
#include <iostream> int main(void) { int hello[101]; for(int i = 0; i < 101; ++i) { hello[i] = 0; } int a, b, c; cin >> a >> b >> c; hello[a] += 1; hello[b] += 1; hello[c] += 1; int count = 0; for(int i = 0; i < 101; ++i){ if(hello[i]) ++count; } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> a >> b >> c; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:17:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 17 | cout << count << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:17:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 17 | cout << count << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s457851082
p03962
C++
#include <bits/stdc++.h> using namespace std; int main{ int a,b,c; cin>>a>>b>>c; if(a==b&&a==c)cout<<1<<endl; else if(a==b&&a!=c)cout<<2<<endl; else if(a==c&&a!=b)cout<<2<<endl; else if(b==c&&c!=a)cout<<2<<endl; else cout<<3<<endl; return 0; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:5: error: expected primary-expression before 'int' 4 | int a,b,c; | ^~~ a.cc:4:5: error: expected '}' before 'int' a.cc:3:9: note: to match this '{' 3 | int main{ | ^ a.cc:5:5: error: 'cin' does not name a type 5 | cin>>a>>b>>c; | ^~~ a.cc:6:5: error: expected unqualified-id before 'if' 6 | if(a==b&&a==c)cout<<1<<endl; | ^~ a.cc:7:5: error: expected unqualified-id before 'else' 7 | else if(a==b&&a!=c)cout<<2<<endl; | ^~~~ a.cc:8:5: error: expected unqualified-id before 'else' 8 | else if(a==c&&a!=b)cout<<2<<endl; | ^~~~ a.cc:9:5: error: expected unqualified-id before 'else' 9 | else if(b==c&&c!=a)cout<<2<<endl; | ^~~~ a.cc:10:5: error: expected unqualified-id before 'else' 10 | else cout<<3<<endl; | ^~~~ a.cc:11:1: error: expected unqualified-id before 'return' 11 | return 0; | ^~~~~~ a.cc:12:1: error: expected declaration before '}' token 12 | } | ^
s018616527
p03962
C++
#include <iostream> using namespace std; int main(void){ int a,b,c,s=0; int[101] arr={}; cin >> a >> b >> c; int[a]=1; int[b]=1; int[c]=1; for(int i=0;i<101;i++){ s+=arr[i] } cout << s; return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: expected identifier before numeric constant 6 | int[101] arr={}; | ^~~ a.cc:6:13: error: expected ']' before numeric constant 6 | int[101] arr={}; | ^~~ | ] a.cc:6:12: error: structured binding declaration cannot have type 'int' 6 | int[101] arr={}; | ^ a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:6:12: error: empty structured binding declaration a.cc:6:18: error: expected initializer before 'arr' 6 | int[101] arr={}; | ^~~ a.cc:8:12: error: structured binding declaration cannot have type 'int' 8 | int[a]=1; | ^~~ a.cc:8:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:8:13: error: conflicting declaration 'auto a' 8 | int[a]=1; | ^ a.cc:5:13: note: previous declaration as 'int a' 5 | int a,b,c,s=0; | ^ a.cc:9:12: error: structured binding declaration cannot have type 'int' 9 | int[b]=1; | ^~~ a.cc:9:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:9:13: error: conflicting declaration 'auto b' 9 | int[b]=1; | ^ a.cc:5:15: note: previous declaration as 'int b' 5 | int a,b,c,s=0; | ^ a.cc:10:12: error: structured binding declaration cannot have type 'int' 10 | int[c]=1; | ^~~ a.cc:10:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:10:13: error: conflicting declaration 'auto c' 10 | int[c]=1; | ^ a.cc:5:17: note: previous declaration as 'int c' 5 | int a,b,c,s=0; | ^ a.cc:12:20: error: 'arr' was not declared in this scope 12 | s+=arr[i] | ^~~
s285177864
p03962
Java
import java.io.*; import java.util.*; /** * Created by fcdkbear on 15.10.16. */ public class Solution { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Set<Integer> colors = new HashSet<>(); for (int i = 0; i < 3; ++i) { int color = in.nextInt(); colors.add(color); } out.println(colors.size()); out.close(); } static class Pair { private long first; private int second; public Pair(long first, int second) { this.first = first; this.second = second; } public long getFirst() { return first; } public void setFirst(long first) { this.first = first; } public int getSecond() { return second; } public void setSecond(int second) { this.second = second; } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } } }
Main.java:7: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s816912490
p03962
C++
#include <bits/stdc++.h> int main{ int a,b,c; cin>>a>>b>>c; if(a==b&&a==c)cout<<1<<endl; else if(a==b&&a!=c)cout<<2<<endl; else if(a==c&&a!=b)cout<<2<<endl; else if(b==c&&c!=a)cout<<2<<endl; else cout<<3<<endl; return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main{ | ^~~~ a.cc:3:5: error: expected primary-expression before 'int' 3 | int a,b,c; | ^~~ a.cc:3:5: error: expected '}' before 'int' a.cc:2:9: note: to match this '{' 2 | int main{ | ^ a.cc:4:5: error: 'cin' does not name a type 4 | cin>>a>>b>>c; | ^~~ a.cc:5:5: error: expected unqualified-id before 'if' 5 | if(a==b&&a==c)cout<<1<<endl; | ^~ a.cc:6:5: error: expected unqualified-id before 'else' 6 | else if(a==b&&a!=c)cout<<2<<endl; | ^~~~ a.cc:7:5: error: expected unqualified-id before 'else' 7 | else if(a==c&&a!=b)cout<<2<<endl; | ^~~~ a.cc:8:5: error: expected unqualified-id before 'else' 8 | else if(b==c&&c!=a)cout<<2<<endl; | ^~~~ a.cc:9:5: error: expected unqualified-id before 'else' 9 | else cout<<3<<endl; | ^~~~ a.cc:10:1: error: expected unqualified-id before 'return' 10 | return 0; | ^~~~~~ a.cc:11:1: error: expected declaration before '}' token 11 | } | ^
s444551735
p03962
C++
tr \ \\n|sort -u|wc -l
a.cc:1:4: error: stray '\' in program 1 | tr \ \\n|sort -u|wc -l | ^ a.cc:1:7: error: stray '\' in program 1 | tr \ \\n|sort -u|wc -l | ^ a.cc:1:8: error: stray '\' in program 1 | tr \ \\n|sort -u|wc -l | ^ a.cc:1:1: error: 'tr' does not name a type 1 | tr \ \\n|sort -u|wc -l | ^~
s747012847
p03963
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <functional> #include <cmath> #include <map> #include <iomanip> int main() { long long N, K; std::cin >> N >> K; long long ans = k; for (int i = 0; i < N - 1; ++i) { ans *= k - 1; } std::cout << ans << std::endl; }
a.cc: In function 'int main()': a.cc:12:25: error: 'k' was not declared in this scope 12 | long long ans = k; | ^
s285587914
p03963
C++
#include <bits/stdc++.h> #define s second #define f first #define pb push_back #define endl '\n' using namespace std; typedef long long ll; typedef pair<int,int> pii; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fLL; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int N,K; cin >> N >> K; if(N == 1) cout << K << endl, return 0; ll ans = 1; for(int i = 0; i < N - 1; i++) ans *= K; ans *= K - 1; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:39: error: expected primary-expression before 'return' 22 | if(N == 1) cout << K << endl, return 0; | ^~~~~~
s553800766
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; ans = K * pow(K-1,N-1); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | ans = K * pow(K-1,N-1); | ^~~ | abs
s158921869
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; ans = K * pow(K-1,N-1) }
a.cc: In function 'int main()': a.cc:7:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | ans = K * pow(K-1,N-1) | ^~~ | abs
s658833936
p03963
C++
#include <bits/stdc++.h> #include <vector> using namespace std; int main(){ int n, k; int ans=0; cin>>n>>k; ans = (k-1)**(n-1); ans *= k; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:17: error: invalid type argument of unary '*' (have 'int') 9 | ans = (k-1)**(n-1); | ^~~~~~
s162137124
p03963
C++
q
a.cc:1:1: error: 'q' does not name a type 1 | q | ^
s156503895
p03963
C++
#include <bits/stdc++.h> #include <vector> #include <algorithm> #include <iostream> using namespace std; int main() { int N, K, ans; cin >> N >> K; ans=K; if (N>=2) { for (int i=0; i<N-1) { ans=ans*(K-1); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:24: error: expected ';' before ')' token 12 | for (int i=0; i<N-1) { | ^ | ;
s119713246
p03963
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int k = scn.nextInt(); int ans = (int)k*(Math.pow(k-1,n-1)); System.out.print("ans"); } }
Main.java:8: error: incompatible types: possible lossy conversion from double to int int ans = (int)k*(Math.pow(k-1,n-1)); ^ 1 error
s921000150
p03963
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int k = scn.nextInt(); int ans = (int)k*Math.pow(k-1,n-1); System.out.print("ans"); } }
Main.java:8: error: incompatible types: possible lossy conversion from double to int int ans = (int)k*Math.pow(k-1,n-1); ^ 1 error
s119336004
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 * Math.pow(k-1,n-1); System.out.println(ans); } }
Main.java:8: error: incompatible types: possible lossy conversion from double to int int ans = k * Math.pow(k-1,n-1); ^ 1 error
s386257984
p03963
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Main m = new Main(sc); m.show(m.solve()); m.debug(); } Scanner sc; long N = 0; long K = 0; long answer = K; // 標準入力用のコンストラクタ public Main(Scanner sc) { this.sc = sc; N = sc.nextLong(); K = sc.nextLong(); } // 判定処理 long solve() { //int[] ball = new int[N]; //色の種類数を格納するボールの配列 for (int i = 1; i < N; ++i){ if (N == 1){ break; } else { //ball[i] = K; answer *= K - 1; } } return answer; } // 回答の表示 void show(long answer) { System.out.println(answer); } }
Main.java:8: error: cannot find symbol m.debug(); ^ symbol: method debug() location: variable m of type Main 1 error
s972428772
p03963
Java
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> typedef long long ll; using namespace std; int main(void) { cout << fixed << setprecision(12); ll n, k; cin >> n >> k; ll ans = k; for(int i = 0; i < n - 1; i++) { ans *= k - 1; } cout << ans << endl; return 0; }
Main.java:1: error: illegal character: '#' #include <algorithm> ^ Main.java:2: error: illegal character: '#' #include <cmath> ^ Main.java:3: error: illegal character: '#' #include <iomanip> ^ Main.java:4: error: illegal character: '#' #include <iostream> ^ Main.java:5: error: illegal character: '#' #include <string> ^ Main.java:7: error: class, interface, enum, or record expected using namespace std; ^ Main.java:10: error: not a statement cout << fixed << setprecision(12); ^ Main.java:12: error: not a statement cin >> n >> k; ^ Main.java:18: error: not a statement cout << ans << endl; ^ Main.java:9: error: unnamed classes are a preview feature and are disabled by default. int main(void) { ^ (use --enable-preview to enable unnamed classes) Main.java:9: error: <identifier> expected int main(void) { ^ 11 errors
s002318670
p03963
C++
#include <bits/stdc++.h> using namespace std int main(){ long long N, K, ans; cin >> N >> K; ans = K; for(long long i=0; i<N-1; i++){ ans *= K-1; } cout << ans << endl; return 0; }
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | int main(){ | ~~~
s370005021
p03963
C++
#include <bits/stdc++.h> int main(){ long long N, K, ans; cin >> N >> K; ans = K; for(long long i=0; i<N-1; i++){ ans *= K-1; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> N >> K; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:10:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, 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: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s060721195
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int count = N; int answer = K; for (int i = 1; i < count; i++) { answer *= (K-1); } cout << answer }
a.cc: In function 'int main()': a.cc:13:19: error: expected ';' before '}' token 13 | cout << answer | ^ | ; ...... 18 | } | ~
s311913758
p03963
C++
#include<complex>// #include<bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using V = vector<int>; using VV = vector<V>; using VVV = vector<VV>; using VL = vector<ll>; using VVL = vector<VL>; using VVVL = vector<VVL>; template<class T> using VE = vector<T>; template<class T> using P = pair<T, T>; #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define REP(i,k,n) for(int i=(k);i<(n);i++) #define all(a) (a).begin(),(a).end() #define output(x,y) cout << fixed << setprecision(y) << x << endl; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } const ll MOD = 1e9 + 7; // const ll MOD = 998244353; ll upper = MOD + MOD; ll under = -upper; ll UPPER = MOD * MOD; ll UNDER = -UPPER; const long double pi = 3.141592653589793; int main() { ll n, k; cin >> n >> k; ll ans = k; k--; rep(i, n - 1) ans *= k; cout << ans << endl; return 0; }
a.cc:6:11: error: 'vector' does not name a type 6 | using V = vector<int>; | ^~~~~~ a.cc:7:12: error: 'vector' does not name a type 7 | using VV = vector<V>; | ^~~~~~ a.cc:8:13: error: 'vector' does not name a type 8 | using VVV = vector<VV>; | ^~~~~~ a.cc:9:12: error: 'vector' does not name a type 9 | using VL = vector<ll>; | ^~~~~~ a.cc:10:13: error: 'vector' does not name a type 10 | using VVL = vector<VL>; | ^~~~~~ a.cc:11:14: error: 'vector' does not name a type 11 | using VVVL = vector<VVL>; | ^~~~~~ a.cc:12:30: error: 'vector' does not name a type 12 | template<class T> using VE = vector<T>; | ^~~~~~ a.cc: In function 'int main()': a.cc:32:9: error: 'cin' was not declared in this scope 32 | cin >> n >> k; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<complex>// #include<bits/stdc++.h> +++ |+#include <iostream> 3 | using namespace std; a.cc:36:9: error: 'cout' was not declared in this scope 36 | cout << ans << endl; | ^~~~ a.cc:36:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s359579486
p03963
C++
#include <algorithm> #include <ctype.h> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define ENDL '\n' #define FOR(i, n) for (int i = 0; i < n; i++) #define FOR_EACH(i, v) for (auto&& i : v); int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; int K; cin >> N >> K; cout << K * (int)pow(K - 1, N - 1) << ENDL; return 0; }
a.cc: In function 'int main()': a.cc:30:26: error: 'pow' was not declared in this scope 30 | cout << K * (int)pow(K - 1, N - 1) << ENDL; | ^~~
s233704745
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin>>N>>K; int pattern=1; for(int i=1;i<=N;i++){ if(i==1){ pattern*=K; } else{ pattern*=(K-1); } cout<<pattern<<endl; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s593411858
p03963
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); long x = (long) Math.pow(k-1, n-1) * k; System.out.println(x); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s103535957
p03963
C++
#include<iostream> using namespace std; using ll = long long; int main() { int N, K; cin >> N >> K; ll ans = K; ll Q = pow(K - 1, N - 1); cout << ans * Q << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: 'pow' was not declared in this scope 10 | ll Q = pow(K - 1, N - 1); | ^~~
s493782989
p03963
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define rep2(i,n) for(int i=0;i<=n;i++) #define repr(i,a,n) for(int i=a;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define uni(e) e.erase(unique(e.begin(),e.end()),e.end()) #define double long double template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int INF=1e10; int MOD=1e9+7; template<class T> void out(T a){cout<<a<<'\n';} template<class T> void yesno(T b){if(b)out("yes");else out("no");} template<class T> void YesNo(T b){if(b)out("Yes");else out("No");} template<class T> void YESNO(T b){if(b)out("YES");else out("NO");} template<class T> void noyes(T b){if(b)out("no");else out("yes");} template<class T> void NoYes(T b){if(b)out("No");else out("Yes");} template<class T> void NOYES(T b){if(b)out("NO");else out("YES");} int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int kurai(int a,int b){ int m=pow(10,b),n=pow(10,b-1); return (a%m)/n; } int ketawa(int a){ int k=0; rep(i,keta(a)){ k+=kurai(a,i+1); } return k; } int gcd(int a,int b){ if(a%b==0) return b; return gcd(b,a%b); } int lcm(int a,int b){ return a/gcd(a,b)*b; } int mid(int a,int b,int c){ vector<int> k(3); k[0]=a;k[1]=b;k[2]=c; sort(all(k)); return k[1]; } bool sosuu(int a){ bool b=1; if(a<=1) return 0; else{ rep1(i,sqrt(a)-1){ if(a%(i+1)==0) b=0; } return b; } } int modpow(int a,int b,int m=MOD){ if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m; int memo = modpow(a,b>>1,m); return memo*memo%m; } int fact_mod(int n) { int f=1; for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD; return f; } int mod_pow(int x,int n) { int res=1; while(n>0){ if(n&1) res=(res*x)%MOD; x=(x*x)%MOD; n>>=1; } return res; } int c_mod(int n, int r) { if(r>n-r) r=n-r; if(r==0) return 1; int a=1; rep(i,r) a=a*((n-i)%MOD)%MOD; int b=mod_pow(fact_mod(r), MOD-2); return (a%MOD)*(b%MOD)%MOD; } signed main(){ int a,b; cin>>a>>b; int c=b; rep(i,a-1) c*=b-1 out(c); }
a.cc: In function 'int main()': a.cc:100:11: error: expected ';' before 'out' 100 | c*=b-1 | ^ | ; 101 | out(c); | ~~~
s056671693
p03963
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,k; cin>>n>>k; int ans; ans=k*pow(k-1,n-1) cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:27: error: expected ';' before 'cout' 8 | ans=k*pow(k-1,n-1) | ^ | ; 9 | cout<<ans<<endl; | ~~~~
s447657154
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long N,K; cin >> N >> K; long long ans = 1; for(int i = 0; i < N; i++) { if(i = 0) { ans*N; } else { ans*(N-1) } } cout << ans <<endl; }
a.cc: In function 'int main()': a.cc:13:22: error: expected ';' before '}' token 13 | ans*(N-1) | ^ | ; 14 | } | ~
s477226900
p03963
C
#include<stdio.h> #include<math.h> int main() { int a,b; scnaf("%d %d",&a,&b); long long int c=b; c=c+pow(a-1,b-1); printf("%lld",c); return 0; }
main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scnaf("%d %d",&a,&b); | ^~~~~ | scanf
s694743768
p03963
C
#include<stdio.h> #include<math.h> int main() { int a,b; scnaf("%d %d",&a,&b); long long int c=b; c=c+pow(a-1,n-1); printf("%lld",c); return 0; }
main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scnaf("%d %d",&a,&b); | ^~~~~ | scanf main.c:8:15: error: 'n' undeclared (first use in this function) 8 | c=c+pow(a-1,n-1); | ^ main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
s700164688
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; long long total; for (int i=0; i<N; i++) { if (i=0) total=K; else to tal*=(K-1); } cout << total << endl; }
a.cc: In function 'int main()': a.cc:10:13: error: 'to' was not declared in this scope; did you mean 'tm'? 10 | else to | ^~ | tm
s019008111
p03963
C++
#include<bits/stdc++.h> using namespace std; int name(){ int N, K; cin >> N >> K ; cout << N*((N-1)^(K-1)) << endl; }
a.cc: In function 'int name()': a.cc:9:1: warning: no return statement in function returning non-void [-Wreturn-type] 9 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s677331059
p03963
C++
#include<bits/stdc++.h> using namespace std; int name(){ int N, K; cin >> N >> K ; cout << N*((N-1)^(K-1)) << endl; }
a.cc: In function 'int name()': a.cc:9:1: warning: no return statement in function returning non-void [-Wreturn-type] 9 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s497465361
p03963
Java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Washoum */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; inputClass in = new inputClass(inputStream); PrintWriter out = new PrintWriter(outputStream); APassword solver = new APassword(); solver.solve(1, in, out); out.close(); } static class APassword { public void solve(int testNumber, inputClass sc, PrintWriter out) { int n = sc.nextInt(); int k = sc.nextInt(); long num=1; for (int i = 0 ; i < n-1 ;i++){ num*=(k-1); } out.prinltn(num*k); } } static class inputClass { BufferedReader br; StringTokenizer st; public inputClass(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } public String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }
Main.java:36: error: cannot find symbol out.prinltn(num*k); ^ symbol: method prinltn(long) location: variable out of type PrintWriter 1 error
s963541521
p03963
C++
#include <iostream> #include <map> #include <unordered_map> #include <set> #include <utility> #include <stack> #include <cstdio> #include <string> #include <cmath> #include <cstring> #include <vector> #include <queue> #include <algorithm> #include <iterator> #include <sstream> #define popcount(x) __builtin_popcount(x) #define oddparity(x) __builtin_parity(x) #define clz(x) __builtin_clz(x) #define ctz(x) __builtin_ctz(x) #define sf scanf #define pf printf using namespace std; vector<double>up, down; int i, j, n, k; double ans = 1; int main() { sf("%d%d", &n, &k); for (i = 1; i <= n; i++) { if (i == 1) { for (j = k; j > 0; j--) { up.push_back(double(j)); if (j <= k-1) down.push_back(double(j)); } } else { for (j = k-1; j > 0; j--) { up.push_back(double(j)); if (j <= k-2) down.push_back(double(j)); } } } for (i = 0, j = 0; i < up.size(); ) { if (ans * up[i] > INT_MAX) { ans /= down[j]; j++; } else { ans *= up[i]; i++; } } while (j < down.size()) { ans /= down[j]; j++; } pf("%d\n", (int)ans); return 0; }
a.cc: In function 'int main()': a.cc:46:27: error: 'INT_MAX' was not declared in this scope 46 | if (ans * up[i] > INT_MAX) { | ^~~~~~~ a.cc:16:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 15 | #include <sstream> +++ |+#include <climits> 16 | #define popcount(x) __builtin_popcount(x)
s964527261
p03963
C
# include <iostream> # include <string> # include <cmath> using namespace std; int main() { int n, k; cin >> n >> k; cout << k * pow(k - 1, n - 1); }
main.c:1:11: fatal error: iostream: No such file or directory 1 | # include <iostream> | ^~~~~~~~~~ compilation terminated.
s386212526
p03963
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n,k; cin >> n >> k; cout << k*(int)pow(k-1,n-1); }
a.cc: In function 'int main()': a.cc:8:18: error: 'pow' was not declared in this scope 8 | cout << k*(int)pow(k-1,n-1); | ^~~
s866836566
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N , K ; cin >> N >> K ; X = pow(k-1,N) ; cout << X*K << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'X' was not declared in this scope 7 | X = pow(k-1,N) ; | ^ a.cc:7:11: error: 'k' was not declared in this scope 7 | X = pow(k-1,N) ; | ^
s413643484
p03963
C++
#include<bits/stdc++.h> using namespace std; #define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; #define pb push_back #define fi first #define se second #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p){os<<"("<<p.first<<","<< p.second<<")";return os;} template <class T> ostream &operator<<(ostream &os, const vector<T> &v){os<<"{";REP(i,(int)v.size()){if(i)os<<",";os<<v[i];}os<<"}";return os;} template <typename T, size_t S> void printArray(const T (&array)[S]){for(auto val : array)std::cout << val << ", ";std::cout << "\n";} void Yes() {cout << "Yes" << endl;} void No() {cout << "No" << endl;} void YES() {cout << "YES" << endl;} void NO() {cout << "NO" << endl;} const double PI=acos(-1); const ll MOD = 1000000007; using Graph = vector<vector<int>>; //const int dx[4] = {1, 0, -1, 0}; //const int dy[4] = {0, 1, 0, -1}; //const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; //const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; ll mypow(ll a, ll n){ ll res = 1; while(n>0){ if(n&1) res = res*a; a = a*a; n >>= 1; } return res; } void solve(){ ll n, k; cin >> n >> k; cout << k*mypow(k-1, n-1)) << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }
a.cc: In function 'void solve()': a.cc:35:30: error: expected ';' before ')' token 35 | cout << k*mypow(k-1, n-1)) << endl; | ^ | ;
s888105013
p03963
C++
#include <bits/stdc++.h> using namespace std; 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:7:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | ans = K; | ^~~ | abs
s510886873
p03963
C++
n,k = map(int,input().split()) ans = k for i in range(0,n-1): ans*=(k-1) print(ans)
a.cc:1:1: error: 'n' does not name a type 1 | n,k = map(int,input().split()) | ^
s456987461
p03963
C++
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define debug(v) \ cout << #v << ":"; \ for (auto x : v) \ { \ cout << x << ' '; \ } \ cout << endl; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } //cout<<fixed<<setprecision(15);有効数字15桁 //-std=c++14 //-std=gnu++17 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } ll n, m; vector<int> a; int main() { cin.tie(0); ios::sync_with_stdio(false); ll k; cin >> n>>k; ll ans=k for (int i = 0; i < n-1; i++) { ans*=(k-1); } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:59:5: error: expected ',' or ';' before 'for' 59 | for (int i = 0; i < n-1; i++) | ^~~ a.cc:59:21: error: 'i' was not declared in this scope 59 | for (int i = 0; i < n-1; i++) | ^
s542134480
p03963
C++
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define debug(v) \ cout << #v << ":"; \ for (auto x : v) \ { \ cout << x << ' '; \ } \ cout << endl; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } //cout<<fixed<<setprecision(15);有効数字15桁 //-std=c++14 //-std=gnu++17 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } ll n, m; vector<int> a; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n>>k; ll ans=k for (int i = 0; i < n-1; i++) { ans*=(k-1); } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:56:15: error: 'k' was not declared in this scope 56 | cin >> n>>k; | ^ a.cc:58:21: error: 'i' was not declared in this scope 58 | for (int i = 0; i < n-1; i++) | ^
s547431324
p03963
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int N, K; cin N >> K; int cnt=K; for (int i=1; i<N; i++) { cnt*=(K-1); } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:8:6: error: expected ';' before 'N' 8 | cin N >> K; | ^~ | ;
s641785713
p03963
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int N, K; cin N >> K; int cnt=K; for (int i=1; i<N; i++) { cnt*(K-1); } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:8:6: error: expected ';' before 'N' 8 | cin N >> K; | ^~ | ;
s538356768
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K; cin>>N>>K; if(N=1){ cout<<K<<endl; } else{ int s=1; for(int i=0;i<N-1;i++){ s = (K-1)*s; } } cout<<K*s<<endl; }
a.cc: In function 'int main()': a.cc:16:11: error: 's' was not declared in this scope 16 | cout<<K*s<<endl; | ^
s084218969
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K; cin>>N>>K; if(N=1){ cout<<K<<endl; } else{ int s=1; for(int i=0;i<N-1;i++){ (K-1)*s; } } cout<<K*s<<endl; }
a.cc: In function 'int main()': a.cc:16:11: error: 's' was not declared in this scope 16 | cout<<K*s<<endl; | ^
s191877476
p03963
Java
import java.util.Scanner; /** * B */ public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int result = k; for (int i = 1; i < n; i++) { result *= k - 1; } System.out.println(result); sc.close(); } }
Main.java:6: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s460826465
p03963
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //max=({}); //条件式が真ならwhileの中身を回し続ける //printf("%d\n", ans); //pairの入力 //vector<pair<ll, ll>>work(n); //rep(i, n) { // ll a, b; // cin >> a >> b; // work[i] = make_pair(a, b); //for(auto p:mp)(mapの探索) //printf("%.10f\n",なんちゃら) int g[15][15]; const int INF = 1001001001; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,-1,0,1 }; //最大公約数 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { if (x == 0 || y == 0)return 0; return (x / gcd(x, y) * y); } //素因数分解 vector<pair<ll, int>>factorize(ll n) { vector<pair<ll, int>>res; for (ll i = 2;i * i <= n;++i) { if (n % i)continue; res.emplace_back(i, 0); while (n % i == 0) { n /= i; res.back().second++; } } if (n != 1)res.emplace_back(n, 1); return res; } int bingo[3][3]; int cnt[2][105]; int h, w; bool flag[110][110]; int main() { ll n, k; cin >> n >> k; ll ans = k; rep(i, n-1) { ans *= (k - 1); } cout << ans << endl: return 0; }
a.cc: In function 'int main()': a.cc:65:28: error: expected ';' before ':' token 65 | cout << ans << endl: | ^ | ;
s314093926
p03963
C++
n, k = map(int, input().split()) if n == 1: ans = k print(ans) else: ans = k*(k-1)*(n-1) print(ans)
a.cc:1:1: error: 'n' does not name a type 1 | n, k = map(int, input().split()) | ^
s395050521
p03963
C++
using namespace std; int main(){ int n,k; cin>>n>>k; long long ans=k; for(int a=1;a<n;a++){ ans*=(k-1); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope 4 | 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 | using namespace std; a.cc:9:3: error: 'cout' was not declared in this scope 9 | cout<<ans<<endl; | ^~~~ a.cc:9:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:14: error: 'endl' was not declared in this scope 9 | cout<<ans<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s081948642
p03963
C++
using namespace std; int main(){ int n,k; cin>>n>>k; long long ans=k; for(int a=1;a<n;a++){ ans*=(k-1); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:4:1: error: 'cin' was not declared in this scope 4 | 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 | using namespace std; a.cc:9:1: error: 'cout' was not declared in this scope 9 | cout<<ans<<endl; | ^~~~ a.cc:9:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:12: error: 'endl' was not declared in this scope 9 | cout<<ans<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s133939139
p03963
C++
int n,k; cin>>n>>k; long long ans=k; for(int a=1;a<n;a++){ ans*=(k-1); } cout<<ans<<endl;
a.cc:2:1: error: 'cin' does not name a type 2 | cin>>n>>k; | ^~~ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for(int a=1;a<n;a++){ | ^~~ a.cc:4:13: error: 'a' does not name a type 4 | for(int a=1;a<n;a++){ | ^ a.cc:4:17: error: 'a' does not name a type 4 | for(int a=1;a<n;a++){ | ^ a.cc:7:1: error: 'cout' does not name a type 7 | cout<<ans<<endl; | ^~~~
s453211703
p03963
C++
#include<iostream> #include<stdio.h> //#include <bits/stdc++.h> #include<vector> #include<float.h> #include<iomanip> #include<algorithm> #include<string> #include<cstring> #include<math.h> #include<cmath> #include<sstream> #include<set> #include<map> #include<queue> #include <cassert> #include <cmath> #include<cstdint> #define INF 1e9 #define rep(i,n)for(int i=0;(i)<(int)(n);i++) #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++) #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i; #define vec(type,n) vector<type>(n) #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n)) #define ALL(a) (a).begin(),(a).end() using namespace std; using ll = long long; using Graph = vector<vector<int>>; using P = pair<int,int>; vector<int>bitSearch(int bit,int n){ vector<int>S; rep(i,n)if(bit&(1<<i))S.push_back(i); return S; } int d[3] = {-1,0,1}; int main(){ int n,k;cin>>n>>k; ll res = k*pow(k-1,n-1) cout<<res; }
a.cc: In function 'int main()': a.cc:44:5: error: expected ',' or ';' before 'cout' 44 | cout<<res; | ^~~~
s909651187
p03963
C++
#include<iostream> #include<vector> #include using namespace std ; int main(){ long long n,k,ans ; cin >> n >> k ; ans = k ; for(int i=1;i<n;i++){ ans *= k-1 ; } cout << ans << endl ; }
a.cc:3:10: error: #include expects "FILENAME" or <FILENAME> 3 | #include | ^
s640479355
p03963
C++
#include <bits.stdc++.h> using namespace std; int main(){ int N, K; cin >> N >> K; int64_t count = 1; count = count*N*pow(K-1, N-1); cout << count << endl; }
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory 1 | #include <bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s952545398
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; int c = K for(int i=0;i<N-1;i++){ c = c*(K-1); } cout << c << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<N-1;i++){ | ^~~ a.cc:8:17: error: 'i' was not declared in this scope 8 | for(int i=0;i<N-1;i++){ | ^
s306743975
p03963
C
#include<stdio.h> int main() { int n,k,fac1=1,fac2=1,fac3=1; scanf("%d%d",&n,&k); if(n==k) printf("%d",n); else { while(k>=1) { fac1=fac1*k; --k; } while(n>=1) { fac2=fac2*n; --n; } while(k-n>=1) { fac3=fac3*(k-n); k-n=k-n-1; } printf("%d",fac1/(fac2*fac3)); } return 0; }
main.c: In function 'main': main.c:23:12: error: lvalue required as left operand of assignment 23 | k-n=k-n-1; | ^
s539663044
p03963
C++
include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { int n k; cin >> n >> k; int ans = k; for (int i = 0; i < (int)n - 1; ++i) ans *= (k- 1); cout << ans << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: expected initializer before 'k' 9 | int n k; | ^ a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin >> n >> k; | ^~~ a.cc:10:10: error: 'n' was not declared in this scope 10 | cin >> n >> k; | ^ a.cc:10:15: error: 'k' was not declared in this scope 10 | cin >> n >> k; | ^ a.cc:13:3: error: 'cout' was not declared in this scope 13 | cout << ans << endl; | ^~~~ a.cc:13:18: error: 'endl' was not declared in this scope 13 | cout << ans << endl; | ^~~~
s154093647
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { long long int a, t,b; cin>>a>>b; t=(b+(b-1)(a-1)); cout<<t; return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: expression cannot be used as a function 7 | t=(b+(b-1)(a-1)); | ~~~~~^~~~~
s064394558
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b; cin>>a>>b; cout<<(b+(b-1)(a-1)); return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: expression cannot be used as a function 7 | cout<<(b+(b-1)(a-1)); | ~~~~~^~~~~
s364151221
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin << a << b; cout << (a/2)*(b-1) + ((a+1)/2)*b << endl; }
a.cc: In function 'int main()': a.cc:5:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 5 | cin << a << b; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:5:7: note: candidate: 'operator<<(int, int)' (built-in) 5 | cin << a << b; | ~~~~^~~~ a.cc:5:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /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:5:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 5 | cin << a << b; | ^~~ 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/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ In file included from /usr/include/c++/14/istream:41, 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: /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ 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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin << a << b; | ^ /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:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin << a << b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char,
s395349028
p03963
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<iostream> #include<algorithm> #include<cmath> #include<string> #include<stack> #include<queue> #include<vector> #include<map> #define fi first #define se second #define pb(i) push_back(i) #define rep(i,a,b) for(int i=a;i<=b;i++) #define per(i,a,b) for(int i=a;i>=b;i--) #define mes(a,b) memset(a,b,sizeof(a)) using namespace std; typedef long long ll; typedef unsigned long long ull; const int N = 1e6+10; const int INF = 0x3f3f3f3f; const int inf = - INF; const int mod = 1e9+7; const double pi = acos(-1.0); ll poww(ll x,ll y){ ll res=1; while(y){ res*=x; y--; } return res; } int main(){ ll n,k; cin>>n>>k; cout<<k*pow(k-1,n-1)<<endl return 0; }
a.cc: In function 'int main()': a.cc:38:31: error: expected ';' before 'return' 38 | cout<<k*pow(k-1,n-1)<<endl | ^ | ; 39 | return 0; | ~~~~~~
s209038454
p03963
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class atcoder_46_B { static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } public String next() { while(st==null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch(IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } } public static void main(String[] args) { FastReader ob = new FastReader(); int n = ob.nextInt(),k=ob.nextInt(); long ways=k; n--; while(n>0) { ways*=k-1; n--; } System.out.println(ways); } }
Main.java:6: error: class atcoder_46_B is public, should be declared in a file named atcoder_46_B.java public class atcoder_46_B { ^ 1 error
s712698862
p03963
C++
#include<bits/stdc++.h> int ans,k,n; int main() { cin>>n>>k; ans=k; for(int i=2;i<=n;i++) { ans*=k-1; } printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>k; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~
s550769055
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,j=1; cin n >> k; for(int i=0;i<n-1;++i){ j *= (k-1); } cout << k*j << endl; } /*int pow(int a,int b){ int b=1; for(int i=0;i<b;i++) b*=a; return 0; }*/
a.cc: In function 'int main()': a.cc:6:6: error: expected ';' before 'n' 6 | cin n >> k; | ^~ | ;
s260987781
p03963
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,j=1; cin n >> k; for(int i=0;i<n-1;++i){ j *= (k-1); } cout << k*j << endl; } /*int pow(int a,int b){ int b=1; for(int i=0;i<b;i++) b*=a; return 0; }*/
a.cc: In function 'int main()': a.cc:6:6: error: expected ';' before 'n' 6 | cin n >> k; | ^~ | ;
s726554961
p03963
C++
n, k = gets.chomp.split(' ').map(&:to_i) puts k * (k - 1) ** (n - 1)
a.cc:1:1: error: 'n' does not name a type 1 | n, k = gets.chomp.split(' ').map(&:to_i) | ^
s393524903
p03963
C
#include <iostream> using namespace std; int main(int argc,char **argv) { int ball,color; cin >> ball >> color; int pattern = color; for(int i=0;i<ball-1;i++) { pattern = pattern * (color-1); } cout << pattern << endl; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s521738049
p03963
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; long long v = k; for(int i=1; i<n; i++){ v *= (k-1); } cout << v << endl; } ¥
a.cc:16:1: error: extended character ¥ is not valid in an identifier 16 | ¥ | ^ a.cc:16:1: error: '\U000000a5' does not name a type 16 | ¥ | ^
s427977777
p03963
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),(v).end() #define rall(v)(v).rbegin(),(v).rend() #define F first #define S second #define pb push_back #define pu push #define COUT(x) cout<<(x)<<endl #define PQ priority_queue<ll> #define PQR priority_queue<ll,vector<ll>,greater<ll>> #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define mp make_pair #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define sz(x) (int)(x).size() typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll MOD = 1000000007LL; const ll INF = 1LL << 60; using vll = vector<ll>; using vb = vector<bool>; using vvb = vector<vb>; using vvll = vector<vll>; using vstr = vector<string>; using pll = pair<ll, ll>; int main(){ ll n,k; cin>>n>>k; ans=k; rep(i,n-1){ ans*=(k-1); } COUT(ans); }
a.cc: In function 'int main()': a.cc:39:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 39 | ans=k; | ^~~ | abs
s914241853
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 (i = 0; i<n-1; i++) { ans *= (k-1); } System.out.println(ans); } }
Main.java:11: error: cannot find symbol for (i = 0; i<n-1; i++) { ^ symbol: variable i location: class Main Main.java:11: error: cannot find symbol for (i = 0; i<n-1; i++) { ^ symbol: variable i location: class Main Main.java:11: error: cannot find symbol for (i = 0; i<n-1; i++) { ^ symbol: variable i location: class Main 3 errors
s227930000
p03963
C++
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; const ll LL_MAX=LLONG_MAX; struct In{ template<typename T> T operator()(){ T x; cin >> x; return x; } }; template <typename T,typename U> void forin(T* x,U n){ for (U i=0;i<n;i++) cin >> x[i]; } template <typename T> int div1(T x) { return x%1000000007; } template <typename T> void out(T x){ cout << x << endl; } main(){ In in; int n=in<int>(),k=in<int>(); out(k*pow((double)(k-1),n)); }
a.cc:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 39 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:41:14: error: expected primary-expression before 'int' 41 | int n=in<int>(),k=in<int>(); | ^~~ a.cc:42:9: error: 'k' was not declared in this scope 42 | out(k*pow((double)(k-1),n)); | ^
s341966514
p03963
C++
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; const ll LL_MAX=LLONG_MAX; struct In{ template<typename T> T operator()(){ T x; cin >> x; return x; } }; template <typename T,typename U> void forin(T* x,U n){ for (U i=0;i<n;i++) cin >> x[i]; } template <typename T> int div1(T x) { return x%1000000007; } template <typename T> void out(T x){ cout << x << endl; } main(){ In in; int n=in(),k=in(); out(k*pow((double)(k-1),n)); }
a.cc:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 39 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:41:13: error: no match for call to '(In) ()' 41 | int n=in(),k=in(); | ~~^~ a.cc:17:7: note: candidate: 'template<class T> T In::operator()()' 17 | T operator()(){ | ^~~~~~~~ a.cc:17:7: note: template argument deduction/substitution failed: a.cc:41:13: note: couldn't deduce template parameter 'T' 41 | int n=in(),k=in(); | ~~^~ a.cc:42:9: error: 'k' was not declared in this scope 42 | out(k*pow((double)(k-1),n)); | ^
s725617765
p03963
C++
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; const ll LL_MAX=LLONG_MAX; struct in{ template<typename T> T operator()(){ T x; cin >> x; return x; } }; template <typename T,typename U> void forin(T* x,U n){ for (U i=0;i<n;i++) cin >> x[i]; } template <typename T> int div1(T x) { return x%1000000007; } template <typename T> void out(T x){ cout << x << endl; } main(){ int n=in(),k=in(); out(k*pow((double)(k-1),n)); }
a.cc:31:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 31 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:32:11: error: cannot convert 'in' to 'int' in initialization 32 | int n=in(),k=in(); | ^~~~ | | | in a.cc:32:18: error: cannot convert 'in' to 'int' in initialization 32 | int n=in(),k=in(); | ^~~~ | | | in
s962184276
p03963
C++
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; const ll LL_MAX=LLONG_MAX; struct in{ template<typename T> T operator(){ T x; cin >> x; return x; } }; template <typename T,typename U> void forin(T* x,U n){ for (U i=0;i<n;i++) cin >> x[i]; } template <typename T> int div1(T x) { return x%1000000007; } template <typename T> void out(T x){ cout << x << endl; } main(){ int n=in(),k=in(); out(k*pow(k-1,n)); }
a.cc:10:11: error: expected primary-expression before 'x' 10 | T x; | ^ a.cc:10:11: error: expected '}' before 'x' a.cc:9:17: note: to match this '{' 9 | T operator(){ | ^ a.cc:9:7: error: declaration of 'operator()' as non-function 9 | T operator(){ | ^~~~~~~~ a.cc:11:9: error: 'cin' does not name a type; did you mean 'in'? 11 | cin >> x; | ^~~ | in a.cc:12:9: error: expected unqualified-id before 'return' 12 | return x; | ^~~~~~ a.cc:13:6: error: expected ';' after struct definition 13 | } | ^ | ; a.cc:14:1: error: expected declaration before '}' token 14 | }; | ^ a.cc:31:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 31 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:32:11: error: cannot convert 'in' to 'int' in initialization 32 | int n=in(),k=in(); | ^~~~ | | | in a.cc:32:18: error: cannot convert 'in' to 'int' in initialization 32 | int n=in(),k=in(); | ^~~~ | | | in
s513916539
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",&a); scanf("%d",&b); c=b; for (i=0;i<a,i++){ c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:19: error: expected ';' before ')' token 7 | for (i=0;i<a,i++){ | ^ | ;
s895957044
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",&a); scanf("%d",&b); c=b; for(i=0;i<a,i++){ c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:18: error: expected ';' before ')' token 7 | for(i=0;i<a,i++){ | ^ | ;
s812948735
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); c=b; for(i=0;i<a,i++){ c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:18: error: expected ';' before ')' token 7 | for(i=0;i<a,i++){ | ^ | ;
s227614919
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); c=b; for(i=0;i<a-1,i++){ c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:20: error: expected ';' before ')' token 7 | for(i=0;i<a-1,i++){ | ^ | ;
s203805770
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); c=b; for (i=0;i<a-1,i++) { c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:21: error: expected ';' before ')' token 7 | for (i=0;i<a-1,i++) | ^ | ;
s443666958
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); c=b; for (i=0;i<a-1,i++); { c*=(b-1); } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:21: error: expected ';' before ')' token 7 | for (i=0;i<a-1,i++); | ^ | ;
s351498898
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); for (i=0;i<a-1,i++); { b*=(b-1); } //c=b*(b-1)^(a-1); printf("%d",b); return 0; }
main.c: In function 'main': main.c:6:21: error: expected ';' before ')' token 6 | for (i=0;i<a-1,i++); | ^ | ;
s345317738
p03963
C
#include <stdio.h> int main(void){ int a,b,c,i; scanf("%d",a); scanf("%d",b); for (i=0;i<a-1,i++) { b*=(b-1); } //c=b*(b-1)^(a-1); printf("%d",b); return 0; }
main.c: In function 'main': main.c:6:21: error: expected ';' before ')' token 6 | for (i=0;i<a-1,i++) | ^ | ;
s232744939
p03963
C++
#include <cstdio> #include <math.h> int main() { double N,K; scanf_s("%lf", &N); scanf_s("%lf", &K); printf("%d", (int)( K * pow(K-1,N-1))); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 6 | scanf_s("%lf", &N); | ^~~~~~~ | scanf
s994947530
p03963
C
include <stdio.h> int main(void){ int a,b,c; scanf("%d",a); scanf("%d",b); c=b*(b-1)^(a-1); printf("%d",c); return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s355564799
p03963
C++
#include<stdio.h> int main(){ int N, K, c; scanf("%d %d", &N, &K); c = K; for(int i = 0; i < n - 1; i++){ c *= (K - 1); } printf("%d", c); return 0; }
a.cc: In function 'int main()': a.cc:6:22: error: 'n' was not declared in this scope 6 | for(int i = 0; i < n - 1; i++){ | ^
s833540358
p03963
C++
#include<cstdio> int main(){ int n; scanf("%d",&d); int k; scanf("%d",%k); int ans=k; for(int i=1;i<n;i++){ ans*=(k-1); } printf("%d",ans); }
a.cc: In function 'int main()': a.cc:5:15: error: 'd' was not declared in this scope 5 | scanf("%d",&d); | ^ a.cc:7:14: error: expected primary-expression before '%' token 7 | scanf("%d",%k); | ^
s826669290
p03963
C++
#include <cstdio> int main() int N, K; scanf("%d %d", &N, &K); printf("%d", K*((K-1)^(N-1))); return 0; }
a.cc:3:3: error: expected initializer before 'int' 3 | int N, K; | ^~~ a.cc:4:8: error: expected constructor, destructor, or type conversion before '(' token 4 | scanf("%d %d", &N, &K); | ^ a.cc:5:9: error: expected constructor, destructor, or type conversion before '(' token 5 | printf("%d", K*((K-1)^(N-1))); | ^ a.cc:6:3: error: expected unqualified-id before 'return' 6 | return 0; | ^~~~~~ a.cc:7:1: error: expected declaration before '}' token 7 | } | ^
s899522176
p03963
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K; cin >> N >> K; long int ans = K; for(int i=1;i<N;i++){ ans *= (K-1); } cout >> ans >>endl; }
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long int') 12 | cout >> ans >>endl; | ~~~~ ^~ ~~~ | | | | | long int | std::ostream {aka std::basic_ostream<char>} a.cc:12:8: note: candidate: 'operator>>(int, long int)' (built-in) 12 | cout >> ans >>endl; | ~~~~~^~~~~~ a.cc:12:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:12:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 12 | cout >> ans >>endl; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ In file included from /usr/include/c++/14/istream:1109, 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: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = long int&]': a.cc:12:11: required from here 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout >> ans >>endl; | ^~~ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::ostream' {aka 'std::basic_o
s197716407
p03963
C++
import java.lang.Math.pow import java.util.* fun main(args: Array<String>) { val sc = Scanner(System.`in`) val n = sc.nextDouble() val k = sc.nextDouble() val ans = pow(k - 1, n - 1) * k println("${ans.toLong()}") }
a.cc:5:29: error: stray '`' in program 5 | val sc = Scanner(System.`in`) | ^ a.cc:5:32: error: stray '`' in program 5 | val sc = Scanner(System.`in`) | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.lang.Math.pow | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'