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);
... | 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.prin... | 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
... |
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 bindin... |
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 bindin... |
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;... | 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 ... |
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... |
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: ... |
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 bindin... |
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... | 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: ... |
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|sor... |
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;
... | 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... | 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;
r... | 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>
^
... |
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: ... |
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> ... | 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:... |
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 (in... | 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>
#... | 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);
| ... |
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... |
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... |
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 solut... | 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)
... | 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 <sstrea... |
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,... | 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, ... | 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, ... | 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;
}
... | 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 ... | 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'... |
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... |
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... |
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>... | 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... | 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 ... | 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: ... |
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: 'o... |
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.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));
}
pub... | 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... |
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(),... | 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... |
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.
******************************************... | 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... |
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.
******************************************... | 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()()'
... |
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){
fo... | 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:... |
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 ... | 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(){
... |
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 | ... |
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:... |
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.po... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.