submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s126600917
p03998
C++
/*** * author :_shamim * created : 06.05.2020 * ***/ #include <iostream> #include <string.h> #include <stdio.h> #include <math.h> #include <list> #include <set> #include <queue> #include <iterator> #include <bitset> #include <bits/stdc++.h> #include <vector> #include <algorithm> #define ll long long #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define loop for(i=0;i<n;i++) #define pb push_back #define tc() int t;cin>>t;while(t--) using namespace std; ll i,j,temp; int main() {_ char sa[101],sb[101],sc[101],current,winner; int cnta=1,cntb=0,cntc=0,lena=0,lenb=0,lenc=0 cin>>sa>>sb>>sc; while(sa[lena]!='\0') lena++; while(sb[lenb]!='\0') lenb++; while(sc[lenc]!='\0') lenc++; current = sa[0]; for(i=0;;i++){ if(current == 'a'){ current = sa[cnta]; cnta++; if(current == '\0'){ winner = 'a'; break; } } else if(current == 'b'){ current = sb[cntb]; cntb++; if(current == '\0'){ winner = 'a'; break; } } else if(current == 'c'){ current = sc[cntc]; cntc++; if(current== '\0'){ winner = 'c'; break; } } } if(winner=='a'){ cout<<"A"<<endl; } else if(winner == 'b'){ cout<<"B"<<endl; } else{ cout<<"C"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:34:9: error: expected ',' or ';' before 'cin' 34 | cin>>sa>>sb>>sc; | ^~~
s414444443
p03998
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int unused __attribute__((unused)); int i, turn, next, cnt[3]; char S[3][100]; unused = scanf("%s", S[0]); unused = scanf("%s", S[1]); unused = scanf("%s", S[2]); cnt[0] = strlen(S[0]); cnt[1] = strlen(S[1]); cnt[2] = strlen(S[2]); turn = 0; while(1){ if(cnt[turn]==0) break; next = S[turn][0] - 97; for(i=0; i<cnt[turn]; i++) S[turn][i] = S[turn][i+1]; cnt[turn]--; turn = next; } if(turn==0) printf("A"); else if(turn==1) printf("B"); else if(turn==2) printf("C"); return 0;
main.c: In function 'main': main.c:26:3: error: expected declaration or statement at end of input 26 | return 0; | ^~~~~~
s366403305
p03998
C++
#include <iostream> using namespace std; int main() { string a,b,c; cin>>a>>b>>c; reverse(a.begin(),a.end()); reverse(b.begin(),b.end()); reverse(c.begin(),c.end()); char cur = 'a'; while (true) { switch (cur){ case 'a': if(a.empty()){puts("A");return 0;} cur=a.back();a.pop_back();break; case 'b': if(b.empty()){puts("B");return 0;} cur=b.back();b.pop_back();break; case 'c': if(c.empty()){puts("C");return 0;} cur=c.back();c.pop_back();break; default:; } } }
a.cc: In function 'int main()': a.cc:7:5: error: 'reverse' was not declared in this scope 7 | reverse(a.begin(),a.end()); | ^~~~~~~
s294681971
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a,b,c; cin >> a >> b >> c; char t = 'a'; while (1) { if (t == 'a'&&a.empty()) { cout << "A" << endl; break; } else if (t == 'b'&&b.empty()) { cout << "B" << endl; break; } else if (c.emty()&&t == 'c') { cout << "C" << endl; break; } if (t == 'a') {//a t=a[0]; a.erase(a.begin()); } else if (t == 'b') {//b t=b[0]; b.erase(b.begin()); } else if (t == 'c'){//c t=c[0]; c.erase(c.begin()); } } }
a.cc: In function 'int main()': a.cc:18:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'emty'; did you mean 'empty'? 18 | } else if (c.emty()&&t == 'c') { | ^~~~ | empty
s566810407
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A, B, C; cin >> A >> B >> C; int top_A = 0; int top_B = 0; int top_C = 0; char turn = 'a'; while(top_A++ != A.size()-1 && top_B++ != B.size()-1 && top_C++ == C.size()-1){ if(turn == 'a'){ if(top_A++ == A.size()-1){ cout << 'A' << endl; return 0; } turn = A[top_A]; top_A++ } if(turn == 'b'){ if(top_B++ == B.size()-1){ cout << 'B' << endl; return 0; } turn = B[top_B]; top_B++ } if(turn == 'c'){ if(top_C++ == C.size()-1){ cout << 'C' << endl; return 0; } turn = C[top_C]; top_C++ } } }
a.cc: In function 'int main()': a.cc:19:14: error: expected ';' before '}' token 19 | top_A++ | ^ | ; 20 | } | ~ a.cc:27:14: error: expected ';' before '}' token 27 | top_B++ | ^ | ; 28 | } | ~ a.cc:35:14: error: expected ';' before '}' token 35 | top_C++ | ^ | ; 36 | } | ~
s341464687
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A, B, C; cin >> A >> B >> C; int top_A = 0; int top_B = 0; int top_C = 0; char turn = 'a' while(top_A++ != A.size()-1 && top_B++ != B.size()-1 && top_C++ == C.size()-1){ if(turn == 'a'){ if(top_A++ == A.size()-1){ cout << 'A' << endl; return 0; } turn = A[top_A]; top_A++ } if(turn == 'b'){ if(top_B++ == B.size()-1){ cout << 'B' << endl; return 0; } turn = B[top_B]; top_B++ } if(turn == 'c'){ if(top_C++ == C.size()-1){ cout << 'C' << endl; return 0; } turn = C[top_C]; top_C++ } } }
a.cc: In function 'int main()': a.cc:12:3: error: expected ',' or ';' before 'while' 12 | while(top_A++ != A.size()-1 && top_B++ != B.size()-1 && top_C++ == C.size()-1){ | ^~~~~
s727735392
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A, B, C; cin >> A >> B >> C; int top_A = 0; int top_B = 0; int top_C = 0; char turn = 'a' while(){ if(turn == 'a'){ if(top_A++ == A.size()-1){ cout << 'A' << endl; return 0; } turn = A[top_A]; top_A++ } if(turn == 'b'){ if(top_B++ == B.size()-1){ cout << 'B' << endl; return 0; } turn = B[top_B]; top_B++ } if(turn == 'c'){ if(top_C++ == C.size()-1){ cout << 'C' << endl; return 0; } turn = C[top_C]; top_C++ } } }
a.cc: In function 'int main()': a.cc:12:3: error: expected ',' or ';' before 'while' 12 | while(){ | ^~~~~
s565454440
p03998
C++
#include<bits/stdc++.h> using namespace std; void game(string S, string A, string B, string C){ char card = S[1]; S.erase(1,1); if(S.empty()) return; if(card == 'a') game(A, A, B, C); if(card == 'b') game(B, A, B, C); if(card == 'c') game(C, A, B, C); } int main(){ string A, B, C; cin >> A >> B >> C; game(A); if(A.empty()) cout << 'A' << endl; if(B.empty()) cout << 'B' << endl; if(C.empty()) cout << 'C' << endl; }
a.cc: In function 'int main()': a.cc:19:7: error: too few arguments to function 'void game(std::string, std::string, std::string, std::string)' 19 | game(A); | ~~~~^~~ a.cc:4:6: note: declared here 4 | void game(string S, string A, string B, string C){ | ^~~~
s172170516
p03998
C++
#include<bits/stdc++.h> using namespace std; void game(string S){ char card = S[1]; S.erase(1,1); if(S.empty()) return; if(card == 'a') game(A); if(card == 'b') game(B); if(card == 'c') game(C); } int main(){ string A, B, C; cin >> A >> B >> C; game(A); if(A.empty()) cout << 'A' << endl; if(B.empty()) cout << 'B' << endl; if(C.empty()) cout << 'C' << endl; }
a.cc: In function 'void game(std::string)': a.cc:10:24: error: 'A' was not declared in this scope 10 | if(card == 'a') game(A); | ^ a.cc:11:24: error: 'B' was not declared in this scope 11 | if(card == 'b') game(B); | ^ a.cc:12:24: error: 'C' was not declared in this scope 12 | if(card == 'c') game(C); | ^
s462028802
p03998
C++
#include<bits/stdc++.h> using namespace std; void game(string S){ char card = S[1]; S.erase(1,1); if(S.empty()) return; if(S[n] == 'a') game(A); if(S[n] == 'b') game(B); if(S[n] == 'c') game(C); } int main(){ string A, B, C; cin >> A >> B >> C; game(A); if(A.empty()) cout << 'A' << endl; if(B.empty()) cout << 'B' << endl; if(C.empty()) cout << 'C' << endl; }
a.cc: In function 'void game(std::string)': a.cc:10:8: error: 'n' was not declared in this scope 10 | if(S[n] == 'a') game(A); | ^ a.cc:10:24: error: 'A' was not declared in this scope 10 | if(S[n] == 'a') game(A); | ^ a.cc:11:8: error: 'n' was not declared in this scope 11 | if(S[n] == 'b') game(B); | ^ a.cc:11:24: error: 'B' was not declared in this scope 11 | if(S[n] == 'b') game(B); | ^ a.cc:12:8: error: 'n' was not declared in this scope 12 | if(S[n] == 'c') game(C); | ^ a.cc:12:24: error: 'C' was not declared in this scope 12 | if(S[n] == 'c') game(C); | ^
s982660080
p03998
C++
#include<bits/stdc++.h> using namespace std; string game(string S){ char card = S[1]; S.erase(1,1); if(S.empty()) return; if(S[n] == 'a') game(A); if(S[n] == 'b') game(B); if(S[n] == 'c') game(C); } int main(){ string A, B, C; cin >> A >> B >> C; game(A); if(A.empty()) cout << 'A' << endl; if(B.empty()) cout << 'B' << endl; if(C.empty()) cout << 'C' << endl; }
a.cc: In function 'std::string game(std::string)': a.cc:8:17: error: return-statement with no value, in function returning 'std::string' {aka 'std::__cxx11::basic_string<char>'} [-fpermissive] 8 | if(S.empty()) return; | ^~~~~~ a.cc:10:8: error: 'n' was not declared in this scope 10 | if(S[n] == 'a') game(A); | ^ a.cc:10:24: error: 'A' was not declared in this scope 10 | if(S[n] == 'a') game(A); | ^ a.cc:11:8: error: 'n' was not declared in this scope 11 | if(S[n] == 'b') game(B); | ^ a.cc:11:24: error: 'B' was not declared in this scope 11 | if(S[n] == 'b') game(B); | ^ a.cc:12:8: error: 'n' was not declared in this scope 12 | if(S[n] == 'c') game(C); | ^ a.cc:12:24: error: 'C' was not declared in this scope 12 | if(S[n] == 'c') game(C); | ^ a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type] 13 | } | ^
s040643022
p03998
C++
#include<bits/stdc++.h> using namespace std; void game(if(card == 'a') game(queue<char> &X, queue<char> &A, queue<char> &B, queue<char> &C){ char card = X[0]//場に出すカード X.pop(); if(X.empty()) return; if(card == 'a') game(queue<char> &A, queue<char> &A, queue<char> &B, queue<char> &C); if(card == 'b') game(queue<char> &B, queue<char> &A, queue<char> &B, queue<char> &C); if(card == 'c') game(queue<char> &C, queue<char> &A, queue<char> &B, queue<char> &C); } int main(){ string a, b, c; cin >> a >> b >> c; queue<char> A, B, C, A2; for(int i = 0; i < a.size(); i++){ A.push(a[i]); } for(int i = 0; i < a.size(); i++){ B.push(b[i]); } for(int i = 0; i < a.size(); i++){ C.push(c[i]); } &A2 = A; game(A2, A, B, C); if(A.empty) cout << 'A' << endl; if(B.empty) cout << 'B' << endl; if(C.empty) cout << 'C' << endl; }
a.cc:4:6: error: variable or field 'game' declared void 4 | void game(if(card == 'a') game(queue<char> &X, queue<char> &A, queue<char> &B, queue<char> &C){ | ^~~~ a.cc:4:11: error: expected primary-expression before 'if' 4 | void game(if(card == 'a') game(queue<char> &X, queue<char> &A, queue<char> &B, queue<char> &C){ | ^~
s538361231
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string sA,sB,sC; cin>>sA>>sB>>sC; sA+='A'; sB+='B'; sC+='C'; int i=0; int j=-1; int k=-1; char ans=sA.at(0); for(l=0; ;l++){ if(ans=='a'){ i++; ans=sA.at(i); }else if(ans=='b'){ j++; ans=sB.at(j); }else{ k++; ans=sC.at(k); }if(ans=='A'|| ans=='B' || ans=='C'){ break; } }cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'l' was not declared in this scope 11 | for(l=0; ;l++){ | ^
s301808063
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string sA,sB,sC; cin>>sA>>sB>>sC; sA+='A'; sB+='B'; sC+='C'; int i=0; int j=-1; int k=-1; char ans=sA.at(0); for(l=0; ;l++){ if(ans=='a'){ i++; ans=sA.at(i) }else if(ans=='b'){ j++; ans=sB.at(j); j }else{ k++; ans=sC.at(k); }if(ans=='A'|| ans=='B' || ans=='C'){ break; } }cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'l' was not declared in this scope 11 | for(l=0; ;l++){ | ^ a.cc:13:20: error: expected ';' before '}' token 13 | i++; ans=sA.at(i) | ^ | ; 14 | }else if(ans=='b'){ | ~ a.cc:16:4: error: expected ';' before '}' token 16 | j | ^ | ; 17 | }else{ | ~
s667323612
p03998
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String sa = sc.next(); String sb = sc.next(); String sc = sc.next(); int la = sa.length(); int lb = sb.length(); int lc = sc.length(); int pa = 0; int pb = 0; int pc = 0; int h = 0; String ans = "A"; for(int i = 0; i < (la + lb + lc); i++) { if(h == 0) { if(pa < la) { if(sa.charAt(pa) == 'a') { h = 0; } else if(sa.charAt(pa) == 'b') { h = 1; } else { h = 2; } pa++; } else { break; } } else if(h == 1) { if(pb < lb) { if(sb.charAt(pb) == 'a') { h = 0; } else if(sb.charAt(pb) == 'b') { h = 1; } else { h = 2; } pb++; } else { ans = "B"; break; } } else { if(pc < lc) { if(sc.charAt(pc) == 'a') { h = 0; } else if(sc.charAt(pc) == 'b') { h = 1; } else { h = 2; } pc++; } else { ans = "C"; break; } } } System.out.println(ans); } }
Main.java:8: error: variable sc is already defined in method main(String[]) String sc = sc.next(); ^ Main.java:8: error: cannot find symbol String sc = sc.next(); ^ symbol: method next() location: variable sc of type String 2 errors
s193999222
p03998
C++
afafdaf
a.cc:1:1: error: 'afafdaf' does not name a type 1 | afafdaf | ^~~~~~~
s713546270
p03998
C++
int main() { string a, b, c; cin>>a>>b>>c; int an=0, bn=0, cn=0; char x = 'a'; while (an<a.length() and bn<b.length() and cn<c.length()){ if (x=='a'){ x = a[an]; an++; if (an==a.length()){ cout << "A\n"; } } if (x=='b'){ x = b[bn]; bn++; if (bn==b.length()){ cout << "B\n"; } } if (x=='c'){ x=c[cn]; cn++; if (cn==c.length()){ cout << "C\n"; } } } }
a.cc: In function 'int main()': a.cc:2:9: error: 'string' was not declared in this scope 2 | string a, b, c; | ^~~~~~ a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin>>a>>b>>c; | ^~~ a.cc:3:14: error: 'a' was not declared in this scope 3 | cin>>a>>b>>c; | ^ a.cc:3:17: error: 'b' was not declared in this scope 3 | cin>>a>>b>>c; | ^ a.cc:3:20: error: 'c' was not declared in this scope 3 | cin>>a>>b>>c; | ^ a.cc:11:33: error: 'cout' was not declared in this scope 11 | cout << "A\n"; | ^~~~ a.cc:18:33: error: 'cout' was not declared in this scope 18 | cout << "B\n"; | ^~~~ a.cc:25:33: error: 'cout' was not declared in this scope 25 | cout << "C\n"; | ^~~~
s457654069
p03998
C++
#include <iostream> #include <cmath> #include <vector> #include <map> #include <iomanip> #include <algorithm> #include <sstream> #include <string> #include <math.h> using namespace std; int main() { ios::sync_with_stdio(false); string A,B,C,a,b,c; cin >> A >> B >> C; char x='a'; a=A; b=B; c=C; reverse(a.begin(),a.end()); reverse(b.begin(),b.end()); reverse(c.begin(),c.end()); while (A.length()>=0 && B.length()>=0 && C.length()>=0) { if (x=='a') { if (a.length()!=0) { x=a[a.length()-1]; a.pop_back(); } else { cout << "A"; break; } } if (x=='b') { if (b.length()!=0) { x=b[b.length()-1]; b.pop_back(); } else { cout << "B"; break; } } if (x=='c') { if (c.length()!=0) { x=c[c.length()-1]; c.pop_back(); } else { cout << "C"; break; } } } } C
a.cc:58:1: error: 'C' does not name a type 58 | C | ^
s237134927
p03998
C++
def get_i() #空白区切の入力を数値(整数)の配列で返す return gets.chomp.split(" ").map(&:to_i) end def get_f() #空白区切の入力を数値(実数)の配列で返す return gets.chomp.split(" ").map(&:to_f) end def get() #空白区切の入力を文字列の配列で返す return gets.chomp.split(" ") end def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す return gets.chomp.split("") end def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する return bool ? y : n end def array(size1,init=nil,size2=-1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す if size2==-1 return Array.new(size1){init} else return Array.new(size2){Array.new(size1){init}} end end def change(x) case x when "a" then return 0 when "b" then return 1 when "c" then return 2 end end Sa=get_nsp Sb=get_nsp Sc=get_nsp Na=Sa.size Nb=Sb.size Nc=Sc.size turn=0 a=0 b=0 c=0 loop do case turn when 0 then break if a==Na turn=change(Sa[a]) a+=1 when 1 then break if b==Nb turn=change(Sb[b]) b+=1 when 2 then break if c==Nc turn=change(Sc[c]) c+=1 end #puts "a:#{a} b:#{b} c:#{c}" end case turn when 0 then puts "A" when 1 then puts "B" when 2 then puts "C" end
a.cc:1:13: error: stray '#' in program 1 | def get_i() #空白区切の入力を数値(整数)の配列で返す | ^ a.cc:4:13: error: stray '#' in program 4 | def get_f() #空白区切の入力を数値(実数)の配列で返す | ^ a.cc:7:11: error: stray '#' in program 7 | def get() #空白区切の入力を文字列の配列で返す | ^ a.cc:10:15: error: stray '#' in program 10 | def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す | ^ a.cc:13:35: error: stray '#' in program 13 | def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する | ^ a.cc:13:36: error: extended character 、 is not valid in an identifier 13 | def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する | ^ a.cc:13:36: error: extended character 、 is not valid in an identifier a.cc:16:36: error: stray '#' in program 16 | def array(size1,init=nil,size2=-1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す | ^ a.cc:16:37: error: extended character 、 is not valid in an identifier 16 | def array(size1,init=nil,size2=-1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す | ^ a.cc:16:37: error: extended character 、 is not valid in an identifier a.cc:60:4: error: invalid preprocessing directive #puts 60 | #puts "a:#{a} b:#{b} c:#{c}" | ^~~~ a.cc:1:1: error: 'def' does not name a type 1 | def get_i() #空白区切の入力を数値(整数)の配列で返す | ^~~ a.cc:19:3: error: expected unqualified-id before 'else' 19 | else | ^~~~ a.cc:21:3: error: 'end' does not name a type 21 | end | ^~~
s073096845
p03998
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define l long #define pb push_back #define mp make_pair #define mt make_tuple int main() { // your code goes here //ifstream cin("input.txt"); //ofstream cout("output.txt"); ios_base::sync_with_stdio(false); cin.tie(NULL); string A,B,C; cin>>A>>B>>C; int l1=A.length(), l2=B.length(), l3=C.length(); int id1=0,id2=0,id3=0; int st=0; while(id<l1 && id2<l2 && id3<l3) { if(st==0) { char c=A[id1] id1++; if(c=='a') st=0; else if(c=='b') st=1; else st=2; } else if(st==1) { char c=B[id2] id2++; if(c=='a') st=0; else if(c=='b') st=1; else st=2; } else { char c1=C[id3] id3++; if(c1=='a') st=0; else if(c1=='b') st=1; else st=2; } } if(id1==l1) cout<<'A'; else if(id2==l2) cout<<'B'; else cout<<'C'; return 0; }
a.cc: In function 'int main()': a.cc:21:15: error: 'id' was not declared in this scope; did you mean 'id3'? 21 | while(id<l1 && id2<l2 && id3<l3) | ^~ | id3 a.cc:25:31: error: expected ',' or ';' before 'id1' 25 | char c=A[id1] id1++; | ^~~ a.cc:32:31: error: expected ',' or ';' before 'id2' 32 | char c=B[id2] id2++; | ^~~ a.cc:39:32: error: expected ',' or ';' before 'id3' 39 | char c1=C[id3] id3++; | ^~~
s996845187
p03998
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define l long #define pb push_back #define mp make_pair #define mt make_tuple int main() { // your code goes here //ifstream cin("input.txt"); //ofstream cout("output.txt"); ios_base::sync_with_stdio(false); cin.tie(NULL); string A,B,C; cin>>A>>B>>C; int l1=A.length(), l2=B.length(), l3=C.length(); int id1=0,id2=0,id3=0; int st=0; while(id<l1 && id2<l2 && id3<l3) { if(st==0) { char c=a[id1] id1++; if(c=='a') st=0; else if(c=='b') st=1; else st=2; } else if(st==1) { char c=b[id2] id2++; if(c=='a') st=0; else if(c=='b') st=1; else st=2; } else { char c1=c[id3] id3++; if(c1=='a') st=0; else if(c1=='b') st=1; else st=2; } } if(id1==l1) cout<<'A'; else if(id2==l2) cout<<'B'; else cout<<'C'; return 0; }
a.cc: In function 'int main()': a.cc:21:15: error: 'id' was not declared in this scope; did you mean 'id3'? 21 | while(id<l1 && id2<l2 && id3<l3) | ^~ | id3 a.cc:25:24: error: 'a' was not declared in this scope 25 | char c=a[id1] id1++; | ^ a.cc:32:24: error: 'b' was not declared in this scope 32 | char c=b[id2] id2++; | ^ a.cc:39:25: error: 'c' was not declared in this scope 39 | char c1=c[id3] id3++; | ^
s599636512
p03998
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() { string s, t, u; cin >> s >> t >> u; string s1 = s.substr(1, n - 1); int l = s.length(); int m = t.length(); int n = u.length(); char target = s[0]; int i = 0; l++; while (1) { if (target == 'a') { l--; target = s1[i]; } else if (target == 'b') { m--; target = t[i]; } else { n--; target = u[i]; } i++; if (l < 0) { puts("A"); break; } else if (m < 0) { puts("B"); break; } else if (n < 0) { puts("C"); break; } } return 0; }
a.cc: In function 'int main()': a.cc:61:33: error: 'n' was not declared in this scope 61 | string s1 = s.substr(1, n - 1); | ^
s130890002
p03998
C++
using System; using System.Collections.Generic; using System.Linq; class Progaram { static void Main(string[] args) { var cards = new List<char>[3]; for (var i = 0; 3 > i; i++) { cards[i] = Console.ReadLine().ToCharArray().ToList(); } var now = 'a'; var s = 0; while (true) { if (cards[s].Count == 0) { Console.WriteLine((s == 0) ? 'A' : (s == 1) ? 'B' : 'C'); break; } now = cards[s][0]; cards[s].RemoveAt(0); s = (now == 'a') ? 0 : (now == 'b') ? 1 : 2; } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:7:22: error: 'string' has not been declared 7 | static void Main(string[] args) | ^~~~~~ a.cc:7:31: error: expected ',' or '...' before 'args' 7 | static void Main(string[] args) | ^~~~ a.cc:28:2: error: expected ';' after class definition 28 | } | ^ | ; a.cc: In static member function 'static void Progaram::Main(int*)': a.cc:9:9: error: 'var' was not declared in this scope 9 | var cards = new List<char>[3]; | ^~~ a.cc:10:18: error: expected ';' before 'i' 10 | for (var i = 0; 3 > i; i++) | ^ a.cc:10:29: error: 'i' was not declared in this scope 10 | for (var i = 0; 3 > i; i++) | ^ a.cc:12:13: error: 'cards' was not declared in this scope 12 | cards[i] = Console.ReadLine().ToCharArray().ToList(); | ^~~~~ a.cc:12:24: error: 'Console' was not declared in this scope 12 | cards[i] = Console.ReadLine().ToCharArray().ToList(); | ^~~~~~~ a.cc:14:13: error: expected ';' before 'now' 14 | var now = 'a'; | ^~~ a.cc:15:13: error: expected ';' before 's' 15 | var s = 0; | ^ a.cc:18:17: error: 'cards' was not declared in this scope 18 | if (cards[s].Count == 0) | ^~~~~ a.cc:18:23: error: 's' was not declared in this scope 18 | if (cards[s].Count == 0) | ^ a.cc:20:17: error: 'Console' was not declared in this scope 20 | Console.WriteLine((s == 0) ? 'A' : (s == 1) ? 'B' : 'C'); | ^~~~~~~ a.cc:23:13: error: 'now' was not declared in this scope 23 | now = cards[s][0]; | ^~~ a.cc:23:19: error: 'cards' was not declared in this scope 23 | now = cards[s][0]; | ^~~~~ a.cc:23:25: error: 's' was not declared in this scope 23 | now = cards[s][0]; | ^
s985468958
p03998
C++
#include<bits/stdc++.h> using namespace std; int main() { string a,b,c; char next = 'a'; cin >> a >> b >> c; while(true) { if(next == 'a') { if(a.empty()) { cout << 'A' << endl; break; } next = a[0]; a.erase(0,1); } else if(next == 'b') { if(b.empty()) { cout << 'B' << endl; break; } next = b[0]; b.erase(0,1); } else if(next == 'c') { if(c.empty()) { cout << 'C' << endl; break; } next = c[0]; c.erase(0,1); } }
a.cc: In function 'int main()': a.cc:33:4: error: expected '}' at end of input 33 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s300601060
p03998
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int main(){ char a[101],b[101],c[101];scanf("%s %s %s",a,b,c); char table = 'a'; int ta=,tb=0,tc=0; for(int i = 0;i < 300;i++){ if(table == 'a'){ //printf("aきたよ\n"); //printf("table:%c\na[ta]:%c\nta:%d\n",table,a[ta],ta); table = a[ta]; ta++; if(ta-1 == strlen(a)){ printf("a\n"); break; } }else if(table == 'b'){ //printf("bきたよ\n"); //printf("table:%c\nb[tb]:%c\n",table,b[tb]); table = b[tb]; tb++; if(tb-1 == strlen(b)){ printf("b\n"); break; } }else if(table == 'c'){ //printf("cきたよ\n"); //printf("table:%c\nc[tc]:%c\n",table,c[tc]); table = c[tc]; tc++; if(tc-1 == strlen(c)){ printf("c\n"); break; } } } //printf("何もない"); return 0; }
main.c: In function 'main': main.c:12:11: error: expected expression before ',' token 12 | int ta=,tb=0,tc=0; | ^
s009926384
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string SA, SB, SC; cin >> SA >> SB >> SC; char turn = 'a'; int posA = 0, posB = 0, posC = 0; for (int i=0; i< 310; i++){ if (turn == 'a') { if (posA >= SA.size()) { cout << "A" << endl; break; } turn = SA.at(posA); posA ++; } else if (turn == 'b') { if (posB >= SB.size()) { cout << "B" << endl; break; } turn = SB.at(posB); posB ++; } else if (turn == 'c') if (posC >= SC.size()) { cout << "C" << endl; break; } turn = SC.at(posC); posC ++; } } }
a.cc:39:1: error: expected declaration before '}' token 39 | } | ^
s443115706
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<string> st(3); vector<int> left(3); cin >> st[0] >> st[1] >> st[2]; left[0] = st[0].size(); left[1] = st[1].size(); left[2] = st[2].size(); int turn = 0; int subturn = 0; while (0 = 0) { if (st[turn][0] == 'A') subturn = 0; else if (st[turn][0] == 'B') subturn = 1; else subturn = 2; st[turn] =st[turn].substr(1,st[turn].size() - 1); left[turn] -= 1; if (left[turn] == 0) break; turn = subturn; } string ans = ""; if (left[0] == 0) ans = "A"; else if (left[1] == 0) ans = "B"; else ans = "C"; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: lvalue required as left operand of assignment 12 | while (0 = 0) { | ^
s015544488
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<string> st(3) vector<int> left(3) cin >> st[0] >> st[1] >> st[2]; left[0] = st[0].size(); left[1] = st[1].size(); left[2] = st[2].size(); int turn = 0; int subturn = 0; while (0 = 0) { if (st[turn][0] == 'A') subturn = 0; else if (st[turn][0] == 'B') subturn = 1; else subturn = 2; st[turn] =st[turn].substr(1,st[turn].size() - 1); left[turn] -= 1; if (left[turn] == 0) break; turn = subturn; } string ans = ""; if (left[0] == 0) ans = "A"; else if (left[1] == 0) ans = "B"; else ans = "C"; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: expected ',' or ';' before 'vector' 5 | vector<int> left(3) | ^~~~~~ a.cc:7:9: warning: pointer to a function used in arithmetic [-Wpointer-arith] 7 | left[0] = st[0].size(); | ^ a.cc:7:11: error: assignment of read-only location '* std::left' 7 | left[0] = st[0].size(); | ~~~~~~~~^~~~~~~~~~~~~~ a.cc:8:9: warning: pointer to a function used in arithmetic [-Wpointer-arith] 8 | left[1] = st[1].size(); | ^ a.cc:8:11: error: assignment of read-only location '*(std::left + 1)' 8 | left[1] = st[1].size(); | ~~~~~~~~^~~~~~~~~~~~~~ a.cc:9:9: warning: pointer to a function used in arithmetic [-Wpointer-arith] 9 | left[2] = st[2].size(); | ^ a.cc:9:11: error: assignment of read-only location '*(std::left + 2)' 9 | left[2] = st[2].size(); | ~~~~~~~~^~~~~~~~~~~~~~ a.cc:12:10: error: lvalue required as left operand of assignment 12 | while (0 = 0) { | ^ a.cc:18:14: warning: pointer to a function used in arithmetic [-Wpointer-arith] 18 | left[turn] -= 1; | ^ a.cc:18:16: warning: pointer to a function used in arithmetic [-Wpointer-arith] 18 | left[turn] -= 1; | ~~~~~~~~~~~^~~~ a.cc:18:16: error: assignment of read-only location '*(std::left + ((sizetype)turn))' a.cc:19:18: warning: pointer to a function used in arithmetic [-Wpointer-arith] 19 | if (left[turn] == 0) break; | ^ a.cc:23:13: warning: pointer to a function used in arithmetic [-Wpointer-arith] 23 | if (left[0] == 0) ans = "A"; | ^ a.cc:24:18: warning: pointer to a function used in arithmetic [-Wpointer-arith] 24 | else if (left[1] == 0) ans = "B"; | ^
s408081688
p03998
C
#include<stdio.h> int main(void)[ char a[100],b[100],c[100],moji; int i=1,j=0,k=0; scanf("%s",a); scanf("%s",b); scanf("%s",c); moji=a[0]; while(1){ while(a[i]=='a'){ if(a[i]=='\0'){ printf("A\n"); break; } moji=a[i]; i++; } while(b[j]=='b'){ if(b[j]=='\0'){ printf("B\n"); break; } moji=b[j]; j++; } while(c[k]=='c'){ if(c[k]=='\0'){ printf("C\n"); break; } moji=c[k]; k++; } } return 0; }
main.c:3:3: error: expected expression before 'char' 3 | char a[100],b[100],c[100],moji; | ^~~~
s774514978
p03998
C
#include<stdio.h> int main(void){ char A[100],B[100],c[100],alf[3]={a,b,c}; int i=0,j=0,k=0,cnt=0; scanf("%s",A); scanf("%s",B); scanf("%s",C); while((A[i]!='\0'||B[j]!='\0')||C[k]!='\0')){ while(A[i]==alf[0]&&A[i]==alf[cnt]){ i++; if(A[i]==alf[1]) cnt++; if(A[i]==alf[2]) cnt+=2; }; while(B[j]==alf[1]&&B[j]==alf[cnt]){ j++; if(B[j]==alf[0]) cnt--; if(B[j]==alf[2]) cnt++; } while(C[k]==alf[2]&&c[k]==alf[cnt]){ k++; if(C[k]==alf[0]) cnt-=2; if(C[k]==alf[1]) cnt--; } } if(alf[cnt]=='a') printf("A"); if(alf[cnt]=='b') printf("B"); if(alf[cnt]=='c') printf("C"); return 0; }
main.c: In function 'main': main.c:3:37: error: 'a' undeclared (first use in this function) 3 | char A[100],B[100],c[100],alf[3]={a,b,c}; | ^ main.c:3:37: note: each undeclared identifier is reported only once for each function it appears in main.c:3:39: error: 'b' undeclared (first use in this function) 3 | char A[100],B[100],c[100],alf[3]={a,b,c}; | ^ main.c:3:41: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 3 | char A[100],B[100],c[100],alf[3]={a,b,c}; | ^ main.c:3:41: note: (near initialization for 'alf[2]') main.c:7:14: error: 'C' undeclared (first use in this function) 7 | scanf("%s",C); | ^ main.c:8:46: error: expected statement before ')' token 8 | while((A[i]!='\0'||B[j]!='\0')||C[k]!='\0')){ | ^
s008758932
p03998
C++
#include <bits/stdc++.h> typedef long long int ll; typedef long double ld; using namespace std; int main(){ string v[3]; for(ll i=0;i<3;++i){ cin>>v[i]; } char ans; ll flag=0; bool bol=true; while(bol){ if(v[flag].size()==0){ if(flag==0){ ans='A' }else if(flag==1){ ans='B'; }else if(flag=2){ ans='C'; } }else if(v[flag][0]=='a'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=0; }else if(v[flag][0]=='b'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=1; }else if(v[flag][0]=='c'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=2; } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:24: error: expected ';' before '}' token 18 | ans='A' | ^ | ; 19 | }else if(flag==1){ | ~
s573415846
p03998
C++
#include <bits/stdc++.h> typedef long long int ll; typedef long double ld; using namespace std; int main(){ string v[3]; for(ll i=0;i<3;++i){ cin>>v[i]; } char ans; ll flag=0; bool bol=true; while(bol){ if(v[flag].size()==0){ if(flag==0){ ans='A' }else if(flag==1){ ans='B'; }else if(flag=2){ ans='C'; } }else if(v[flag][0]=='a'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=0; }else if(v[flag][0]=='b'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=1; }else if(v[flag][0]=='c'){ v[flag]= v[flag].substr(1,v[flag].size()); flag=2; } } return 0; }
a.cc: In function 'int main()': a.cc:18:24: error: expected ';' before '}' token 18 | ans='A' | ^ | ; 19 | }else if(flag==1){ | ~
s965481177
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { map<char,string> mp; cin >> mp['a'] >> mp['b'] >> mp['c']; char turn = 'a'; while(true){ if(mp[turn].size()==0){ switch(turn){ case 'a': string output = "A"; break; case 'b': string output = "B"; break; case 'c': string output = "C"; break; } cout << output << endl; break; } turn = mp[turn].at(0); if(mp[turn].size()>1){ mp[turn] = mp[turn].substr(1); } else{ mp[turn] = ""; } } }
a.cc: In function 'int main()': a.cc:14:14: error: jump to case label 14 | case 'b': | ^~~ a.cc:12:18: note: crosses initialization of 'std::string output' 12 | string output = "A"; | ^~~~~~ a.cc:15:18: error: redeclaration of 'std::string output' 15 | string output = "B"; | ^~~~~~ a.cc:12:18: note: 'std::string output' previously declared here 12 | string output = "A"; | ^~~~~~ a.cc:17:14: error: jump to case label 17 | case 'c': | ^~~ a.cc:12:18: note: crosses initialization of 'std::string output' 12 | string output = "A"; | ^~~~~~ a.cc:18:18: error: redeclaration of 'std::string output' 18 | string output = "C"; | ^~~~~~ a.cc:12:18: note: 'std::string output' previously declared here 12 | string output = "A"; | ^~~~~~ a.cc:21:15: error: 'output' was not declared in this scope 21 | cout << output << endl; | ^~~~~~
s825398766
p03998
C++
#include <bits/stdc++.h> using namespace std; main(){ map<char,string> m; string a,b,c;cin>>a>>b>>c; m['a']=a; m['b']=b; m['c']=c; char t='a'; while(1){ if(m[t].size()==0){cout<<(char)('A'+t-'a');return 0;} char tm=m[t][0]; m[t].pop_front(); t=tm;}}
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:13:6: error: 'std::map<char, std::__cxx11::basic_string<char> >::mapped_type' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front' 13 | m[t].pop_front(); | ^~~~~~~~~
s637493742
p03998
C++
#include <bits/stdc++.h> using namespace std; main(){ map<char,string> m; string a,b,c;cin>>a>>b>>c; m[a]=a; m[b]=b; m[c]=c; char t='a'; while(1){ if(m[t].size()==0){cout<<(char)('A'+t-'a');return 0;} char tm=m[t].back(); m[t].pop_back(); t=tm;}}
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:2: error: no match for 'operator[]' (operand types are 'std::map<char, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 6 | m[a]=a; | ^ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, std::__cxx11::basic_string<char> >::key_type&' {aka 'const char&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<char, std::__cxx11::basic_string<char> >::key_type&&' {aka 'char&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~ a.cc:7:2: error: no match for 'operator[]' (operand types are 'std::map<char, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 7 | m[b]=b; | ^ /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, std::__cxx11::basic_string<char> >::key_type&' {aka 'const char&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<char, std::__cxx11::basic_string<char> >::key_type&&' {aka 'char&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~ a.cc:8:2: error: no match for 'operator[]' (operand types are 'std::map<char, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | m[c]=c; | ^ /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, std::__cxx11::basic_string<char> >::key_type&' {aka 'const char&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = char]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<char, std::__cxx11::basic_string<char> >::key_type&&' {aka 'char&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~
s227582932
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string SA,SB,SC; cin >> SA; cin >> SB; cin >> SC; string S = SA; char c = 'a'; while(true){ if(S.at(0) == 'a'){ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SA; c = 'a'; } else if(S.at(0) == 'b'){ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SB; c = 'b'; } else{ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SC; c = 'c'; } if(S == ""){] if(c == 'a'){ cout << 'A' << endl; } else if(c == 'b'){ cout << 'B' << endl; } else{ cout << 'C' << endl; } break; } } }
a.cc: In function 'int main()': a.cc:54:17: error: expected primary-expression before ']' token 54 | if(S == ""){] | ^ a.cc:58:7: error: expected '}' before 'else' 58 | else if(c == 'b'){ | ^~~~ a.cc:54:16: note: to match this '{' 54 | if(S == ""){] | ^ a.cc: At global scope: a.cc:67:1: error: expected declaration before '}' token 67 | } | ^
s332115052
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string SA,SB,SC; cin >> SA; cin >> SB; cin >> SC; string S = SA; char c = 'a'; while(true){ if(S.at(0) == 'a'){ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SA; c = 'a'; } else if(S.at(0) == 'b'){ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SB; c = 'b'; } else{ S.erase(S.begin()); if(c == 'a'){ SA = S; } else if(c == 'b'){ SB = S; } else{ SC = S; } S = SC; c = 'c'; } if(S == ""){ cout << c << endl; break; } }
a.cc: In function 'int main()': a.cc:58:2: error: expected '}' at end of input 58 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s168324754
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string a,b,c; cin >> a >> b >> c; int ac = a.size(),bc = b.size(),cc = c.size(); char now = 'a'; while(a.size() > 0 && b.size() > 0 && c.size() > 0){ if(now = 'a'){ if(a.at[0] = 'a'){ a.erase(0,0); now = 'a'; } else if(a.at[0] = 'b'){ b.erase(0,0); now = 'b'; } else{ c.erase(0,0); now = 'c'; } } if(now = 'b'){ if(b.at[0] = 'a'){ a.erase(0,0); now = 'a'; } else if(b.at[0] = 'b'){ b.erase(0,0); now = 'b'; } else{ c.erase(0,0); now = 'c'; } } if(now = 'c'){ if(c.at[0] = 'a'){ a.erase(0,0); now = 'a'; } else if(c.at[0] = 'b'){ b.erase(0,0); now = 'b'; } else{ c.erase(0,0); now = 'c'; } } } if(now = 'a') cout << 'A' << endl; else if(now = 'b') cout << 'B' << endl; else cout << 'C' << endl; }
a.cc: In function 'int main()': a.cc:10:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 10 | if(a.at[0] = 'a'){ | ^ a.cc:14:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 14 | else if(a.at[0] = 'b'){ | ^ a.cc:24:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 24 | if(b.at[0] = 'a'){ | ^ a.cc:28:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 28 | else if(b.at[0] = 'b'){ | ^ a.cc:38:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 38 | if(c.at[0] = 'a'){ | ^ a.cc:42:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 42 | else if(c.at[0] = 'b'){ | ^
s152858325
p03998
C++
include<iostream> #include <string> #include <vector> #include <algorithm> #include <math.h> #include <functional> #include <iomanip> #include <bitset> #include <numeric> #include <queue> #include <map> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) const long long mod = 1000000007; typedef long long ll; typedef pair<int, double> P; const vector<int> di = {-1, 0, 1, 0}; const vector<int> dj = { 0, 1, 0, -1 }; int main() { string sa, sb, sc; cin >> sa >> sb >> sc; int sl = 100; char start = 'a'; while (1) { if (start == 'a') { if (sa.size() == 0) { cout << 'A' << endl; break; } start = sa.at(0); sa.erase(0, 1); } else if (start == 'b') { if (sb.size() == 0) { cout << 'B' << endl; break; } start = sb.at(0); sb.erase(0, 1); } else if (start == 'c') { if (sc.size() == 0) { cout << 'C' << endl; break; } start = sc.at(0); sc.erase(0, 1); } } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type 198 | _GLIBCXX14_CONSTEXPR std::size_t |
s095537669
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s[3]; for(int i=0;i<3;++I){ cin >> s[i]; } int turn =0; while(true){ int now = turn; if(s[now].empty())break; turn = s[now][0] -'a';//s[now][0]==s[i].at(0) s[now].erase(0,1); } if(turn == 0)cout << 'A' << endl; else if(turn == 1)cout << 'B' << endl; else cout << 'C' << endl; }
a.cc: In function 'int main()': a.cc:6:21: error: 'I' was not declared in this scope 6 | for(int i=0;i<3;++I){ | ^
s999555460
p03998
C++
#include<iostream> #include<algorithm> #include<cmath> #include<map> #include<stdio.h> #include<vector> using namespace std; #define rep(s,i,n) for(int i=s;i<n;i++) #define c(n) cout<<n<<endl; #define ic(n) int n;cin>>n; #define sc(s) string s;cin>>s; #define mod 1000000007 #define f first #define s second int a[114514],b[114514],c[8]; int ans[114514][8]; signed main(){ sc(a) sc(b) sc(c) char t=a; int aa,bb,cc=0; rep(0,i,810){ if(t=='a'){ if(aa==a.size()){ cout<<'A'<<endl; return 0; } t=a[aa]; aa++; } else if(t=='b'){ if(bb==b.size()){ cout<<'B'<<endl; return 0; } t=b[bb]; bb++; } else if(t=='c'){ if(cc==c.size()){ cout<<'C'<<endl; return 0; } t=c[cc]; cc++; } } }
a.cc: In function 'int main()': a.cc:19:16: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization 19 | char t=a; | ^ | | | std::string {aka std::__cxx11::basic_string<char>}
s989512304
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ vector<string> S(3); cin>>S.at(0)>>S.at(1)>>S.at(2); int turn=0; char winner; while(1){ if(S.at(turn).size()==0){ switch(turn){ case 0: winner='a'; break; case 1: winner='b'; break; case 2: winner='c'; break; } break; } char x=S.at(turn).front(); S.at(turn).pop_front(); switch(x){ case 'a': turn=0; break; case 'b': turn=1; break; case 'c': turn=2; break; } } cout<<winner <<endl; }
a.cc: In function 'int main()': a.cc:26:16: error: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front' 26 | S.at(turn).pop_front(); | ^~~~~~~~~
s009929478
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ vector<string> S(3); cin>>S.at(0)>>S.at(1)>>S.at(2); int turn=0; char winner; while(1){ if(S.at(turn)==0){ switch(turn){ case 0: winner='a'; break; case 1: winner='b'; break; case 2: winner='c'; break; } break; } char x=S.at(turn).front(); S.at(turn).pop_front(); switch(x){ case 'a': turn=0; break; case 'b': turn=1; break; case 'c': turn=2; break; } } cout<<winner <<endl; }
a.cc: In function 'int main()': a.cc:11:18: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | if(S.at(turn)==0){ | ~~~~~~~~~~^~~ | | | | | int | __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>} 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 11 | if(S.at(turn)==0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | if(S.at(turn)==0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if(S.at(turn)==0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:11:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if(S.at(turn)==0){ | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:11:20: note:
s976801132
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { //現在, 文字列のうち, 先頭から何番目に位置するかを示す map<char, int> pages; map<char, string> cards; cin >> cards['a'] >> cards['b'] >> cards['c']; char turn = 'a'; //現在が誰のターンであるかを示す //ターンの人がカードをすべて使い切ったか否かを確認する. while (pages[turn] != cards[turn].size()) { turn = cards[turn][pages[turn]++]; cout << turn << pages[turn] << endl; } cout << (char)toupper(turn) << endl; }
a.cc:22:10: error: extended character   is not valid in an identifier 22 | cout << (char)toupper(turn) << endl; | ^ a.cc: In function 'int main()': a.cc:22:13: error: expected primary-expression before 'char' 22 | cout << (char)toupper(turn) << endl; | ^~~~ a.cc:22:10: error: '\U00003000' was not declared in this scope 22 | cout << (char)toupper(turn) << endl; | ^~
s385467324
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string A, B, C; cin >> A >> B >> C; char turn = 'a'; int ai=0,bi=0,ci=0; while(1){ if(ai=<A.size()){ cout << "A" << endl; return 0; } if(bi=<B.size()){ cout << "B" << endl; return 0; } if(ci=<C.size()){ cout << "C" << endl; return 0; } if(turn == 'a'){ turn = A[ai]; ai++; } if(turn == 'b'){ turn = B[bi]; bi++; } if(turn == 'c'){ turn = C[ci]; ci++; } } }
a.cc: In function 'int main()': a.cc:12:11: error: expected primary-expression before '<' token 12 | if(ai=<A.size()){ | ^ a.cc:16:11: error: expected primary-expression before '<' token 16 | if(bi=<B.size()){ | ^ a.cc:20:11: error: expected primary-expression before '<' token 20 | if(ci=<C.size()){ | ^
s305706814
p03998
Java
import sun.text.normalizer.UCharacter; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(),b=sc.next(),c=sc.next(); int ptA=0,ptB=0,ptC=0; char next = 'a'; while(true){ if(next == 'a'){ if(ptA==a.length())break; next=a.charAt(ptA); ptA++; }else if(next =='b'){ if(ptB==b.length())break; next=b.charAt(ptB); ptB++; }else{ if(ptC==c.length())break; next = c.charAt(ptC); ptC++; } } if(next =='a')next='A'; else if(next=='b')next='B'; else next='C'; System.out.println(next); } }
Main.java:1: error: package sun.text.normalizer does not exist import sun.text.normalizer.UCharacter; ^ 1 error
s156338427
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string A,B,C; cin>>A>>B>>C; A.push_back('w'); B.push_back('w'); C.push_back('w'); char turn ='a'; int a=0,b=0,c=0; while(true){ if(turn=='a'){ if(A.at(a)=='w'){cout<<A<<endl;break;} turn = A.at(a); a++; } if(turn=='b'){ if(B.at(b)=='w'){cout<<B<<endl;break;} turn = B.at(b); b++; } if(turn=='c'){ if(C.at(c)=='w'){cout<<C<<endl;break;} turn = C.at(c); c++; } } cout<< <<endl; }
a.cc: In function 'int main()': a.cc:22:16: error: expected primary-expression before '<<' token 22 | cout<< <<endl; | ^~
s180612213
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string A,B,C; cin>>A>>B>>C; A.push_back('w'); B.push_back('w'); C.push_back('w'); char turn ='a' int a=0,b=0,c=0; while(true){ if(turn=='a'){ if(A.at(a)=='w'){cout<<A<<endl;break;} turn = A.at(a); a++; } if(turn=='b'){ if(B.at(b)=='w'){cout<<B<<endl;break;} turn = B.at(b); b++; } if(turn=='c'){ if(C.at(c)=='w'){cout<<C<<endl;break;} turn = C.at(c); c++; } } cout<< <<endl; }
a.cc: In function 'int main()': a.cc:10:9: error: expected ',' or ';' before 'int' 10 | int a=0,b=0,c=0; | ^~~ a.cc:13:13: error: 'a' was not declared in this scope 13 | if(A.at(a)=='w'){cout<<A<<endl;break;} | ^ a.cc:14:17: error: 'a' was not declared in this scope 14 | turn = A.at(a); a++; } | ^ a.cc:16:13: error: 'b' was not declared in this scope 16 | if(B.at(b)=='w'){cout<<B<<endl;break;} | ^ a.cc:17:17: error: 'b' was not declared in this scope 17 | turn = B.at(b); b++; } | ^ a.cc:19:13: error: 'c' was not declared in this scope 19 | if(C.at(c)=='w'){cout<<C<<endl;break;} | ^ a.cc:20:17: error: 'c' was not declared in this scope 20 | turn = C.at(c); c++; } | ^ a.cc:22:16: error: expected primary-expression before '<<' token 22 | cout<< <<endl; | ^~
s055448268
p03998
C++
#include<bits/stdc++.h> using namespace std; stack<char> sa; stack<char> sb; stack<char> sc; int main(){ string a,b,c; cin>>a>>b>>c; for(int i=0;i<a.size();i++){ sa.push(a[i]); } for(int i=0;i<b.size();i++){ sb.push(b[i]); } for(int i=0;i<c.size();i++){ sc.push(c[i]); } char val='a'; while(true){ if(val=='a'){ k=sa.top(); sa.pop(); } else if(val=='b'){ k=sb.top(); sb.pop(); } else{ k=sc.top(); sc.pop(); } if(sa.size()==0){ cout<<"A"; return 0; } if(sb.size()==0){ cout<<"B"; return 0; } if(sc.size()==0){ cout<<"C"; return 0; } } }
a.cc: In function 'int main()': a.cc:23:9: error: 'k' was not declared in this scope 23 | k=sa.top(); | ^ a.cc:27:9: error: 'k' was not declared in this scope 27 | k=sb.top(); | ^ a.cc:31:7: error: 'k' was not declared in this scope 31 | k=sc.top(); | ^
s603517688
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { in.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); Timer TM; string a[10]; cin>>a[0]>>a[1]>>a[2]; ll now=0; while(a[now].size()>0){ ll Now=now; Now=a[now][0]-'a'; a[now]=a[now].substr(1); now=Now; } cout<<(char)(now+'A')<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'in' was not declared in this scope; did you mean 'yn'? 6 | in.tie(0); | ^~ | yn a.cc:9:5: error: 'Timer' was not declared in this scope 9 | Timer TM; | ^~~~~ a.cc:14:5: error: 'll' was not declared in this scope 14 | ll now=0; | ^~ a.cc:15:13: error: 'now' was not declared in this scope; did you mean 'pow'? 15 | while(a[now].size()>0){ | ^~~ | pow a.cc:16:11: error: expected ';' before 'Now' 16 | ll Now=now; | ^~~~ | ; a.cc:17:9: error: 'Now' was not declared in this scope; did you mean 'pow'? 17 | Now=a[now][0]-'a'; | ^~~ | pow a.cc:21:18: error: 'now' was not declared in this scope; did you mean 'pow'? 21 | cout<<(char)(now+'A')<<endl; | ^~~ | pow
s449023640
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { in.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); Timer TM; string a[10]; cin>>a[0]>>a[1]>>a[2]; ll now=0; while(a[now].size()>0){ ll Now=now; Now=a[now][0]-'a'; a[now]=a[now].substr(1); now=Now; } cout<<(char)(now+'A')<<endl; return 0; } }
a.cc: In function 'int main()': a.cc:6:5: error: 'in' was not declared in this scope; did you mean 'yn'? 6 | in.tie(0); | ^~ | yn a.cc:9:5: error: 'Timer' was not declared in this scope 9 | Timer TM; | ^~~~~ a.cc:14:5: error: 'll' was not declared in this scope 14 | ll now=0; | ^~ a.cc:15:13: error: 'now' was not declared in this scope; did you mean 'pow'? 15 | while(a[now].size()>0){ | ^~~ | pow a.cc:16:11: error: expected ';' before 'Now' 16 | ll Now=now; | ^~~~ | ; a.cc:17:9: error: 'Now' was not declared in this scope; did you mean 'pow'? 17 | Now=a[now][0]-'a'; | ^~~ | pow a.cc:21:18: error: 'now' was not declared in this scope; did you mean 'pow'? 21 | cout<<(char)(now+'A')<<endl; | ^~~ | pow a.cc: At global scope: a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s293382001
p03998
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] a = sc.next().toCharArray(); char[] b = sc.next().toCharArray(); char[] c = sc.next().toCharArray(); int an = a.length; int bn = b.length; int cn = c.length; int acount=0; int bcount=0; int ccount=0; char tmp = 'a'; char ans ; for(int i=0;i<=an+bn+cn;i++) { if(i==0) { tmp = a[acount]; acount++; } else { if(tmp=='a') { if(acount==an) { ans='A'; break; } else { tmp = a[acount]; acount++; } } else if(tmp =='b') { if(bcount==bn) { ans='B'; break; } else { tmp = b[bcount]; bcount++; } } else { if(ccount==cn) { ans='C'; break; } else { tmp = b[ccount]; ccount++; } } } } System.out.println(ans); } }
Main.java:70: error: variable ans might not have been initialized System.out.println(ans); ^ 1 error
s345019709
p03998
C++
#include <iostream> #include <cstdio> #include <String> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(n);i++) int main(void){ string a,b,c;cin>>a>>b>>c; int flag=1; char turn=a[0]; a.erase(0,1); while(flag==1){ if(turn == 'a'){ if (a.size()==0){ cout<<"A"<<endl; flag=0; }else{ turn=a[0]; a.erase(0,1); } }else if(turn =='b'){ if(b.size()==0){ cout<<"B"<<endl; flag=0; }else{ turn=b[0]; b.erase(0,1); } }else if(turn =='c'){ if(c.size()==0){ cout<<"C"<<endl; flag=0; }else{ turn=c[0]; c.erase(0,1); } } } }
a.cc:3:10: fatal error: String: No such file or directory 3 | #include <String> | ^~~~~~~~ compilation terminated.
s878162335
p03998
C++
#include <iostream> #include <queue> #include <string> using namespace std; int main() { int turn = 1; char S1[200],S2[200],S3[200]; queue<int> A,B,C; scanf("%s", S1); for (int i=0;i<strlen(S1);i++) { A.push(S1[i]); } scanf("%s", S2); for (int i=0;i<strlen(S2);i++) { B.push(S2[i]); } scanf("%s", S3); for (int i=0;i<strlen(S3);i++) { C.push(S3[i]); } while (true) { // Alice's turn if (turn == 1) { //printf("Alice\n"); if (A.empty()) { cout << "A\n"; return 0; } if (A.front()=='b') { turn = 2; } else if (A.front()=='c') { turn = 3; } A.pop(); } else if (turn == 2) { //printf("Bob\n"); if (B.empty()) { cout << "B\n"; return 0; } if (B.front()=='a') { turn = 1; } else if (B.front()=='c') { turn = 3; } B.pop(); } else if (turn == 3) { //printf("Charlie\n"); if (C.empty()) { cout << "C\n"; return 0; } if (C.front()=='a') { turn = 1; } else if (C.front()=='b') { turn = 2; } C.pop(); } } }
a.cc: In function 'int main()': a.cc:11:20: error: 'strlen' was not declared in this scope 11 | for (int i=0;i<strlen(S1);i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +++ |+#include <cstring> 3 | #include <string> a.cc:15:20: error: 'strlen' was not declared in this scope 15 | for (int i=0;i<strlen(S2);i++) { | ^~~~~~ a.cc:15:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:19:20: error: 'strlen' was not declared in this scope 19 | for (int i=0;i<strlen(S3);i++) { | ^~~~~~ a.cc:19:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s676425783
p03998
C++
#include <iostream> #include <queue> using namespace std; int main() { int turn = 1; char S1[200],S2[200],S3[200]; queue<int> A,B,C; scanf("%s", S1); for (int i=0;i<strlen(S1);i++) { A.push(S1[i]); } scanf("%s", S2); for (int i=0;i<strlen(S2);i++) { B.push(S2[i]); } scanf("%s", S3); for (int i=0;i<strlen(S3);i++) { C.push(S3[i]); } while (true) { // Alice's turn if (turn == 1) { //printf("Alice\n"); if (A.empty()) { cout << "A\n"; return 0; } if (A.front()=='b') { turn = 2; } else if (A.front()=='c') { turn = 3; } A.pop(); } else if (turn == 2) { //printf("Bob\n"); if (B.empty()) { cout << "B\n"; return 0; } if (B.front()=='a') { turn = 1; } else if (B.front()=='c') { turn = 3; } B.pop(); } else if (turn == 3) { //printf("Charlie\n"); if (C.empty()) { cout << "C\n"; return 0; } if (C.front()=='a') { turn = 1; } else if (C.front()=='b') { turn = 2; } C.pop(); } } }
a.cc: In function 'int main()': a.cc:10:20: error: 'strlen' was not declared in this scope 10 | for (int i=0;i<strlen(S1);i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +++ |+#include <cstring> 3 | using namespace std; a.cc:14:20: error: 'strlen' was not declared in this scope 14 | for (int i=0;i<strlen(S2);i++) { | ^~~~~~ a.cc:14:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:18:20: error: 'strlen' was not declared in this scope 18 | for (int i=0;i<strlen(S3);i++) { | ^~~~~~ a.cc:18:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s245569885
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; queue sa, sb, sc; for(char t : a){ sa.push(t); } for(char t : b){ sb.push(t); } for(char t : c){ sc.push(t); } char turn = sa.front(); sa.pop(); while(!sa.empty() & !sb.empty() & !sc.empty()){ if(turn == 'a'){ turn = sa.front(); sa.pop(); }else if(turn == 'b'){ turn = sb.front(); sb.pop(); }else{ turn = sc.front(); sc.pop(); } } if(sa.empty()){ cout << 'a'; }else if(sb.empty()){ cout << 'b'; }else{ cout << 'c'; } } }
a.cc: In function 'int main()': a.cc:7:9: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:9: error: no matching function for call to 'queue()' In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:1: /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate: 'template<class _Tp, class _Sequence> queue(_Sequence&&)-> std::queue<_Tp, _Sequence>' 174 | queue(_Sequence&& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate: 'template<class _Tp, class _Sequence> queue(const _Sequence&)-> std::queue<_Tp, _Sequence>' 170 | queue(const _Sequence& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:166:9: note: candidate: 'template<class _Tp, class _Sequence, class _Seq, class _Requires> queue()-> std::queue<_Tp, _Sequence>' 166 | queue() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:166:9: note: template argument deduction/substitution failed: a.cc:7:9: note: couldn't deduce template parameter '_Tp' 7 | queue sa, sb, sc; | ^~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'template<class _Tp, class _Sequence> queue(std::queue<_Tp, _Sequence>)-> std::queue<_Tp, _Sequence>' 96 | class queue | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate: 'template<class _Container, class _Allocator, class> std::queue(_Container, _Allocator)-> queue<typename _Container::value_type, _Container>' 344 | queue(_Container, _Allocator) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate: 'template<class _Container, class> std::queue(_Container)-> queue<typename _Container::value_type, _Container>' 340 | queue(_Container) -> queue<typename _Container::value_type, _Container>; | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate expects 1 argument, 0 provided a.cc:7:13: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:13: error: no matching function for call to 'queue()' /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate: 'template<class _Tp, class _Sequence> queue(_Sequence&&)-> std::queue<_Tp, _Sequence>' 174 | queue(_Sequence&& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate: 'template<class _Tp, class _Sequence> queue(const _Sequence&)-> std::queue<_Tp, _Sequence>' 170 | queue(const _Sequence& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:166:9: note: candidate: 'template<class _Tp, class _Sequence, class _Seq, class _Requires> queue()-> std::queue<_Tp, _Sequence>' 166 | queue() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:166:9: note: template argument deduction/substitution failed: a.cc:7:13: note: couldn't deduce template parameter '_Tp' 7 | queue sa, sb, sc; | ^~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'template<class _Tp, class _Sequence> queue(std::queue<_Tp, _Sequence>)-> std::queue<_Tp, _Sequence>' 96 | class queue | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate: 'template<class _Container, class _Allocator, class> std::queue(_Container, _Allocator)-> queue<typename _Container::value_type, _Container>' 344 | queue(_Container, _Allocator) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate: 'template<class _Container, class> std::queue(_Container)-> queue<typename _Container::value_type, _Container>' 340 | queue(_Container) -> queue<typename _Container::value_type, _Container>; | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate expects 1 argument, 0 provided a.cc:7:17: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:17: error: no matching function for call to 'queue()' /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a)
s528892404
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; queue sa, sb, sc; for(char t : a){ sa.push(t); } for(char t : b){ sb.push(t); } for(char t : c){ sc.push(t); } char turn = sa.front(); sa.pop(); while(!sa.empty() & !sb.empty() & !sc.empty()){ if(turn == 'a'){ turn == sa.front(); sa.pop(); }else if(turn == 'b'){ turn == sb.front(); sb.pop(); }else{ turn == sc.front(); sc.pop(); } } if(sa.empty()){ cout << 'a'; }else if(sb.empty()){ cout << 'b'; }else{ cout << 'c'; } } }
a.cc: In function 'int main()': a.cc:7:9: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:9: error: no matching function for call to 'queue()' In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:1: /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate: 'template<class _Tp, class _Sequence> queue(_Sequence&&)-> std::queue<_Tp, _Sequence>' 174 | queue(_Sequence&& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate: 'template<class _Tp, class _Sequence> queue(const _Sequence&)-> std::queue<_Tp, _Sequence>' 170 | queue(const _Sequence& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:166:9: note: candidate: 'template<class _Tp, class _Sequence, class _Seq, class _Requires> queue()-> std::queue<_Tp, _Sequence>' 166 | queue() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:166:9: note: template argument deduction/substitution failed: a.cc:7:9: note: couldn't deduce template parameter '_Tp' 7 | queue sa, sb, sc; | ^~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'template<class _Tp, class _Sequence> queue(std::queue<_Tp, _Sequence>)-> std::queue<_Tp, _Sequence>' 96 | class queue | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate: 'template<class _Container, class _Allocator, class> std::queue(_Container, _Allocator)-> queue<typename _Container::value_type, _Container>' 344 | queue(_Container, _Allocator) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate: 'template<class _Container, class> std::queue(_Container)-> queue<typename _Container::value_type, _Container>' 340 | queue(_Container) -> queue<typename _Container::value_type, _Container>; | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate expects 1 argument, 0 provided a.cc:7:13: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:13: error: no matching function for call to 'queue()' /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate: 'template<class _Tp, class _Sequence> queue(_Sequence&&)-> std::queue<_Tp, _Sequence>' 174 | queue(_Sequence&& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate: 'template<class _Tp, class _Sequence> queue(const _Sequence&)-> std::queue<_Tp, _Sequence>' 170 | queue(const _Sequence& __c) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:166:9: note: candidate: 'template<class _Tp, class _Sequence, class _Seq, class _Requires> queue()-> std::queue<_Tp, _Sequence>' 166 | queue() | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:166:9: note: template argument deduction/substitution failed: a.cc:7:13: note: couldn't deduce template parameter '_Tp' 7 | queue sa, sb, sc; | ^~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'template<class _Tp, class _Sequence> queue(std::queue<_Tp, _Sequence>)-> std::queue<_Tp, _Sequence>' 96 | class queue | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate: 'template<class _Container, class _Allocator, class> std::queue(_Container, _Allocator)-> queue<typename _Container::value_type, _Container>' 344 | queue(_Container, _Allocator) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:344:5: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate: 'template<class _Container, class> std::queue(_Container)-> queue<typename _Container::value_type, _Container>' 340 | queue(_Container) -> queue<typename _Container::value_type, _Container>; | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:340:5: note: candidate expects 1 argument, 0 provided a.cc:7:17: error: class template argument deduction failed: 7 | queue sa, sb, sc; | ^~ a.cc:7:17: error: no matching function for call to 'queue()' /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(std::queue<_Tp, _Seq>&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 195 | queue(queue&& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const std::queue<_Tp, _Seq>&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 191 | queue(const queue& __q, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(_Sequence&&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 187 | queue(_Sequence&& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Sequence&, const _Alloc&)-> std::queue<_Tp, _Sequence>' 183 | queue(const _Sequence& __c, const _Alloc& __a) | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Tp, class _Sequence, class _Alloc, class _Requires> queue(const _Alloc&)-> std::queue<_Tp, _Sequence>' 179 | queue(const _Alloc& __a)
s597532522
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a,b,c,turn = a; cin >>a>>b>>c; while(1){ if(turn=='a'){ if(a.size()==a+1){ cout << 'A' << endl; continue; } turn = 'a'; a++; } if(turn=='b'){ if(b.size()==b+1){ cout << 'B' << endl; continue; } turn = 'b'; b++; } if(turn=='c'){ if(c.size()==c+1){ cout << 'C' << endl; continue; } turn = 'c'; c++; } } }
a.cc: In function 'int main()': a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if(turn=='a'){ | ~~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 9 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(turn=='a'){ | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basi
s734364773
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a,b,c,turn; cin >>a>>b>>c; turn = 'a'; while(1){ if(turn=='a'){ if(a.size()==a+1){ cout << 'A' << endl; continue; } turn = 'a'; a++; } if(turn=='b'){ if(b.size()==b+1){ cout << 'B' << endl; continue; } turn = 'b'; b++; } if(turn=='c'){ if(c.size()==c+1){ cout << 'C' << endl; continue; } turn = 'c'; c++; } } }
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 10 | if(turn=='a'){ | ~~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:10:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:10:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:10:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 10 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 10 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 10 | if(turn=='a'){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | if(turn=='a'){ | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std
s045343538
p03998
C++
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <algorithm> // sort #include <iomanip> #include <map> #include <bits/stl_numeric.h> #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using namespace std; int main(){ string s[3]; cin >> s[0]; cin >> s[1]; cin >> s[2]; vector <int> num(3, 0); //ターン:0(Aさん),1(Bさん),2(Cさん) int turn = 0; bool flg = true; while(flg) { for(int i = 0; i < 3; ++i) { if(turn == i) { turn = s[i] - 'a'; ++num[i]; } } for(int i = 0; i < 3; ++i) { if(num[i] >= s[i].size()) { string res = 'A' + i; flg = false; return 0; } } } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:29: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 38 | turn = s[i] - 'a'; | ~~~~ ^ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:38:31: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 38 | turn = s[i] - 'a'; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:38:31: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 38 | turn = s[i] - 'a'; | ^~~ a.cc:47:34: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 47 | string res = 'A' + i; | ~~~~^~~ a.cc:55:13: error: 'res' was not declared in this scope 55 | cout << res << endl; | ^~~
s698703493
p03998
C++
A = list(input()) B = list(input()) C = list(input()) #終わり条件(手札を持っていない条件を定義) A.append('f') B.append('f') C.append('f') now = A.pop(0) while(len(A) != 0 and len(B) != 0 and len(C) != 0): if(now == 'a'): now = A.pop(0) if(len(A) == 0): winner = 'A' elif(now == 'b'): now = B.pop(0) if(len(B) == 0): winner = 'B' elif(now == 'c'): now = C.pop(0) if(len(C) ==0): winner = 'C' print(winner)
a.cc:4:2: error: invalid preprocessing directive #\U00007d42\U0000308f\U0000308a\U00006761\U00004ef6\U0000ff08\U0000624b\U0000672d\U00003092\U00006301\U00003063\U00003066\U00003044\U0000306a\U00003044\U00006761\U00004ef6\U00003092\U00005b9a\U00007fa9 4 | #終わり条件(手札を持っていない条件を定義) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:1:1: error: 'A' does not name a type 1 | A = list(input()) | ^
s088341278
p03998
C++
abcb aacb bccc
a.cc:1:1: error: 'abcb' does not name a type 1 | abcb | ^~~~
s539077458
p03998
Java
import java.util.Scanner; public class ABC045B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); String C = sc.next(); String[] S = new String[] {A,B,C}; sc.close(); int num = 0; while(S[num].length() != 0) { int cnt = S[num].charAt(0) - 'a'; S[num] = S[num].substring(1); num = cnt; } System.out.println((char)('A' + num)); } }
Main.java:3: error: class ABC045B is public, should be declared in a file named ABC045B.java public class ABC045B { ^ 1 error
s328403898
p03998
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); StringBuilder sa = new StringBuilder(in.next()); StringBuilder sb = new StringBuilder(in.next()); StringBuilder sc = new StringBuilder(in.next()); char nextTurn = 'a'; int N = sa.length() + sb.length() + sc.length(); for (int i = 0; i < N; i++) { if (nextTurn == 'a') { if (sa.length() == 0) { System.out.println("A"); break; } nextTurn = sa.charAt(0); sa.delete(0, 1); } else if (nextTurn == 'b') { if (sb.length() == 0) { System.out.println("B"); break; } nextTurn = sb.charAt(0); sb.delete(0, 1); } else { if (sc.length() == 0) { System.out.println("C"); break; } nextTurn = sc.charAt(0); sc.delete(0, 1); } } in.close(); } }
Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s516455747
p03998
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int gcd(int a,int b) { int r, tmp; /* 自然数 a > b を確認・入替 */ if(a<b){ tmp = a; a = b; b = tmp; } /* ユークリッドの互除法 */ r = a % b; while(r!=0){ a = b; b = r; r = a % b; } return b; } int fac(int n){ int m=1; while(n>=1) m*=n,n--; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { string a,b,c,cnt; bool flaga=false; bool flagb=false; bool flagc=false; char ans; cin>>a>>b>>c; reverse(a.begin(),a.end()); reverse(b.begin(),b.end()); reverse(c.begin(),c.end()); cnt=a[a.size()-1]; while(true){ if(cnt=='a' && flaga){ ans='a'; break; }else if(cnt=='a'){ cnt=a[a.size()-1]; a.pop_back(); } if(cnt=='b' && flagb){ ans='b'; break; }else if(cnt=='b'){ cnt=b[b.size()-1]; b.pop_back(); } if(cnt=='c' && flagc){ ans='c'; break; }else if(cnt=='c'){ cnt=c[c.size()-1]; c.pop_back(); } if(a.size()==0){ flaga=true; } if(b.size()==0){ flagb=true; } if(c.size()==0){ flagc=true; } } cout<<ans<<endl; } ///////////////////////////
a.cc: In function 'int main()': a.cc:81:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 81 | if(cnt=='a' && flaga){ | ~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:81:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:81:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:81:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 81 | if(cnt=='a' && flaga){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 81 | if(cnt=='a' && flaga){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 81 | if(cnt=='a' && flaga){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 81 | if(cnt=='a' && flaga){ | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 81 | if(cnt=='a' && flaga){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 81 | if(cnt=='a' && flaga){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:81:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view
s801565355
p03998
C++
include <bits/stdc++.h> using namespace std; int i,j,y,x=1,m1,m2,m3; string a,b,c; bool t=0; int main() { cin>>a>>b>>c; while(t==0) { if(x==1) { if(m1==a.size()) { cout<<"A"<<endl; t=1; return 0; } if(a[i]=='b') x=2; else if(a[i]=='c') x=3; else x=1 ; m1++; i++; } if(x==2) { if(m2==b.size()) { cout<<"B"<<endl; t=1; return 0; } if(b[j]=='a') x=1; else if(b[j]=='c') x=3; else x=2; m2++; j++; } if(x==3) { if(m3==c.size()) { cout<<"C"<<endl; t=1; return 0; } if(c[y]=='a') x=1; else if(c[y]=='b') x=2; else x=3; m3++; y++; } } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc:4:5: error: 'string' does not name a type 4 | string a,b,c; | ^~~~~~ a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin>>a>>b>>c; | ^~~ a.cc:9:10: error: 'a' was not declared in this scope 9 | cin>>a>>b>>c; | ^ a.cc:9:13: error: 'b' was not declared in this scope 9 | cin>>a>>b>>c; | ^ a.cc:9:16: error: 'c' was not declared in this scope 9 | cin>>a>>b>>c; | ^ a.cc:16:17: error: 'cout' was not declared in this scope 16 | cout<<"A"<<endl; | ^~~~ a.cc:16:28: error: 'endl' was not declared in this scope 16 | cout<<"A"<<endl; | ^~~~ a.cc:34:17: error: 'cout' was not declared in this scope 34 | cout<<"B"<<endl; | ^~~~ a.cc:34:28: error: 'endl' was not declared in this scope 34 | cout<<"B"<<endl; | ^~~~ a.cc:53:17: error: 'cout' was not declared in this scope 53 | cout<<"C"<<endl; | ^~~~ a.cc:53:28: error: 'endl' was not declared in this scope 53 | cout<<"C"<<endl; | ^~~~
s486495397
p03998
C++
#include <iostream> #include <vector> using namespace std; int main(){ string A, B, C; cin >> A >> B >> C; A.push_back('x'), B.push_back('x'), C.push_back('x'); char c = 'a'; char winner; while(c != 'x'){ if(c == 'a'){ c = A[A.size()-1]; A.pop_back; winner = 'A'; }else if(c == 'b'){ c = B[B.size()-1]; B.pop_back; winner = 'B'; }else if(c == 'c'){ c = C[C.size()-1]; C.pop_back; winner = 'C'; } } cout << winner; }
a.cc: In function 'int main()': a.cc:16:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 16 | A.pop_back; | ~~^~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:20:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 20 | B.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:24:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 24 | C.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
s024937306
p03998
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector<char> A(100), B(100), C(100); cin >> A >> B >> C; A.push_back('x'), B.push_back('x'), C.push_back('x'); char c = 'a'; char winner; while(c != 'x'){ if(c == 'a'){ c = A[A.size()-1]; A.pop_back; winner = 'A'; }else if(c == 'b'){ c = B[B.size()-1]; B.pop_back; winner = 'B'; }else if(c == 'c'){ c = C[C.size()-1]; C.pop_back; winner = 'C'; } } cout << winner; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> A >> B >> C; | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include
s046478745
p03998
C++
#include <iostream> #include <vector> using namespace std; int main(){ string A, B, C; cin >> A >> B >> C; A.push_back('x'), B.push_back('x'), C.push_back('x'); char c = 'a'; char winner; while(c != 'x'){ if(c == 'a'){ c = A[A.size()-1]; A.pop_back; winner = 'A'; }else if(c == 'b'){ c = B[B.size()-1]; B.pop_back; winner = 'B'; }else if(c == 'c'){ c = C[C.size()-1]; C.pop_back; winner = 'C'; } } cout << winner; }
a.cc: In function 'int main()': a.cc:16:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 16 | A.pop_back; | ~~^~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:20:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 20 | B.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:24:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 24 | C.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
s521531250
p03998
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector<char> A, B, C; cin >> A >> B >> C; A.push_back('x'), B.push_back('x'), C.push_back('x'); char c = 'a'; char winner; while(c != 'x'){ if(c == 'a'){ c = A[A.size()-1]; A.pop_back; winner = 'A'; }else if(c == 'b'){ c = B[B.size()-1]; B.pop_back; winner = 'B'; }else if(c == 'c'){ c = C[C.size()-1]; C.pop_back; winner = 'C'; } } cout << winner; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> A >> B >> C; | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include
s291472177
p03998
C++
#include <iostream> #include <string> #include <map> #define rep(i, n) for(int i ; i<n; ++i) using namespace std; int main(){ map<char, string> player; for(char ch='A'; ch<='C'; ch++){ string s; cin>>s; player[ch] = s; } while(1){ int i = 1, j = 0, k = 0; char tern = player['A'][0]; if(tern == 'a'){ tern = player['A'][i]; if((player['A'].size - i )==1){ cout<<'A'<<endl; break; } i++; } else if(tern == 'b'){ tern = player['B'][j]; if((player['B'].size - j) == 1){ cout<<'B'<<endl; break; } j++; } else if(tern == 'c'){ tern = player['C'][k]; if((player['C'].size - k) == 1){ cout<<'C'<<endl; break; } k++; } } }
a.cc: In function 'int main()': a.cc:18:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 18 | if((player['A'].size - i )==1){ | () a.cc:26:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 26 | if((player['B'].size - j) == 1){ | () a.cc:34:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 34 | if((player['C'].size - k) == 1){ | ()
s156883493
p03998
C++
#include <iostream> #include <string> #include <map> #define rep(i, n) for(int i ; i<n; ++i) using namespace std; int main(){ map<char, string> player; for(char ch='A'; ch<='C'; ch++){ string s; cin>>s; player[ch] = s; } while(1){ int i = 1, j = 0, k = 0; char tern = player['A'][0]; if(tern == 'a'){ tern = player['A'][i]; if(player['A'].size - i ==1){ cout<<'A'<<endl; break; } i++; } else if(tern == 'b'){ tern = player['B'][j]; if(player['B'].size - j == 1){ cout<<'B'<<endl; break; } j++; } else if(tern == 'c'){ tern = player['C'][k]; if(player['C'].size - k == 1){ cout<<'C'<<endl; break; } k++; } } }
a.cc: In function 'int main()': a.cc:18:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 18 | if(player['A'].size - i ==1){ | () a.cc:26:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 26 | if(player['B'].size - j == 1){ | () a.cc:34:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 34 | if(player['C'].size - k == 1){ | ()
s827986896
p03998
C++
#include <iostream> #include <string> #define rep(i, n) for(int i ; i<n; ++i) using namespace std; int main(){ map<char, string> players; for(char ch='A'; ch<='C'; ch++){ string s; cin>>s; player[ch] = s; } while(1){ int i = 1, j = 0, k = 0; char tern = player['A'][0]; if(tern == 'a'){ tern = player['A'][i]; if(player['A'].size - i ==1){ cout<<'A'<<endl; break; } i++; } else if(tern == 'b'){ tern = player['B'][j]; if(player['B'].size - j == 1){ cout<<'B'<<endl; break; } j++; } else if(tern == 'c'){ tern = player['C'][k]; if(player['C'].size - k == 1){ cout<<'C'<<endl; break; } k++; } } }
a.cc: In function 'int main()': a.cc:6:5: error: 'map' was not declared in this scope 6 | map<char, string> players; | ^~~ a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 1 | #include <iostream> +++ |+#include <map> 2 | #include <string> a.cc:6:9: error: expected primary-expression before 'char' 6 | map<char, string> players; | ^~~~ a.cc:10:9: error: 'player' was not declared in this scope 10 | player[ch] = s; | ^~~~~~ a.cc:14:21: error: 'player' was not declared in this scope 14 | char tern = player['A'][0]; | ^~~~~~
s502451731
p03998
C++
#include <iostream> #include <string> #define rep(i, n) for(int i ; i<n; ++i) use namespace std; int main(){ map<char, string> players; for(char ch='A'; ch<='C'; ch++){ string s; cin>>s; player[ch] = s; } while(1){ int i = 1, j = 0, k = 0; char tern = player['A'][0]; if(tern == 'a'){ tern = player['A'][i]; if(player['A'].size - i ==1){ cout<<'A'<<endl; break; } i++; } else if(tern == 'b'){ tern = player['B'][j]; if(player['B'].size - j == 1){ cout<<'B'<<endl; break; } j++; } else if(tern == 'c'){ tern = player['C'][k]; if(player['C'].size - k == 1){ cout<<'C'<<endl; break; } k++; } } }
a.cc:4:1: error: 'use' does not name a type 4 | use namespace std; | ^~~ a.cc: In function 'int main()': a.cc:6:5: error: 'map' was not declared in this scope 6 | map<char, string> players; | ^~~ a.cc:6:9: error: expected primary-expression before 'char' 6 | map<char, string> players; | ^~~~ a.cc:8:9: error: 'string' was not declared in this scope 8 | string s; | ^~~~~~ a.cc:8:9: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin>>s; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:14: error: 's' was not declared in this scope 9 | cin>>s; | ^ a.cc:10:9: error: 'player' was not declared in this scope 10 | player[ch] = s; | ^~~~~~ a.cc:14:21: error: 'player' was not declared in this scope 14 | char tern = player['A'][0]; | ^~~~~~ a.cc:18:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 18 | cout<<'A'<<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:18:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 18 | cout<<'A'<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:26:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | cout<<'B'<<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:26:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 26 | cout<<'B'<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:34:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 34 | cout<<'C'<<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:34:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 34 | cout<<'C'<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s672377779
p03998
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string Sa, Sb, Sc; cin >> Sa >> Sb >> Sc; vector<string> Ss = {Sa, Sb, Sc}; vector<vector<char>> S = {{}, {}, {}}; for (int i = 0; i < 2; i++){ for (int j = Ss[i].length() - 1; j >= 0; j--){ S[i].push_back(Ss[i][j]); } } vector<char> c = {'a', 'b', 'c'}; int tmp = 0; char x; while (S[tmp].length() > 0){ x = S[tmp][S[tmp].length() - 1]; S[tmp].pop_back(); if (x == 'a'){ tmp = 0; } else if (x == 'b') { tmp = 1; } else { tmp = 2; } } cout << c[tmp] << endl; }
a.cc: In function 'int main()': a.cc:20:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'class std::vector<char>'} has no member named 'length' 20 | while (S[tmp].length() > 0){ | ^~~~~~ a.cc:21:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'class std::vector<char>'} has no member named 'length' 21 | x = S[tmp][S[tmp].length() - 1]; | ^~~~~~
s066548440
p03998
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string Sa, Sb, Sc; cin >> Sa >> Sb >> Sc; vector<string> Ss = {Sa, Sb, Sc}; vector<vector<char>> S = {{}, {}, {}}; for (int i = 0; i < 2; i++){ for (int j = Ss[i].length() - 1; j >= 0; j--){ S[i].push_back(Ss[i][j]); } } vector<char> c = {'a', 'b', 'c'}; int tmp = 0; char x; while (S[tmp].length() > 0){ x = S[tmp].pop_back(); if (x == 'a'){ tmp = 0; } else if (x == 'b') { tmp = 1; } else { tmp = 2; } } cout << c[tmp] << endl; }
a.cc: In function 'int main()': a.cc:20:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'class std::vector<char>'} has no member named 'length' 20 | while (S[tmp].length() > 0){ | ^~~~~~ a.cc:21:28: error: void value not ignored as it ought to be 21 | x = S[tmp].pop_back(); | ~~~~~~~~~~~~~~~^~
s514596845
p03998
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string Sa, Sb, Sc; cin >> Sa >> Sb >> Sc; vector<string> Ss = {Sa, Sb, Sc}; vector<vector<char>> S = {{}, {}, {}}; for (int i = 0; i < 2; i++){ for (int j = Ss[i].length() - 1; j >= 0; j--){ S[i].push_back(Ss[i][j]); } } vector<char> c = {'a', 'b', 'c'}; int tmp = 0; char x; while (S[tmp].length() > 0){ x = S[tmp].pop_back() if (x == 'a'){ tmp = 0; } else if (x == 'b') { tmp = 1; } else { tmp = 2; } } cout << c[tmp] << endl; }
a.cc: In function 'int main()': a.cc:20:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'class std::vector<char>'} has no member named 'length' 20 | while (S[tmp].length() > 0){ | ^~~~~~ a.cc:21:28: error: void value not ignored as it ought to be 21 | x = S[tmp].pop_back() | ~~~~~~~~~~~~~~~^~ a.cc:25:9: error: 'else' without a previous 'if' 25 | else if (x == 'b') { | ^~~~
s284539308
p03998
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string Sa, Sb, Sc; cin >> Sa >> Sb >> Sc; vector<string> Ss = {Sa, Sb, Sc}; vector<vector<char>> S (3); for (int i = 0; i < 2; i++){ for (int j = Ss[i].length() - 1; j >= 0; j--){ S[i].push_back(Ss[i][j]); } } vector<char> c = {'a', 'b', 'c'}; int tmp = 0; char x; while (S[tmp].length() > 0){ x = S[tmp].pop_back() if (x == 'a'){ tmp = 0; } else if (x == 'b') { tmp = 1; } else { tmp = 2; } } cout << tmp << endl; }
a.cc: In function 'int main()': a.cc:20:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'class std::vector<char>'} has no member named 'length' 20 | while (S[tmp].length() > 0){ | ^~~~~~ a.cc:21:28: error: void value not ignored as it ought to be 21 | x = S[tmp].pop_back() | ~~~~~~~~~~~~~~~^~ a.cc:25:9: error: 'else' without a previous 'if' 25 | else if (x == 'b') { | ^~~~
s135073499
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string A,B,C; cin >> A >> B >> C; char T = 'a'; while (A.size()>0 && B.size()>0 && C.size()>0){ if (T = 'a'){ T = A[0]; A = substr(1,A.size()-1); } if (T = 'b'){ T = B[0]; B = substr(1,B.size()-1); } if (T = 'c'){ T = C[0]; C = substr(1,C.size()-1); } } if (A.size()==0){ cout << 'A'; } if (B.size()==0){ cout << 'B'; } if (C.size()==0){ cout << 'C'; } }
a.cc: In function 'int main()': a.cc:10:11: error: 'substr' was not declared in this scope; did you mean 'strstr'? 10 | A = substr(1,A.size()-1); | ^~~~~~ | strstr a.cc:14:11: error: 'substr' was not declared in this scope; did you mean 'strstr'? 14 | B = substr(1,B.size()-1); | ^~~~~~ | strstr a.cc:18:11: error: 'substr' was not declared in this scope; did you mean 'strstr'? 18 | C = substr(1,C.size()-1); | ^~~~~~ | strstr
s986618314
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string s_a, s_b, s_c; cin >> s_a >> s_b >> s_c; string next_card = 'a'; bool b = true; while (b) { if (next_card == 'a'){ next_card = s_a.at(0); s_a.erase(s_a.begin()); if(s_a.empty() == true) { cout << "A" << endl; break; } }else if (next_card == 'b'){ next_card = s_b.at(0); s_b.erase(s_b.begin()); if(s_b.empty() == true) { cout << "B" << endl; break; } }else{ next_card = s_c.at(0); s_c.erase(s_c.begin()); if(s_c.empty() == true) { cout << "C" << endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 8 | string next_card = 'a'; | ^~~ a.cc:11:19: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | if (next_card == 'a'){ | ~~~~~~~~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 11 | if (next_card == 'a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | if (next_card == 'a'){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if (next_card == 'a'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if (next_card == 'a'){ | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 11 | if (next_card == 'a'){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 11 | if (next_card == 'a'){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_vie
s611068125
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string s_a, s_b, s_c; cin >> s_a >> s_b >> s_c; string next_card == 'a'; bool b = ture; while (b) { if (next_card == 'a'){ next_card = s_a.at(0); s_a.erase(s_a.begin()); if(s_a.empty() == true) { cout << "A" << endl; break; } }else if (next_card == 'b'){ next_card = s_b.at(0); s_b.erase(s_b.begin()); if(s_b.empty() == true) { cout << "B" << endl; break; } }else{ next_card = s_c.at(0); s_c.erase(s_c.begin()); if(s_c.empty() == true) { cout << "C" << endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:8:20: error: expected initializer before '==' token 8 | string next_card == 'a'; | ^~ a.cc:9:12: error: 'ture' was not declared in this scope 9 | bool b = ture; | ^~~~ a.cc:11:9: error: 'next_card' was not declared in this scope; did you mean 'nexttoward'? 11 | if (next_card == 'a'){ | ^~~~~~~~~ | nexttoward
s489075052
p03998
C++
abcb aacb bccc
a.cc:1:1: error: 'abcb' does not name a type 1 | abcb | ^~~~
s430211882
p03998
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define SORT(c) sort((c).begin(),(c).end()) #define REVERSE(c) reverse((c).begin(),(c).end()) #define ALL(x) (x).begin(),(x).end() const long long MOD = 1000000007; const long long INF = 1LL << 60; int main(){ string A1, B1, C1; cin >> A1 >> B1 >> C1; queue<char> A; queue<char> B; queue<char> C; for(int i = 0; i < A1.length(); i++)A.push(A1[i]); for(int i = 0; i < B1.length(); i++)B.push(B1[i]); for(int i = 0; i < C1.length(); i++)C.push(C1[i]); bool AA = true, BB = false, CC = false; while(true){ if(AA){ if(A.empty()){ cout << 'A' << endl; return 0; } char S = A.front(); A.pop() if(S == 'a'){ continue; }else if(S == 'b'){ AA = false; BB = true; }else if(S == 'c'){ AA = false; CC = true; } } else if(BB){ if(B.empty()){ cout << 'B' << endl; return 0; } char S = B.front(); B.pop(); if(S == 'a'){ AA = true; BB = false; }else if(S == 'b'){ continue; }else if(S == 'c'){ BB = false; CC = true; } } else if(CC){ if(C.empty()){ cout << 'C' << endl; return 0; } char S = C.front(); C.pop(); if(S == 'a'){ AA = true; CC = false; }else if(S == 'b'){ BB = true; CC = false; }else if(S == 'c'){ continue; } }/*else{ cout << "ALL_FALSE" << endl; return 0; }*/ } }
a.cc: In function 'int main()': a.cc:29:32: error: expected ';' before 'if' 29 | A.pop() | ^ | ; 30 | if(S == 'a'){ | ~~ a.cc:32:26: error: expected '}' before 'else' 32 | }else if(S == 'b'){ | ^~~~ a.cc:22:23: note: to match this '{' 22 | if(AA){ | ^ a.cc:32:34: error: 'S' was not declared in this scope 32 | }else if(S == 'b'){ | ^ a.cc:41:17: error: 'else' without a previous 'if' 41 | else if(BB){ | ^~~~ a.cc:53:33: error: continue statement not within a loop 53 | continue; | ^~~~~~~~ a.cc:75:33: error: continue statement not within a loop 75 | continue; | ^~~~~~~~ a.cc: At global scope: a.cc:82:1: error: expected declaration before '}' token 82 | } | ^
s999101312
p03998
C++
#include <bits/stdc++.h> #define repeat(i,a,n) for(int i=0;i<n;i++) using namespace std; int main(){ vector<string> S(3); repeat(i,0,3) cin >>S[i]; int i = 0; char ans; while(true){ if (s[i].size()==0){ ans = 'A'+i; break; } char front = s[i][0]; s[i].erase(0,1); i = front - 'a'; } cout <<ans<< endl; }
a.cc: In function 'int main()': a.cc:12:9: error: 's' was not declared in this scope 12 | if (s[i].size()==0){ | ^ a.cc:16:18: error: 's' was not declared in this scope 16 | char front = s[i][0]; | ^
s987994694
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string s[3]; cin >>s[0]>>s[1]>>s[2]; int i=0; while(true){ if(s[i].size()==0){ cout<<char('A'+i)<<endl; } char c=s[i].substr(0,1); s[i].erase(0,0); i=c-'a'; } }
a.cc: In function 'int main()': a.cc:12:25: error: cannot convert 'std::__cxx11::basic_string<char>' to 'char' in initialization 12 | char c=s[i].substr(0,1); | ~~~~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char>
s754610771
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string s[3]; cin >>s[0]>>s[1]>>s[2]; int i=0; while(true){ if(s[i].size()==0){ cout<<char('A'+i)<<endl; } string c=s[i].substr(0,1); s[i].erase(0,0); i=c-"a"; } }
a.cc: In function 'int main()': a.cc:14:10: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [2]') 14 | i=c-"a"; | ~^~~~ | | | | | const char [2] | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 14 | i=c-"a"; | ^~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)' 370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)' 379 | operator-(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: a.cc:14:11: note: mismatched types 'const std::complex<_Tp>' and 'const char [2]' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:14:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:14:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:14:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 14 | i=c-"a"; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:14:11: note: mismatched types 'const std::valarray<_Tp>' and 'const char [2]' 14 | i=c-"a"; | ^~~
s183133538
p03998
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<bitset> #define ll long long #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FFOR(i,a,b) for(int i=(a);i<=(b);++i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) FFOR(i,0,n) #define SORT(V) sort((V).begin(),(V).end()) #define INF ((1LL<<62)-(1LL<<31)) #define MOD 1000000007 using namespace std; int main(){ string S[3]; cin>>S[0]>>S[1]>>S[2]; int j=0; while(S[0]>0 || S[1]>0 || S[2]>0){ if(S[j].at(0)=='a') j=0; if(S[j].at(0)=='b') j=1; if(S[j].at(0)=='c') j=2; string a; for(int i=1; i<S[j].size(); ++i) a+=S[j].at(i); } if(S[0].size()==0) cout<<"A"<<endl; if(S[1].size()==0) cout<<"B"<<endl; if(S[2].size()==0) cout<<"C"<<endl; }
a.cc: In function 'int main()': a.cc:22:13: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ~~~~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} 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:5: /usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:22:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:22:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:22:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:22:14: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:22:14: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 22 | while(S[0]>0 || S[1]>0 || S[2]>0){ | ^ /usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduct
s169508720
p03998
C++
#include <algorithm> #include <iostream> //入出力 #include <stdio.h> #include <map> #include <set> #include <string> #include <math.h> //算術演算子 #include <vector> #include <cstdlib> #include <queue> #include <stack> #include <list> #include <iomanip> //小数点以下を表示させる(setprecision()) // #include <bits/stdc++.h> using namespace std; typedef long long ll; //64bit型 #define rep(i, n) for (int i = 0; i < (n); i++) #define all(a) (a).begin(), (a).end() #define debug(x) cerr << x << " " \ << "(L:" << __LINE__ << ")" << '\n' #define PRINT(V) \ { \ for (int i = 0; i < V.size(); i++) \ { \ cout << V[i] << " "; \ } \ cout << endl; \ } int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } string BinaryNum(int N) { string S; while (N != 0) { if (N % 2 == 1) { N--; S = '1' + S; } else { S = '0' + S; } N /= 2; } return S; } bool binary(vector<int> vec, int key) { int left = 0; int right = vec.size(); while (left < right) { int mid = (left + right) / 2; if (vec[mid] == key) { return true; } else if (vec[mid] > key) { right = mid; } else { left = mid + 1; } } return false; } int main() //input->compute->output { string Sa, Sb, Sc; cin >> Sa >> Sb >> Sc; int i = 1; int j = 0; int k = 0; char m = Sa[0]; while (i <= Sa.length() && j <= Sb.length() && k <= Sc.length()) { debug(m); if (m == 'a') { m = Sa[i]; i++; } else if (m == 'b') { m = Sb[j]; j++; } else { m = Sc[k]; k++; } PRINT(v); } if (i > Sa.length()) { cout << 'A' << endl; } else if (j > Sb.length()) { cout << 'B' << endl; } else { cout << 'C' << endl; } return 0; }
a.cc: In function 'int main()': a.cc:105:23: error: 'v' was not declared in this scope 105 | PRINT(v); | ^ a.cc:24:37: note: in definition of macro 'PRINT' 24 | for (int i = 0; i < V.size(); i++) \ | ^
s852002964
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s[3]; cin>>s[0]>>s[1]>>s[2]; int turn=0; char ans; while(1){ if(s[turn].empty()){ ans=turn+'A'; break; } int tmp=s[turn][0]-'a' s[turn].erase(s[turn].begin()); turn=tmp; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 's' 14 | s[turn].erase(s[turn].begin()); | ^
s418165387
p03998
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<(int)(n);i++) #define fs first #define sc second typedef pair<ll, ll> l_l; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) int main(){ string a,b,c; cin>>a>>b>>c; int x=0; int y,z=0; char next=a; while(1){ if(a[x]=='a'&&next=='a'){ x++; next='a'; } else if(a[x]=='b'&&next=='a'){ x++; next='b'; } else if(a[x]=='c'&&next=='a'){ x++; next='c'; } else if(b[y]=='a'&&next=='b'){ next='a'; y++; } else if(b[y]=='b'&&next=='b'){ y++; next='b'; } else if(b[y]=='c'&&next=='c'){ y++; next='c'; } else if(c[z]=='a'&&next=='c'){ z++; next='a'; } else if(c[z]=='b'&&next=='c'){ z++; next='b'; } else if(c[z]=='c'&&next=='c'){ z++; next='c'; } if(a.size()<x){ cout<<"A"<<endl; return 0; } else if(b.size()<y){ cout<<"B"<<endl; return 0; } else{ cout<<'C'<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:18:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization 18 | char next=a; | ^ | | | std::string {aka std::__cxx11::basic_string<char>}
s887393826
p03998
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<(int)(n);i++) #define fs first #define sc second typedef pair<ll, ll> l_l; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) int main(){ string a,b,c; cin>>a>>b>>c; int x=0; int y,z=-1; char next; while(1){ if(a[x]=='a'&&next=='a'){ x++; next='a'; } else if(a[x]=='b'&&next=='a'){ x++; next='b'; } else if(a[x]=='c'&&next=='a'){ x++; next='c'; } else if(b[y]=='a'&&next=='b'){ next='a'; y++; } else if(b[y]=='b'&&next=='b'){ y++; next='b'; } else if(b[y]=='c'&&next=='c'){ y++; next='c'; } else if(c[z]=='a'&&next=='c'){ z++; next='a'; } else if(c[z]=='b'&&next=='c'){ z++; next='b'; } else if(c[z]=='c'&&next=='c'){ z++; next='c'; } if(a.size()<x){ cout<<"a"<<endl; return 0; } else if(b.size()<y){ cout<<"b"<<endl; return 0; } else{ cout<<'c'<<endl; return 0; } }
a.cc: In function 'int main()': a.cc:68:2: error: expected '}' at end of input 68 | } | ^ a.cc:13:11: note: to match this '{' 13 | int main(){ | ^
s978281325
p03998
C
#include <stdio.h>int main(){char a[99],b[99],c[99];char t,x;int g=0,h=0,q=0,end =1;scanf("%s%s%s",a,b,c);t = a[g];while(end){switch (t){case('a'): g++;t = a[g];x = 'A';break;case('b'): t= b[h];h++;x ='B';break;case('c'):t= c[q]; q++;x='C'; break;default: printf("%c",x); end =0;}}return 0;}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int main(){char a[99],b[99],c[99];char t,x;int g=0,h=0,q=0,end =1;scanf("%s%s%s",a,b,c);t = a[g];while(end){switch (t){case('a'): g++;t = a[g];x = 'A';break;case('b'): t= b[h];h++;x ='B';break;case('c'):t= c[q]; q++;x='C'; break;default: printf("%c",x); end =0;}}return 0;} | ^~~ /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
s393879479
p03998
C
#include <stdio.h> int main(){ char a[100],b[100],c[100]; char t,x; int g=0,h=0,q=0; int end =1; scanf("%s%s%s",a,b,c); t = a[g]; while(end){ switch (t){ case('a'): aa++; t = a[g]; x = 'A'; break; case('b'): t= b[h]; bb++; x = 'B'; break; case('c'): t= c[q]; cc++; x='C'; break; default: printf("%c",x); end =0; } } return 0; }
main.c: In function 'main': main.c:12:3: error: 'aa' undeclared (first use in this function); did you mean 'a'? 12 | aa++; | ^~ | a main.c:12:3: note: each undeclared identifier is reported only once for each function it appears in main.c:18:3: error: 'bb' undeclared (first use in this function); did you mean 'b'? 18 | bb++; | ^~ | b main.c:23:3: error: 'cc' undeclared (first use in this function); did you mean 'c'? 23 | cc++; | ^~ | c
s872077050
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<string> s(3); cin>>s.at(0)>>s.at(1)>>s.at(2); int n=0; while(true){ if(s.at(n).empty()){ if(n==0)cout<<'A'<<endl; else if(n==1)cout<<'B'<<endl; else if(n==2)cout<<'C'<<endl; break; } if(s.at(n).at(0)=='a'){ n=0; s.at(n).erase(s.at(n).begin()); }else if(s.at(n).at(0)=='b'){ n=1; s.at(n).erase(s.at(n).begin()); }else if(s.at(n).at(0)=='c'){ n=2; s.at(n).erase(s.at(n).begin()); } } } c
a.cc:33:1: error: 'c' does not name a type 33 | c | ^
s581891769
p03998
C
#include <stdio.h> #include <string.h> char s[3][101]; int n[3], c[3]; int r(int i){ if(c[i] == n[i]) return i; return dfs(s[i][c[i]++] - 'a'); } int main() { for(int i = 0; i < 3; i++){ scanf("%s", s[i]); n[i] = strlen(s[i]); } printf("%c\n", r(0) + 'A'); return 0; }
main.c: In function 'r': main.c:7:10: error: implicit declaration of function 'dfs'; did you mean 'ffs'? [-Wimplicit-function-declaration] 7 | return dfs(s[i][c[i]++] - 'a'); | ^~~ | ffs
s988433378
p03998
C
#include <stdio.h> #include <string.h> char s[3][101]; int n[3], c[3]; int r(int i){ if(c[i] == n[i]) return i; return dfs(s[i][c[i]++] - 'a'); } int main() { for(int i = 0; i < 3; i++){ scanf("%s", s[i]); n[i] = strlen(s[i]); } printf("%c\n", dfs(0) + 'A'); return 0; }
main.c: In function 'r': main.c:7:10: error: implicit declaration of function 'dfs'; did you mean 'ffs'? [-Wimplicit-function-declaration] 7 | return dfs(s[i][c[i]++] - 'a'); | ^~~ | ffs
s429788582
p03998
C++
a = [0] * 3 a[0] = input()[::-1] a[1] = input()[::-1] a[2] = input()[::-1] d = dict() d['a'] = 0 d['b'] = 1 d['c'] = 2 nxt = 0 cur = 0 while True: cur = nxt if len(a[cur]) == 0: break nxt = d[a[cur][-1]] a[cur] = a[cur][:-1] if cur == 0: print('A') elif cur == 1: print('B') else: print('C')
a.cc:1:1: error: 'a' does not name a type 1 | a = [0] * 3 | ^
s943754182
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string a,b,c; char t = 'a'; cin >> a >> b >> c; reverse(a.begin,a.end); reverse(b.begin,b.end); reverse(c.begin,c.end); while(true){ if(t == 'a'){ if(a.size() == 0){ break; } t = a.at(a.size() - 1); a.pop_back; } if(t == 'b'){ if(b.size() == 0){ break; } t = b.at(b.size() - 1); b.pop_back; } if(t == 'c'){ if(c.size() == 0){ break; } t = c.at(c.size() - 1); c.pop_back; } } cout << t << endl; }
a.cc: In function 'int main()': a.cc:8:10: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 8 | reverse(a.begin,a.end); | ~~~~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:8:10: note: couldn't deduce template parameter '_BIter' 8 | reverse(a.begin,a.end); | ~~~~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided a.cc:9:10: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 9 | reverse(b.begin,b.end); | ~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:9:10: note: couldn't deduce template parameter '_BIter' 9 | reverse(b.begin,b.end); | ~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided a.cc:10:10: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 10 | reverse(c.begin,c.end); | ~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:10:10: note: couldn't deduce template parameter '_BIter' 10 | reverse(c.begin,c.end); | ~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided a.cc:17:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 17 | a.pop_back; | ~~^~~~~~~~ In file included 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/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:24:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 24 | b.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:31:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 31 | c.pop_back; | ~~^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
s178136735
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C; int countA=1;int countB,countC=0; char win; cin>>A>>B>>C; char ch=A.at(0); Outer: for(int i=0;i<300;i++){ Inner: switch(ch){ case 'a': countA++; ch=A.at(i); if(countA=A.size()){ win='A'; break Outer; } break; case 'b': countB++; ch=B.at(i); if(countB=B.size()){ win='B'; break Outer; } break; case 'c': countC++; ch=C.at(i); if(countC=C.size()){ win='C'; break Outer; } break; } } cout<<win<<endl; }
a.cc: In function 'int main()': a.cc:14:24: error: expected ';' before 'Outer' 14 | break Outer; | ^~~~~~ | ; a.cc:14:25: error: 'Outer' was not declared in this scope 14 | break Outer; | ^~~~~ a.cc:21:24: error: expected ';' before 'Outer' 21 | break Outer; | ^~~~~~ | ; a.cc:21:25: error: 'Outer' was not declared in this scope 21 | break Outer; | ^~~~~ a.cc:28:24: error: expected ';' before 'Outer' 28 | break Outer; | ^~~~~~ | ; a.cc:28:25: error: 'Outer' was not declared in this scope 28 | break Outer; | ^~~~~
s851831267
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C; int countA=1;int countB,countC=0; char win; cin>>A>>B>>C; char ch=A.at(0); Outer: for(int i=0;i<300;i++){ switch(ch){ case 'a': countA++; ch=A.at(i); if(countA=A.size()){ win='A'; break Outer; } break; case 'b': countB++; ch=B.at(i); if(countB=B.size()){ win='B'; break Outer; } break; case 'c': countC++; ch=C.at(i); if(countC=C.size()){ win='C'; break Outer; } break; } } cout<<win<<endl; }
a.cc: In function 'int main()': a.cc:14:24: error: expected ';' before 'Outer' 14 | break Outer; | ^~~~~~ | ; a.cc:14:25: error: 'Outer' was not declared in this scope 14 | break Outer; | ^~~~~ a.cc:21:24: error: expected ';' before 'Outer' 21 | break Outer; | ^~~~~~ | ; a.cc:21:25: error: 'Outer' was not declared in this scope 21 | break Outer; | ^~~~~ a.cc:28:24: error: expected ';' before 'Outer' 28 | break Outer; | ^~~~~~ | ; a.cc:28:25: error: 'Outer' was not declared in this scope 28 | break Outer; | ^~~~~