submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s125032513
p03998
C++
#include<iostream> using namespace std; int main(){ char unko,flag; string sa,sb,sc; int a=0,b=0,c=0; cin>>sa>>sb>>sc; unko=sa[a]; a++; for(int i=0;unko!='';i++){ switch(unko){ case 'a': unko=sa[a]; a++; flag='A'; break; case 'b': unko=sb[b]; b++; flag='B'; break; case 'c': unko=sc[...
a.cc:11:21: error: empty character constant 11 | for(int i=0;unko!='';i++){ | ^~
s358781298
p03998
Java
public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); String cardsOfA = input.readLine(); String cardsOfB = input.readLine(); String cardsOfC = input.readLine(); int lengthOfCardsOfA = cardsO...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws IOException { ^ (use --enable-preview to enable unnamed classes) 1 error
s171036114
p03998
Java
import java.util.Scanner; public class code7途中 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String Sa = scan.next(); String Sb = scan.next(); String Sc = scan.next(); boolean ok = true; char turn = 'a'; char win = 'a'; ...
Main.java:3: error: class code7?? is public, should be declared in a file named code7??.java public class code7?? { ^ 1 error
s105558589
p03998
Java
import java.util.Scanner; public class B_45{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String saa = sc.next(), sbb = sc.next(), scc = sc.next(); int na = saa.length(), nb = sbb.length(), nc = scc.length(); int a = 0, b = 0, c = 0, turn = 0; while(true){ if(turn == 0){ ...
Main.java:3: error: class B_45 is public, should be declared in a file named B_45.java public class B_45{ ^ 1 error
s607935026
p03998
C++
#include <iostream> #include<algorithm> #include<string> using namespace std; int main() { char str_a[110], str_b[110], str_c[110],next; int i = 0, j = 0, k = 0; cin >> str_a >> str_b >> str_c; next = str_a[0]; while(strlen(str_a)-i>0 && strlen(str_b)-j>0 && strlen(str_c)-k>0) { if (next == 'a') next = str_a...
a.cc: In function 'int main()': a.cc:14:15: error: 'strlen' was not declared in this scope 14 | while(strlen(str_a)-i>0 && strlen(str_b)-j>0 && strlen(str_c)-k>0) | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' ...
s925562545
p03998
C
#include <stdio.h> int main(void){ int hito = 0, ai = 0, bi = 0, ci = 0; char a[100]; char b[100]; char c[100]; gets(a); gets(b); gets(c); while(1){ switch(hito){ case 0: if(a[ai] == 'a'){ hito = 0; }else if(a[ai] == 'b'){ hito = 1; }else if(a[ai] == 'c'){ hito = 2; }else{ ...
main.c: In function 'main': main.c:7:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | gets(a); | ^~~~ | fgets main.c:53:1: error: expected declaration or statement at end of input 53 | } | ^
s490291793
p03998
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<climits> #include<iostream> #include<sstream> #include<utility> #include<map> #include<vector> #include<queue> #include<algorithm> #include<set> #include<stack> using namespace std; typedef long long ll; typedef pair<int,int>P; int main() { ...
a.cc: In function 'int main()': a.cc:23:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 23 | gets(a); | ^~~~ | getw
s617141455
p03998
C++
#include <iostream> #include <cstring> using namespace std; int main() { string sa, sb, sc; cin >> sa; cin >> sb; cin >> sc; int index_a = 0; int index_b, index_c = 0; char c = sa[0]; char turn = 'a' while(true) { if(turn=='a') { if(index_a>=sa.size()) ...
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 'while' 14 | while(true) { | ^~~~~
s286887959
p03998
C++
#include<iostream> #include <string> #include <algorithm> using namespace std; int main(){ std :: string A,B,C; int lenA,lenB, lenC; int i, j, k; char turn; cin >> A >> B >>C;z lenB = B.size(); lenC = C.size(); ...
a.cc: In function 'int main()': a.cc:11:27: error: 'z' was not declared in this scope 11 | cin >> A >> B >>C;z | ^
s571444668
p03998
C++
#include<iostream> #include <string> #include <algorithm> using namespace std; int main(){ std :: string A,B,C; int lenA,lenB, lenC; int i, j, k; char turn; cin >> A >> B >>C; lenA = A.size(); lenB = B.size(); le...
a.cc: In function 'int main()': a.cc:40:7: error: expected '}' at end of input 40 | } | ^ a.cc:6:19: note: to match this '{' 6 | int main(){ | ^
s078449404
p03998
C
#include <stdio.h> int main() { int i; char moji[3][101]; int cnt[3]; for(i = 0; i < 3; i++){ scanf("%s, moji[i] ); cnt[i] = 0; } int pos = 0; char c; while (1){ c = moji[pos][cnt[pos]]; if (c == 'a'){ cnt[pos]++; pos = 0; }else if(c == 'b'){ cnt[pos]++; pos = 1; }else if(c == 'c'){ cnt[pos]++; pos = 2; }else if(...
main.c: In function 'main': main.c:10:7: warning: missing terminating " character 10 | scanf("%s, moji[i] ); | ^ main.c:10:7: error: missing terminating " character 10 | scanf("%s, moji[i] ); | ^~~~~~~~~~~~~~~ main.c:11:11: error: expected ')' before ';' token 11 | cnt[i] = 0; | ...
s251911983
p03998
C
#include <stdio.h> int main() { int i; char moji[3][101]; int cnt[3]; for(i = 0; i < 3; i++){ moji[i] = gets(); cnt[i] = 0; } int pos = 0; char c; while (1){ c = moji[pos][cnt[pos]]; if (c == 'a'){ cnt[pos]++; pos = 0; }else if(c == 'b'){ cnt[pos]++; pos = 1; }else if(c == 'c'){ cnt[pos]++; pos = 2; }else if(c ==...
main.c: In function 'main': main.c:10:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 10 | moji[i] = gets(); | ^~~~ | fgets main.c:10:9: error: assignment to expression with array type 10 | moji[i] = gets(); | ...
s491045494
p03998
C
#include <stdio.h> int main() { int i; char moji[3][101]; int cnt[3]; for(i = 0; i < 3; i++){ moji[i] = *gets(); cnt[i] = 0; } int pos = 0; char c; while (1){ c = moji[pos][cnt[pos]]; if (c == 'a'){ cat[pos]++; pos = 0; }else if(c == 'b'){ cnt[pos]++; pos = 1; }else if(c == 'c'){ cat[pos]++; pos = 2; }else if(c =...
main.c: In function 'main': main.c:10:12: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 10 | moji[i] = *gets(); | ^~~~ | fgets main.c:10:11: error: invalid type argument of unary '*' (have 'int') 10 | moji[i] = *gets(); ...
s273295698
p03998
C
#include <stdio.h> int main() { int i; char moji[3][101]; int cnt[3]; for(i = 0; i < 3; i++){ scanf("%s", moji[i]); cat[i] = 0; } int pos = 0; char c; while (1){ c = getchar(moji[pos][cnt[pos]]); if (c == 'a'){ cat[pos]++; pos = 0; }else if(c == 'b'){ cat[pos]++; pos = 1; }else if(c == 'c'){ cat[pos]++; pos = 2; }el...
main.c: In function 'main': main.c:11:1: error: 'cat' undeclared (first use in this function); did you mean 'cnt'? 11 | cat[i] = 0; | ^~~ | cnt main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in main.c:17:5: error: too many arguments to function 'getchar' ...
s664949950
p03998
C
// abc045 - b #include <stdio.h> #include <stdint.h> int main(void) { char s[3][101]; uint32_t i; uint32_t turn=0; uint32_t ptr[3]; uint32_t len[3]; for (i=0;i<3;i++) { scanf("%s", s[i]); ptr[i]=0; len[i]=strlen(s[i]); } while(1){ p=ptr[turn]; ptr[turn]++; turn=s[turn][p]-'a'; ...
main.c: In function 'main': main.c:15:12: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 15 | len[i]=strlen(s[i]); | ^~~~~~ main.c:4:1: note: include '<string.h>' or provide a declaration of 'strlen' 3 | #include <stdint.h> +++ |+#include <string.h> ...
s310764470
p03998
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { private static Scanner sc; public static void main(String[] args) { Main instance = new Main(); sc ...
Main.java:55: error: 'catch' without 'try' } catch (Exception e) { ^ Main.java:19: error: 'try' without 'catch', 'finally' or resource declarations try { ^ Main.java:60: error: illegal start of expression private class Scanner { ^ 3 errors
s528419941
p03998
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<cmath> #include<utility> #include<set> #define ll long long int #define ld long double #define INF 10000 #define EPS 0.0000000001 #define rep(i,n) for(int i=0;i<n;i++) #define CC puts("----...
a.cc: In function 'int main()': a.cc:32:21: error: 'strlen' was not declared in this scope 32 | int l =(int)strlen(temp); | ^~~~~~ a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 10 | #include<set> +++ |+#inclu...
s171591738
p03998
C++
#include <bits/stdc++.h> using namespace std; #define int long long string readA,readB,readC; char index; char ans; //int idxA,idxB,idxC; signed main(){ cin >> readA >> readB >> readC; index = readA[0]; readA.erase(readA.begin()); while(1){ if(index == 'a'){ if(readA.empty())bre...
a.cc:7:6: error: 'char index' redeclared as different kind of entity 7 | char index; | ^~~~~ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121, from a.cc:1: /...
s251224201
p03998
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class PlayGround { public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub //System.out.println("starts..."); //int n; BufferedReader br = new BufferedReader(new InputStr...
Main.java:5: error: class PlayGround is public, should be declared in a file named PlayGround.java public class PlayGround { ^ 1 error
s208335112
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string sa,sb,sc;cin>>sa>>sb>>sc; queue<char> qa,qb,qc; int i,j,k; for(i=0;i<sa.size();i++) qa.push(sa[i]); for(i=0;i<sb.size();i++) qb.push(sb[i]); for(i=0;i<sc.size();i++) qc.push(sc[i]); char ans='a'; while(1){ if(ans=='a'){if(qa.empty()) br...
a.cc:16:26: warning: multi-character character constant [-Wmultichar] 16 | cout << (char)(ans+'A'-'a)' << endl; | ^~~~ a.cc: In function 'int main()': a.cc:16:31: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 16 | cout ...
s799132206
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string sa,sb,sc;cin>>sa>>sb>>sc; queue<char> qa,qb,qc; int i,j,k; for(i=0;i<sa.size();i++) qa.push(sa[i]); for(i=0;i<sb.size();i++) qb.push(sb[i]); for(i=0;i<sc.size();i++) qc.push(sc[i]); char ans='a'; while(1){ if(ans=='a'){if(qa.empty()) br...
a.cc: In function 'int main()': a.cc:12:62: error: expected ';' before '}' token 12 | if(ans=='a'){if(qa.empty()) break;ans=qa.front();qa.pop()} | ^ | ; a.cc:13:62: error: expecte...
s300163043
p03998
Java
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String c = sc.next(); final int al = a.length(); final int bl = b.length(); final int cl = c.length(); int aa = al; int...
Main.java:15: error: cannot find symbol Char judge = a.charAt(al - aa); ^ symbol: class Char location: class Main Main.java:35: error: package Sytem does not exist if(judge == 'a'){Sytem.out.println("A");}else if(judge == 'b'){System.out.println("B");}else{System.out.println("C");} ...
s528514013
p03998
Java
import java.util.*; public class Main{ public static void main(String[] args) { Scanner = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String c = sc.next(); final int al = a.length(); final int bl = b.length(); final int cl = c.length(); int aa = al; int bb ...
Main.java:5: error: cannot find symbol Scanner = new Scanner(System.in); ^ symbol: variable Scanner location: class Main Main.java:6: error: cannot find symbol String a = sc.next(); ^ symbol: variable sc location: class Main Main.java:7: error: cannot find symbol String b = sc...
s747536108
p03998
Java
import java.util.*; public class ABC045B{ public static void main(String[] args) { Scanner = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String c = sc.next(); final int al = a.length(); final int bl = b.length(); final int cl = c.length(); int aa = al; int ...
Main.java:3: error: class ABC045B is public, should be declared in a file named ABC045B.java public class ABC045B{ ^ Main.java:5: error: cannot find symbol Scanner = new Scanner(System.in); ^ symbol: variable Scanner location: class ABC045B Main.java:6: error: cannot find symbol String a = sc.n...
s853201369
p03998
C
#include <stdio.h> int main(){ char a[100]; char b[100]; char c[100]; char turn = 'a'; char result = 0; char ca = 0; char cb = 0; char cc = 0; scanf("%s", a); scanf("%s", b); scanf("%s", c); while(result == 0){ ...
main.c: In function 'main': main.c:25:1: error: stray '\343' in program 25 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>turn = a[ca]; | ^~~~~~~~ main.c:25:3: error: stray '\343' in program 25 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+30...
s411821460
p03998
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 using ll = long long; const ll mod = LLONG_MAX; int main(){ int ia=0,ib=0,ic=0; char a,b,c,x=a; string Sa,Sb,Sc; cin>>Sa>>Sb>>Sc; while(1){ if (x==a){ x = Sa[ia]; ia++;...
a.cc: In function 'int main()': a.cc:48:2: error: expected '}' at end of input 48 | } | ^ a.cc:10:11: note: to match this '{' 10 | int main(){ | ^
s233290596
p03998
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 using ll = long long; const ll mod = LLONG_MAX; int main(){ int ia=0,ib=0,ic=0; char a,b,c,x=a; string Sa,Sb,Sc; cin>>Sa>>Sb>>Sc; while(1){ if (x==a){ x = Sa[ia]; ia++;...
a.cc: In function 'int main()': a.cc:48:2: error: expected '}' at end of input 48 | } | ^ a.cc:10:11: note: to match this '{' 10 | int main(){ | ^
s091662951
p03998
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 using ll = long long; const ll mod = LLONG_MAX; int main(){ int ia=0,ib=0,ic=0; char a,b,c,x=a; string Sa,Sb,Sc; cin>>Sa>>Sb>>Sc; while(1){ if (x==a){ x = Sa[ia]; ia++;...
a.cc: In function 'int main()': a.cc:24:11: error: 'A' was not declared in this scope 24 | cout<<A<<endl; | ^ a.cc:34:11: error: 'B' was not declared in this scope 34 | cout<<B<<endl; | ^ a.cc:44:11: error: 'C' was not declared in this scope 44 | cout<<C<<endl; ...
s107498001
p03998
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 using ll = long long; const ll mod = LLONG_MAX; int main(){ int ia=0,ib=0,ic=0; char a,b,c,x=a; string Sa,Sb,Sc; cin>>sa>>sb>>sc; while{ if (x==a){ x = Sa[ia]; ia++; ...
a.cc: In function 'int main()': a.cc:14:8: error: 'sa' was not declared in this scope; did you mean 'Sa'? 14 | cin>>sa>>sb>>sc; | ^~ | Sa a.cc:14:12: error: 'sb' was not declared in this scope; did you mean 'Sb'? 14 | cin>>sa>>sb>>sc; | ^~ | Sb a.cc:...
s473988686
p03998
Java
import java.util.Scanner; /** * Created by wild on 16/09/26. */ public class B { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String one = scan.next(); String two = scan.next(); String three = scan.next(); boolean ok = true; char...
Main.java:6: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s177326413
p03998
C++
#include<iostream> #include<string> using namespace std; char upper(char s); int main(int argc, char const *argv[]) { string sa,sb,sc; int a=0,b=0,c=0; char turn='A'; std::cin >> sa >> sb >> sc ; while (true) { if (turn=='A') { if(a==sa.size()-1){ std::cout << turn << std::endl; ...
a.cc: In function 'int main(int, const char**)': a.cc:31:21: error: expected ';' before '{' token 31 | }else(turn=='C') { | ^~ | ;
s264947444
p03998
C++
#include<stdio.h> #include<cstring> int main() { int a,b,c,ap=0,bp=0,cp=0,t=1; char A[110],B[110],C[110],tmp; gets(A); gets(B); gets(C); a=strlen(A);b=strlen(B);c=strlen(C); while(a+1!=ap && b+1 != bp && c+1 != cp) { if(t == 0) { t = A[ap]-'a'; ap++; } else if( t == 1){ t = B[bp]-'a'; b...
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(A); | ^~~~ | getw
s139303088
p03998
C++
#include<stdio.h> int main(){ char a[110], b[110], c[110], t='a'; int ap=0, bp=0, cp=0; scanf("%s",a); scanf("%s",b); scanf("%s",c); while(1){ if(t=='a'){ if(a[ap]!='\0'){ t=a[ap]; ap++; }else{ printf("A"); return 0; } } }if(t=='b'){ if(a[bp]!='\0'){ t=b[bp]; bp++; }...
a.cc: In function 'int main()': a.cc:32:42: error: expected '}' at end of input 32 | return 0; | ^ a.cc:30:30: note: to match this '{' 30 | }else{ | ^ a.cc:32:42: error: expect...
s287829227
p03998
C++
#include<stdio.h> int main(){ char a[110], b[110], c[110]; t='a'; int ap=0; bp=0, cp=0; scanf("%s",a); scanf("%s",c); scanf("%s",b); while(1){ if(t=='a'){ if(a[ap]!='\0'){ t=a[ap]; ap++; }else{ printf("A"); return0; if(t=='b'){ if(a[ap]!='\0'){ t=a[bp]; bp++; }else{ printf("...
a.cc: In function 'int main()': a.cc:3:38: error: 't' was not declared in this scope 3 | char a[110], b[110], c[110]; t='a'; | ^ a.cc:4:19: error: 'bp' was not declared in this scope; did you mean 'ap'? 4 | int ap=0; bp=0, cp=0; | ...
s673960705
p03998
C++
#include<stdio.h> int main(){ char a[110], b[110], c[110], t='a'; int ap=0, bp=0, cp=0; scanf("%s",a); scanf("%s",b); scanf("%s",c); while(1){ if(t=='a'){ if(a[ap]!='\0'){ t=a[ap]; ap++; }else{ printf("A"); return 0; } } }if(t=='b'){ if(a[bp]!='\0'){ t=b[bp]; bp++; }...
a.cc: In function 'int main()': a.cc:32:42: error: expected '}' at end of input 32 | return 0; | ^ a.cc:30:30: note: to match this '{' 30 | }else{ | ^ a.cc:32:42: error: expect...
s786787409
p03998
Java
/** * Created by Raph on 21/09/2016. */ import java.util.*; public class ThreeCard { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String cardsInput = sc.next(); char alice[] = cardsInput.toCharArray(); cardsInput = sc.next(); char bob[] = ca...
Main.java:6: error: class ThreeCard is public, should be declared in a file named ThreeCard.java public class ThreeCard { ^ 1 error
s538162175
p03998
C++
#include<iostream> using namespace std; int main(){ char a[100], b[100], c[100]; int d = 1, e = 0, f = 0, g = 0; cin >> a; cin >> b; cin >> c; for (int i = 0; i < 1;){ switch (d){ case:1 if (a[e] == "a")d = 1; else if (a[e] == "b")d = 2; else if (a[e] == "c")d = 3; else cout << "A" << endl; e++...
a.cc: In function 'int main()': a.cc:11:21: error: expected primary-expression before ':' token 11 | case:1 | ^ a.cc:11:23: error: expected ';' before 'if' 11 | case:1 | ^ | ; 12 | ...
s252025624
p03998
C
#include <stdio.h> int main(){ char a[101],b[101],c[101],d; int aa=1,bb=0,cc=0; scanf("%s",&a); scanf("%s",&b); scanf("%s",&c); d=a[0] while(){ if(d=='\0'){ printf("%C",d); break; } if(d=='a'){ aa++; d=a[aa]; }else if(d=='b'){ bb++; d=b[bb]; }else{ cc++; d=c[cc]; } } return 0; }
main.c: In function 'main': main.c:11:7: error: expected ';' before 'while' 11 | d=a[0] | ^ | ; 12 | while(){ | ~~~~~
s860381814
p03998
C++
#include <bits/stdc++.h> int main(void) { auto a = string{}; auto b = string{}; auto c = string{}; char current = 'a'; std::cin >> a >> b >> c; while (a.length && b.length && c.length) { switch (current) { case 'a': current = a[0]; a = a.substr(1); break; case 'b': curre...
a.cc: In function 'int main()': a.cc:5:12: error: 'string' was not declared in this scope 5 | auto a = string{}; | ^~~~~~ a.cc:5:12: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/i...
s445418921
p03998
C++
#include <iostream> #include <string> using namespace std; int main(void) { string cards[3]; int turn = 0; cin>>cards[0]>>cards[1]>>cards[2]; while(true) { if(cards[turn].empty())break; cards[turn].erase(cards[turn].begin(),1); turn = cards[turn][0]-65; } cout<<(char)(turn+65)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, int)' 12 | cards[turn].erase(cards[turn].begin(),1); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/stri...
s705849086
p03998
C++
#include <iostream> #include <iomanip> #include <ios> #include <sstream> #include <cstdio> #include <algorithm> #include <cstdlib> #include <cmath> #include <numeric> #include <regex> #include <utility> #include <cstddef> #include <cstdint> #include <cfloat> #include <limits> #include <array> #include <bitset> #inc...
a.cc: In function 'int main()': a.cc:78:12: error: expected '}' at end of input 78 | return 0; | ^ a.cc:60:11: note: to match this '{' 60 | int main(){ | ^
s050312843
p03998
C++
#include <stdio.h> #include <string.h> #define TRUE 1 #define FALSE 0 using namespace std; int main() { char a[100], b[100], c[100]; int i = 0, j = 0, k = 0; int inda = 0, indb = 0, indc = 0; gets(a); gets(b); gets(c); int lena = strlen(a), lenb = strlen(b), lenc = strlen(c); int cur...
a.cc: In function 'int main()': a.cc:13:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(a); | ^~~~ | getw
s425174753
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string ss[3]; cin >> ss[0] >> ss[1] >> ss[2]; char cur; cur = 'a'; while (ss[cur - 'a'].length()) { char tmp = ss[cur][0]; ss[cur] = ss[cur].substring(1, npos); cur = tmp; } cout << toUpper(cur) << endl; }
a.cc: In function 'int main()': a.cc:10:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'? 10 | ss[cur] = ss[cur].substring(1, npos); | ^~~~~~~~~ | substr a.cc:10:32: error: 'npos' was not dec...
s246149220
p03998
C++
#include <iostream> #include <string> #include <queue> using namespace std; int main(){ string ainp,binp,cinp; cin >> ainp >> binp >> cinp; queue<char> a,b,c; for(int i=0;i<ainp.size();i++) a.push(ainp[i]); for(int i=0;i<binp.size();i++) b.push(binp[i]); for(int i=0;i<cinp.size();i++) c.push(c...
a.cc: In function 'int main()': a.cc:25:12: error: 'before' was not declared in this scope 25 | if(before == 'a') before = a.front();a.pop(); | ^~~~~~ a.cc:26:12: error: 'before' was not declared in this scope 26 | if(before == 'b') before = b.front();b.pop(); | ^...
s176649396
p03998
Java
import java.util.Scanner; public class Practice { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("aさん>"); String a = scan.nextLine(); System.out.println("bさん>"); String b = scan.nextLine(); System.out.println("cさん>"); String c = scan.nextLine...
Main.java:4: error: class Practice is public, should be declared in a file named Practice.java public class Practice { ^ 1 error
s926510525
p03998
C++
#include <iostream> #include <string> #include <vector> #include <math.h> #include <algorithm> using namespace std; int main(){ string temp; string x,y,z; cin >> x >> y >> z; temp=x[0]; x=x.substr(1,x.size()-1) while(1){ if(temp=="a"){ if(x.size()==0){ cout << "A" << endl; return...
a.cc: In function 'int main()': a.cc:13:27: error: expected ';' before 'while' 13 | x=x.substr(1,x.size()-1) | ^ | ; 14 | while(1){ | ~~~~~
s183020263
p03998
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { scanner sc = new Scanner(System.in); string a,b,c; a = sc.next(); b = sc.next(); c = sc.next(); String[] acard = a.split("",0); String[] bcard = b.split("",0); S...
Main.java:6: error: cannot find symbol scanner sc = new Scanner(System.in); ^ symbol: class scanner location: class Main Main.java:7: error: cannot find symbol string a,b,c; ^ symbol: class string location: class Main Main.java:17: error: cannot find symbol int cl = c...
s749934691
p03998
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { scanner sc = new Scanner(System.in); string a,b,c; a = sc.next(); b = sc.next(); c = sc.next(); string[] acard = a.split("",0); string[] bcard = b.split("",0); s...
Main.java:6: error: cannot find symbol scanner sc = new Scanner(System.in); ^ symbol: class scanner location: class Main Main.java:7: error: cannot find symbol string a,b,c; ^ symbol: class string location: class Main Main.java:11: error: cannot find symbol string[] a...
s133927768
p03998
C
include <stdio.h> int main(void) { char a[101]; char b[101]; char c[101]; char s = 'a'; int i = 0; int j = 0; int k = 0; scanf("%s",a); scanf("%s",b); scanf("%s",c); do { if (s == 'a') { switch (a[i]) { case 'a' : s = 'a'; break; case 'b' : s = 'b'; break; case 'c' : s = 'c'; ...
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s678815320
p03998
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String a,b,c; a = sc.next(); b = sc.next(); c = sc.next(); String[] acard = a.split("",0); String[] bcard = b.split("",0); S...
Main.java:15: error: cannot find symbol Int al = acard.length; ^ symbol: class Int location: class Main Main.java:16: error: cannot find symbol Int bl = bcard.length; ^ symbol: class Int location: class Main Main.java:17: error: cannot find symbol Int cl = ccard.lengh...
s947234262
p03998
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String a,b,c; a = sc.next(); b = sc.next(); c = sc.next(); String[] acard = a.split("",0); String[] bcard = b.split("",0); S...
Main.java:77: error: illegal start of type if(breakcount =< 2) ^ Main.java:77: error: ';' expected if(breakcount =< 2) ^ 2 errors
s448238706
p03998
C
#include<stdio.h> int main(void) { char A[101],B[101],C[101]; int poa = 0,pob = 0,poc = 0,win; fgets(A,sizeof(A),stdin); fgets(B,sizeof(B),stdin); fgets(C,sizeof(C),stdin); if (A[0] == 'a') { poa++; win = 'A'; } else if (A[0] == 'b') { pob++; win = 'B'; } else { poc++; win = 'C'...
main.c: In function 'main': main.c:48:11: error: expected expression before '[' token 48 | if ([poc] == 'a') { | ^ main.c:51:18: error: expected expression before '[' token 51 | } else if ([poc] == 'b') { | ^ main.c:54:18: error: expected expression before '[' to...
s717510433
p03998
C++
int main(int argc, const char * argv[]) { string sa,sb,sc; cin >> sa >> sb >> sc; int ai,bi,ci = 0; char selector = sa[ai++]; // while(true){ // char temp = selector; // if(temp=='a') selector = sa[ai++]; // if(temp=='b') selector = sb[bi++]; // if(temp=='c'...
a.cc: In function 'int main(int, const char**)': a.cc:2:5: error: 'string' was not declared in this scope 2 | string sa,sb,sc; | ^~~~~~ a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> sa >> sb >> sc; | ^~~ a.cc:4:12: error: 'sa' was not declared in this scope 4 |...
s658131544
p03998
C
#include <stdio.h> #include <stdlib.h> int main() { int a=-1; int b= -1; int c = -1; int i; int head=1; char sa[101]; char sb[101]; char sc[101]; for(i=0;i<101;i++)sa[i] = '\0'; for(i=0;i<101;i++)sb[i] = '\0'; for(i=0;i<101;i++)sc[i] = '\0'; // 整数の入力 scanf("%s", sa)...
main.c: In function 'main': main.c:62:5: error: expected declaration or statement at end of input 62 | } | ^ main.c:62:5: error: expected declaration or statement at end of input
s565316584
p03998
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<string> str(3); for (int i = 0; i < 3; i++) { cin >> str[i]; } vector<int> cnt(3,0); int pass = 0; while (1) { for (int i = 0; i < 3; i++) { if (cnt[i] == str[i].length()) { cout << char('A' + i) << endl; return 0; } } cnt[pass]]++; pass = str[pass][cnt...
a.cc: In function 'int main()': a.cc:18:10: error: expected ';' before ']' token 18 | cnt[pass]]++; | ^ | ; a.cc:18:9: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; re...
s008559649
p03999
C++
#include<bits/stdc++.h> using namespace std; #define int long long char s[20]; int n,a[20],p[20],ans; int geta(int l,int r){ int k = 0; for(int i = l; i <= r; i++){ k = k * 10 + a[i]; } return k; } int C(int m,int n){ return p[m] / (p[m - n] * p[n]); } int num(int l,int r){ int m = r - l...
a.cc: In function 'int main()': a.cc:29:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | gets(s + 1); | ^~~~ | getw
s148906641
p03999
Java
import java.util.Scanner; public class Main10 { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); Main m = new Main(sc); m.show(m.solve()); sc.close(); } //フィールド Scanner sc; String S; //入力 Main(Scanner sc) { ...
Main.java:16: error: invalid method declaration; return type required Main(Scanner sc) { ^ 1 error
s098275512
p03999
C++
#include <iostream> #include <string> #define rep(i,n) for(int i=0;i<(n);++i) using namespace std; int main(){ string s; int n; long long sum; cin >> s; n = s.length(); for(int bits=0;bits<(1<<(n-1));bits++){ long long add = 0; for(int i=0;i<n-1;i++){ add *= 10; ...
a.cc: In function 'int main()': a.cc:24:5: error: 'add' was not declared in this scope 24 | add *= 10; | ^~~ a.cc:26:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 26 | ans += add; | ^~~ | abs
s002499595
p03999
C++
#include <iostream> #include <string> #define rep(i,n) for(int i=0;i<(n);++i) using namespace std; int main(){ string s; int n; long long sum; cin >> s; n = s.length(); for(int bits=0;bits<(1<<(n-1));bits++){ long long add = 0; for(int i=0;i<n-1;i++){ add *= 10; ...
a.cc: In function 'int main()': a.cc:23:5: error: 'add' was not declared in this scope 23 | add *= 10; | ^~~ a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | ans += add; | ^~~ | abs a.cc: At global scope: a.cc:28:5: error: 'cout' does not name ...
s686045550
p03999
C++
#include<iostream> #include<string> typedef long long ll; using namespace std; int main(){ string s; cin>>s; ll ans=0; int n=size(); for(int bit=0;bit<(1<<n-1);bit++){ string ss=""; for(int i=0;i<n;i++){ ss+=s[i]; if(bit>>i&1){ ans+=stoll(ss); ss=""; } } an...
a.cc: In function 'int main()': a.cc:9:13: error: no matching function for call to 'size()' 9 | int n=size(); | ~~~~^~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41...
s191696544
p03999
C++
#include <bits/stdc++.h> using namespace std; int s[11],ans; int main() { while(i) {cin>>s[i]; ans++; for(int a=1;a<=i;i++) cout<<s[a-1]+s[i-a]; } return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | while(i) | ^
s462796823
p03999
C
#include"bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i < (int)(n); i++) using ll = long long; using namespace std; int main() { ll s,allsum = 0; cin >> s; int len = (s == 1) ? 1 : ceil(log10(s)); for (int bit = 0; bit < (1 << (len - 1)); bit++) { ll tmps...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include"bits/stdc++.h" | ^~~~~~~~~~~~~~~ compilation terminated.
s643423774
p03999
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:26:9: error: 't' was not declared in this scope 26 | t=atoll(S.c_str()); | ^
s235989501
p03999
C++
9999999999
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 9999999999 | ^~~~~~~~~~
s887906182
p03999
C++
/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
s618245827
p03999
C++
s
a.cc:1:1: error: 's' does not name a type 1 | s | ^
s085487645
p03999
C++
#inlcude<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; vector<string> v; long long int sum=0; for(int i=0;i<s.length();i++) { for(int j=1;j+i<=s.length();j++) { v.push_back(s.substr(i,j)); } } for(int i=0;i<v.size();i++) { sum+=stoi(v[i]); } cout<<su...
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in he...
s263115286
p03999
C++
#inlcude<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; vector<int> v; long long int sum=0; for(int i=0;i<s.length();i++) { for(int j=1;j+i<=s.length();j++) { v.push_back(s.substr(i,j)); } } for(int i=0;i<v.size();i++) { sum+=stoi(v[i]); } cout<<sum; ...
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in he...
s704637713
p03999
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; ll calc(string s, ll total, int idx) { if (s.sisze() - 1 <= idx) return total; string first = s.substr(0, idx + 1); ll first_n = stoll(first, nullptr, 0); string remain = s.substr(idx + 1); return calc(remain, first_n + total, 0) +...
a.cc: In function 'll calc(std::string, ll, int)': a.cc:6:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sisze'; did you mean 'size'? 6 | if (s.sisze() - 1 <= idx) return total; | ^~~~~ | size
s875823088
p03999
C++
#include<bits/stdc++.h> #define FOR(i,a,b)for(int i=(a),_b=(b);i<=_b;i++) #define FORN(i,b,a)for(int i=(b);_a=(a);i>=_a;i--) #define REP(i,n)for(int i=0,_n=n;i<n;i++) #define ll long long #define pii pair<int,int> #define re return #define vi vector<int> #define pb push_back #define si set<int> #define in insert #defin...
a.cc: In function 'long long int dfs(long long int, long long int, long long int)': a.cc:47:24: error: 'sum1' was not declared in this scope; did you mean 'sum'? 47 | return dfs(x-1,sum,sum1*10+a[x])+dfs(x-1,sum+sum1,a[x]); | ^~~~ | sum
s358897643
p03999
C++
#include<iostream> #include<stdio.h> #include<vector> #include<algorithm> #include<set> #include<string> #include<map> #include<string.h> #include<complex> #include<math.h> #include<queue> #include <functional> #include<time.h> #include <stack> using namespace std; #define rep(i,a,n) for(int i=(a);i<(n);i++) #define ll...
/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
s043475277
p03999
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < n; ++i) #define INF 100000001 using namespace std; using ll = long long; using P = pair<int,int>; int main(){ string s; cin >> s; int ans = 0, n = s.size(); for(int bit = 0; bit < (1 << n-1); ++bit){ int sm = 0, a = s.at(0) - '0'; rep(i,n-1){ ...
a.cc: In function 'int main()': a.cc:19:30: error: 'j' was not declared in this scope 19 | a = a*10 + s[j+1] - '0'; | ^
s246926214
p03999
C++
#include<stdio.h> #define long long long long n, ans, a[20]; long dfs(long x, long s0, long s1) { if(x == 1ll) { return 2 * s0 + 11 * s[1] + 2 * a[x]; } return dfs(x - 1ll, s0, s1 * 10ll + a[x]) + dfs(x - 1ll, s0 + s1, a[x]); } int main() { scanf("%lld", &n); while(n) { ++ans; ...
a.cc: In function 'long long int dfs(long long int, long long int, long long int)': a.cc:6:30: error: 's' was not declared in this scope 6 | return 2 * s0 + 11 * s[1] + 2 * a[x]; | ^
s390345430
p03999
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:20:17: error: 'i' was not declared in this scope 20 | bitset<9> B(i); | ^
s039543116
p03999
C++
#include<iostream> #include<iomanip> #include<vector> #include<map> #include<set> #include<algorithm> #include<numeric> #include<limits> #include<bitset> #include<functional> #include<type_traits> #include<queue> #include<stack> #include<array> #include<random> #include<utility> #include<cstdlib> #include<ctime> using...
/usr/bin/ld: /tmp/cczFq30x.o: in function `solve()': a.cc:(.text+0xf): undefined reference to `toku(int, int)' collect2: error: ld returned 1 exit status
s071773391
p03999
C++
#include<string> #include<iostream> #include<cmath> using namespace std; long long bit(int l,int r,int po){ if(l>r) return 0; long long cnt=0; for(int i=l;i<=r;i++) cnt+=(1<<i)*1e(po+l-i); return cnt; } int main(){ string a; cin>>a; long long ans=0; for(int i=0;i<a.size();i++){ ans+=((int)a[i]-'0')*((1<<i)*...
a.cc:10:21: error: exponent has no digits 10 | cnt+=(1<<i)*1e(po+l-i); | ^~
s934892804
p03999
C++
#include <bits/stdc++.h> using namespace std; string s; long long ans,len; long long count(long long a,long long i) { LL s=0; LL cnt=i; i=pow(2,i); s+=i; for(int j=1;j<=len-cnt-1;j++) { s=s*10+i; i*=2; } return a*s; } int main() { cin>>s; len=s.length(); for(...
a.cc: In function 'long long int count(long long int, long long int)': a.cc:8:5: error: 'LL' was not declared in this scope 8 | LL s=0; | ^~ a.cc:9:7: error: expected ';' before 'cnt' 9 | LL cnt=i; | ^~~~ | ; a.cc:12:24: error: 'cnt' was not declared in this scope; did ...
s899524125
p03999
C++
#include <bits/stdc++.h> using namespace std; string s; long long ans,len; long long count(LL a,LL i) { LL s=0; LL cnt=i; i=pow(2,i); s+=i; for(int j=1;j<=len-cnt-1;j++) { s=s*10+i; i*=2; } return a*s; } int main() { cin>>s; len=s.length(); for(long long i=0;...
a.cc:6:17: error: 'LL' was not declared in this scope 6 | long long count(LL a,LL i) | ^~ a.cc:6:22: error: 'LL' was not declared in this scope 6 | long long count(LL a,LL i) | ^~ a.cc:6:26: error: expression list treated as compound expression in initializer [-f...
s931413873
p03999
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<map> #include<queue> #include<cmath> #include <numeric> #include<iomanip> #include <cstdint> using namespace std; long long beki(int x, int y) { if (y == 0) { return 1; } else { long long n = 1; for (int i = 0; i < y; i++) { ...
a.cc: In function 'int main()': a.cc:45:54: error: expected primary-expression before 'long' 45 | ans += (long long)(keta[i] * long long(beki(10, i - tmp))); | ^~~~ a.cc:45:53: error: expected ')' before 'long' 45 | ...
s190199142
p03999
C++
#include <bits/stdc++.h> using namespace std; string S; int main() { cin >> S; int sum = 0; int l = S.size(); for (int i = 0; i < (1 << l - 1); i++) { int t = S[0] - '0' for (int j = 0; j < l - 1; j++) { if (i & (1 << i)) { //plus記号ある sum += t; //この時点で切って、tを足す t = S[i+1] - '0'; /...
a.cc: In function 'int main()': a.cc:11:5: error: expected ',' or ';' before 'for' 11 | for (int j = 0; j < l - 1; j++) { | ^~~ a.cc:11:21: error: 'j' was not declared in this scope 11 | for (int j = 0; j < l - 1; j++) { | ^
s563220799
p03999
C++
#include <bits/stdc++.h> using namespace std; string S; int main() { cin >> S; int sum = 0; int l = S.size(); for (int i = 0; i < (1 << l - 1); i++) { int t = s[0] - '0' for (int j = 0; j < l - 1; j++) { if (i & (1 << i)) { //plus記号ある sum += t; //この時点で切って、tを足す t = S[i+1] - '0'; /...
a.cc: In function 'int main()': a.cc:10:13: error: 's' was not declared in this scope 10 | int t = s[0] - '0' | ^ a.cc:11:21: error: 'j' was not declared in this scope 11 | for (int j = 0; j < l - 1; j++) { | ^
s531764670
p03999
C++
#include <bits/stdc++.h> using namespace std; string S; int main() { cin >> S; int sum = 0; int l = S.size(); for (int i = 0; i < (1 << l - 1); i++) { int t = s[0] - '0' for (int j = 0; j < l - 1; j++) { if (i & (1 << i)) { //plus記号ある sum += t; //この時点で切って、tを足す t = S[i+1] - '0'; /...
a.cc: In function 'int main()': a.cc:10:13: error: 's' was not declared in this scope 10 | int t = s[0] - '0' | ^ a.cc:11:21: error: 'j' was not declared in this scope 11 | for (int j = 0; j < l - 1; j++) { | ^
s090637647
p03999
C
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int snum = s.size()-1; int k = (1 << snum); int c = 0; int64_t sum = 0; for(int i=0;i<k;i++){ int64_t p = i; int64_t c = 1; int64_t ct = 0; for(int j=0;j<snum;j++){ if(p&1){ sum += stol(s.substr(ct,...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s919084332
p03999
Java
import java.util.*; public class Main{ static long ans = 0; public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); calc(1,0,arr[0]-'0',arr); System.out.println(ans); } static void calc(int idx,long sum,long add,char arr){ if(idx==ar...
Main.java:7: error: incompatible types: char[] cannot be converted to char calc(1,0,arr[0]-'0',arr); ^ Main.java:11: error: char cannot be dereferenced if(idx==arr.length){ ^ Main.java:15: error: array required, but char found int x = arr[idx]-'0'; ^ Not...
s481122572
p03999
C++
#include <iostream> #include <math.h> #include <vector> using namespace std; int main() { string input_string; cin >> input_string; bitset<10> bit; vector<long> nums; vector<string> formula; for (int i = 0; i < pow(2, input_string.size() - 1); ++i) { bit = i; string stri...
a.cc: In function 'int main()': a.cc:12:5: error: 'bitset' was not declared in this scope 12 | bitset<10> bit; | ^~~~~~ a.cc:4:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>' 3 | #include <vector> +++ |+#include <bitset> 4 | a.cc...
s591045760
p03999
C++
#include<iostream> using namespace std; typedef long long int ll; int main(){ string s; cin >> s; ll ans = 0, l = (ll)pow(2,s.size()); for(ll i=s.size()-1;i>=0;i--){ ans += l * (s[i]-'0'); l = (l*10 + (1<<s.size()))/2; } cout << ans/2 << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: 'pow' was not declared in this scope 7 | ll ans = 0, l = (ll)pow(2,s.size()); | ^~~
s233419325
p03999
C++
#include<iostream> #include<cstdio> using namespace std; long long n,sum,a[13]; long long dfs(long long x,long long sum,long long sum1) { if(x==1) return 2*sum+sum1+a[x]+sum1*10+a[x]; return dfs(x-1,sum,sum1*10+a[x])+dfs(x-1,sum+sum1,a[x]); int main() { cin>>n; while(n!=0) sum++,a[sum]...
a.cc: In function 'long long int dfs(long long int, long long int, long long int)': a.cc:10:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 10 | int main() | ^~ a.cc:10:9: note: remove parentheses to default-initialize a variable 10 | int main() | ...
s846239384
p03999
C++
#include<bits/stdc++.h> using namespace std; long long n,sum,a[13]; long long dfs(long long x,long long sum,long long sum1) { if(x==1) return 2*sum+sum1+a[x]+sum1*10+a[x]; return dfs(x-1,sum,sum1*10+a[x])+dfs(x-1,sum+sum1,a[x]); int main() { cin>>n; while(n!=0) sum++,a[sum]=n%10,n/=10;...
a.cc: In function 'long long int dfs(long long int, long long int, long long int)': a.cc:9:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 9 | int main() | ^~ a.cc:9:9: note: remove parentheses to default-initialize a variable 9 | int main() | ...
s601523436
p03999
C++
import java.io.*; import java.util.*; public class Main{ public static void main(String[] args)throws Exception{ String str; Scanner sc=new Scanner(System.in); str=sc.next(); sc.close(); Queue<Integer> q=new ArrayDeque<>(); int len=str.length(); double gt=0; ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: ...
s735688945
p03999
C++
#include <iostream> #include <vector> using namespace std; int main(){ string s; cin >> s; unsigned long long int ans = 0LL; for(int i = 0; i < s.size(); i++){ unsigned long long int pl = pow(10,i); unsigned long long int pr = pow(10,s.size()-i); for(int j = 0; j < i; j++){ ans += s[j] * pl;...
a.cc: In function 'int main()': a.cc:11:33: error: 'pow' was not declared in this scope 11 | unsigned long long int pl = pow(10,i); | ^~~
s406247902
p03999
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; typedef long long ll; #define rep(i,n) for(ll (i) = 0; (i) < (n); (i)++) int main(void){ string S; cin >> S; ll size = S.size(); ll sum = 0; if (size == 1){ cout >> S >> endl; ...
a.cc: In function 'int main()': a.cc:20:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 20 | cout >> S >> endl; | ~~~~ ^~ ~ | | | | | std::...
s643394857
p03999
C++
s = input() sum = 0 for bit in range(1 << (len(s) - 1)): expr = s[0] for i in range(len(s) - 1): if bit & 1 << i: expr += '+' expr += s[i + 1] sum += eval(expr) print(sum)
a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s201261622
p03999
C++
s = input() sum = 0 for bit in range(1 << (len(s) - 1)): expr = s ins = 0 for i in range(len(s) - 1): ins += i if bit & 1 << i: expr = expr[:ins+1] + '+' + expr[ins+1:] ins += 1 sum += eval(expr) print(sum)
a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s555183612
p03999
C++
#include <iostream> #include <string> #include <vector> #include <math.h> #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <map> #include <set> #include <queue> #include <list> #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,a,b) for(int i=int(a);i<int(b);++i) #define crep...
a.cc:55:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 55 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:56:16: error: 'S' was not declared in this scope 56 | cin >> S; | ^ a.cc:57:11: error: 'strlen' was not declared in this scope 57 | ...
s754003562
p03999
C++
import sys input=sys.stdin.readline # 整数 n を m 進数 k 桁で表現した文字列 # ex. bins(3,2,2) => 11 def bins(n, m, k): # n がマイナスだったり、k桁で収まらない場合やばそう s = "" while n > 0: s = str(n%m) + s n //= m s = "0"*(k-len(s)) + s return s def main(): s = input().strip() n = len(s)-1 # s の各文字("+" を入れるス...
a.cc:4:3: error: invalid preprocessing directive #\U00006574\U00006570 4 | # 整数 n を m 進数 k 桁で表現した文字列 | ^~~~ a.cc:5:3: error: invalid preprocessing directive #ex 5 | # ex. bins(3,2,2) => 11 | ^~ a.cc:7:7: error: invalid preprocessing directive #n 7 | # n がマイナスだったり、k桁で収まらない場合やばそう | ...
s664757304
p03999
Java
// "static void main" must be defined in a public class. import java.util.* class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); //要素数 int n = str.length()-1; //最終的な合計を格納する値 long total = 0; ...
Main.java:2: error: ';' expected import java.util.* ^ 1 error
s403408366
p03999
Java
// "static void main" must be defined in a public class. public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); //要素数 int n = str.length()-1; //最終的な合計を格納する値 long total = 0; //ビ...
Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s794942627
p03999
Java
import java.util.Scanner; public class Main { static long x; public static void main(String args[]) { Scanner sc = new Scanner(System.in); String array = sc.next(); x=0; for(int i=0;i<array.length();i++) { f(i,0,array); } } static void f(int plus,long sum,String str) { if(plus!=0) { for(int i...
Main.java:16: error: variable i might not have been initialized for(int i;i<str.length()-plus+1;i++) { ^ 1 error
s990996664
p03999
C++
#include <bits/stdc++.h> using namespace std; class CManyFormulas { public: void solve(std::istream &cin, std::ostream &cout) { string s; cin >> s; reverse(s.begin(), s.end()); long long ans = 0; for (int i = 0; i < pow(2, s.size() - 1); ++i) { vector<char> vec(...
/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
s464568277
p03999
C++
def c_many_formulas(S): import itertools ans = 0 for operators in itertools.product(('', '+'), repeat=len(S) - 1): operator = list(operators) + [''] # zip()に渡す文字列の長さを合わせる formula = ''.join([value + op for value, op in zip(S, operator)]) ans += eval(formula) return ans S = input...
a.cc:4:41: error: empty character constant 4 | for operators in itertools.product(('', '+'), repeat=len(S) - 1): | ^~ a.cc:5:39: error: empty character constant 5 | operator = list(operators) + [''] # zip()に渡す文字列の長さを合わせる | ...