submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s283686090
p03997
C++
#include <cstdio> using namespace std; int main(){ int a,b,h; scanf("%d %d %d",&a,&b,&h); printf("%d\n",((a+b)*(h/2)); return 0; }
a.cc: In function 'int main()': a.cc:9:30: error: expected ')' before ';' token 9 | printf("%d\n",((a+b)*(h/2)); | ~ ^ | )
s289151840
p03997
Java
package tstFlickr3; import java.util.Scanner; public class Atcoder { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a= sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); } }
Main.java:5: error: class Atcoder is public, should be declared in a file named Atcoder.java public class Atcoder { ^ 1 error
s262031095
p03997
C++
include <iostream> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int a, b, h; cin >> a >> b >> h; cout << (a + b) * h / 2 << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope 4 | cin.tie(0); | ^~~ a.cc:5:3: error: 'ios' has not been declared 5 | ios::sync_with_stdio(false); | ^~~ a.cc:9:3: error: 'cout' was not declared in this scope 9 | cout << (a + b) * h / 2 << endl; | ^~~~ a.cc:9:30: error: 'endl' was not declared in this scope 9 | cout << (a + b) * h / 2 << endl; | ^~~~
s187910645
p03997
C++
#include <stdio.h> int main() { int a, b, h, s; scanf_s("%d\n%d\n%d", &a, &b, &h); s = ((a + b)*h) / 2; printf("%d", s); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d\n%d\n%d", &a, &b, &h); | ^~~~~~~ | scanf
s064315001
p03997
C++
#include <iostream> using namespace std; int main() { int a,b,h; cin>>a>>b>>c; cout<<(a+b)*c/2<<endl; }
a.cc: In function 'int main()': a.cc:7:13: error: 'c' was not declared in this scope 7 | cin>>a>>b>>c; | ^
s639435303
p03997
C
#incloud <stdio.h> main() { int a,b,h; scanf("%d %d %d",&a,&b,&h); printf("%d\n",(a+b)*h/2); }
main.c:1:2: error: invalid preprocessing directive #incloud; did you mean #include? 1 | #incloud <stdio.h> | ^~~~~~~ | include main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d %d %d",&a,&b,&h); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #incloud <stdio.h> main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d %d %d",&a,&b,&h); | ^~~~~ main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%d\n",(a+b)*h/2); | ^~~~~~ main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'printf'
s741621672
p03997
C++
a = int(input()) b, c = map(int, input().split()) result = int(a*(b+c)/2) print(result)
a.cc:1:1: error: 'a' does not name a type 1 | a = int(input()) | ^
s923362344
p03997
C
#include<stdio.h> #include <string.h> #include <stdlib.h> int main() { int a; int b; int h int sum1; // 個数のの入力 sum1 = 0; scanf("%d %d %d",&a,&b,&h); sum1 = ((a + b) * h) / 2; printf("%d\n",sum1); return 0; }
main.c: In function 'main': main.c:9:14: error: expected ';' before 'int' 9 | int h | ^ | ; 10 | int sum1; | ~~~ main.c:15:33: error: 'h' undeclared (first use in this function) 15 | scanf("%d %d %d",&a,&b,&h); | ^ main.c:15:33: note: each undeclared identifier is reported only once for each function it appears in
s676317274
p03997
C++
a = int(input()) b, c = map(int, input().split()) print(a*(b+c)/2)
a.cc:1:1: error: 'a' does not name a type 1 | a = int(input()) | ^
s730721664
p03997
C++
a = int(input()) b = int(input()) h = int(input()) print((a+b)*h/2)
a.cc:1:1: error: 'a' does not name a type 1 | a = int(input()) | ^
s090041757
p03997
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); }
Main.java:12: error: reached end of file while parsing } ^ 1 error
s227068515
p03997
Java
import java.util.Scanner; Class FirstJava { public static void main(String[] args){ Scanner scan = new Scanner( System.in ); int a = Integer.parseInt( scan.nextLine() ); int b = Integer.parseInt( scan.nextLine() ); int h = Integer.parseInt( scan.nextLine() ); System.out.println( (a+b)*h/2 ); } }
Main.java:3: error: class, interface, enum, or record expected Class FirstJava { ^ Main.java:4: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) Main.java:12: error: class, interface, enum, or record expected } ^ 3 errors
s529110142
p03997
C++
#include<stdio .h> int main(void){ Int a,b,h; scanf("%d%d%d",&a,&b,&h); printf("%d¥n",(a+b)*h/2); return 0; }
a.cc:1:9: fatal error: stdio .h: No such file or directory 1 | #include<stdio .h> | ^~~~~~~~~~ compilation terminated.
s626389798
p03997
Java
import java.util.Scanner; public class FirstJava { public static void main(String[] args){ Scanner scan = new Scanner( System.in ); int a = Integer.parseInt( scan.nextLine() ); int b = Integer.parseInt( scan.nextLine() ); int h = Integer.parseInt( scan.nextLine() ); System.out.println( (a+b)*h/2 ); } }
Main.java:3: error: class FirstJava is public, should be declared in a file named FirstJava.java public class FirstJava { ^ 1 error
s067776904
p03997
C++
a = gets.to_i b = gets.to_i h = gets.to_i S = (a + b) * h / 2 print S
a.cc:1:1: error: 'a' does not name a type 1 | a = gets.to_i | ^
s790111324
p03997
C
#include<stdio.h> #include <stdlib.h> int main () { int8_t a, b, c; uint8_t str[128]; fgets(str,sizeof(str),stdin); a = atoi(str); fgets(str,sizeof(str),stdin); b = atoi(str); fgets(str,sizeof(str),stdin); c = atoi(str); //printf("%d, %d, %d\n", a,b,c); printf ("%d\n", (a+b)*c/2); return 0; }
main.c: In function 'main': main.c:6:5: error: unknown type name 'uint8_t' 6 | uint8_t str[128]; | ^~~~~~~ main.c:3:1: note: 'uint8_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>' 2 | #include <stdlib.h> +++ |+#include <stdint.h> 3 | main.c:8:11: error: passing argument 1 of 'fgets' from incompatible pointer type [-Wincompatible-pointer-types] 8 | fgets(str,sizeof(str),stdin); | ^~~ | | | int * In file included from main.c:1: /usr/include/stdio.h:654:38: note: expected 'char * restrict' but argument is of type 'int *' 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ~~~~~~~~~~~~~~~~~^~~ main.c:9:14: error: passing argument 1 of 'atoi' from incompatible pointer type [-Wincompatible-pointer-types] 9 | a = atoi(str); | ^~~ | | | int * In file included from main.c:2: /usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'int *' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~ main.c:10:11: error: passing argument 1 of 'fgets' from incompatible pointer type [-Wincompatible-pointer-types] 10 | fgets(str,sizeof(str),stdin); | ^~~ | | | int * /usr/include/stdio.h:654:38: note: expected 'char * restrict' but argument is of type 'int *' 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ~~~~~~~~~~~~~~~~~^~~ main.c:11:14: error: passing argument 1 of 'atoi' from incompatible pointer type [-Wincompatible-pointer-types] 11 | b = atoi(str); | ^~~ | | | int * /usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'int *' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~ main.c:12:11: error: passing argument 1 of 'fgets' from incompatible pointer type [-Wincompatible-pointer-types] 12 | fgets(str,sizeof(str),stdin); | ^~~ | | | int * /usr/include/stdio.h:654:38: note: expected 'char * restrict' but argument is of type 'int *' 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ~~~~~~~~~~~~~~~~~^~~ main.c:13:14: error: passing argument 1 of 'atoi' from incompatible pointer type [-Wincompatible-pointer-types] 13 | c = atoi(str); | ^~~ | | | int * /usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'int *' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~
s659433282
p03997
Java
import java.util.Scanner; public class Main1 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); int total = 0; if( a <100 && b<100 && c<100){ total = (a+b)*c/2; }else { System.out.println("1~100の数字を指定してください。"); } System.out.println(total); } }
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s411078183
p03997
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); int total = 0; if( a <100 && b<100 && c<100){ total = (a+b)*c/2; }else { System.out.println(""); } System.out.println(total); }
Main.java:25: error: reached end of file while parsing } ^ 1 error
s169066749
p03997
C++
#include "stdafx.h" #include <iostream> using namespace std; int main() { int a, h, b; cin >> a >> b >> h; cout << (a + b) * h / 2 << endl; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s344533882
p03997
Java
import java.util.*; public class A{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s407280127
p03997
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner gio = new Scanner(System.in); a = gio.nextInt(); b = gio.nextInt(); h = gio.nextInt(); System.out.println((double)((a + b) * h)/(double)2); } }
Main.java:5: error: cannot find symbol a = gio.nextInt(); ^ symbol: variable a location: class Main Main.java:6: error: cannot find symbol b = gio.nextInt(); ^ symbol: variable b location: class Main Main.java:7: error: cannot find symbol h = gio.nextInt(); ^ symbol: variable h location: class Main Main.java:8: error: cannot find symbol System.out.println((double)((a + b) * h)/(double)2); ^ symbol: variable a location: class Main Main.java:8: error: cannot find symbol System.out.println((double)((a + b) * h)/(double)2); ^ symbol: variable b location: class Main Main.java:8: error: cannot find symbol System.out.println((double)((a + b) * h)/(double)2); ^ symbol: variable h location: class Main 6 errors
s839898576
p03997
C++
#inlcude<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<((a+b)*c)/2<<endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<iostream> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:7:1: error: 'cin' was not declared in this scope 7 | cin>>a>>b>>c; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inlcude<iostream> a.cc:8:1: error: 'cout' was not declared in this scope 8 | cout<<((a+b)*c)/2<<endl; | ^~~~ a.cc:8:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:20: error: 'endl' was not declared in this scope 8 | cout<<((a+b)*c)/2<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #inlcude<iostream>
s092637027
p03997
C++
include<#bits/stdc++.h> using namespace std; int main() { int a,b,h; cin >> a >> b >> h; cout << (a+b)*h/2 <<endl; return 0; }
a.cc:1:9: error: stray '#' in program 1 | include<#bits/stdc++.h> | ^ a.cc:1:1: error: 'include' does not name a type 1 | include<#bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope 6 | cin >> a >> b >> h; | ^~~ a.cc:7:1: error: 'cout' was not declared in this scope 7 | cout << (a+b)*h/2 <<endl; | ^~~~ a.cc:7:21: error: 'endl' was not declared in this scope 7 | cout << (a+b)*h/2 <<endl; | ^~~~
s024581228
p03997
C++
def solve(): a = int(input()) b = int(input()) h = int(input()) print((a+b)*h//2)
a.cc:1:1: error: 'def' does not name a type 1 | def solve(): | ^~~
s249007759
p03997
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define vvi vector< vector<int> > #define vi vector<int> #define All(X) X.begin(),X.end() #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define REP(i,n) for(int i=0;i<(int)(n);i++) #define pb push_back #define pii pair<int,int> #define mp make_pair #define pi 3.14159265359 #define shosu(X) fixed << setprecision(X) ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} int main(){ int a,b,c; cin >> a >> b >> c; cout << (a+b)*h/2 << endl; }
a.cc: In function 'int main()': a.cc:21:23: error: 'h' was not declared in this scope 21 | cout << (a+b)*h/2 << endl; | ^
s258773638
p03998
Java
import java.util.*; import java.io.*; public class HelloWorld{ public static void main(String []args){ Scanner scanner = new Scanner(System.in); String a = scanner.next(); String b = scanner.next(); String c = scanner.next(); List<Character> list1 = new ArrayList<>(); List<Character> list2= new ArrayList<>(); List<Character> list3 = new ArrayList<>(); int current =1; for(int i=0;i<a.length();i++) list1.add(a.charAt(i)); for(int i=0;i<b.length();i++) list2.add(b.charAt(i)); for(int i=0;i<c.length();i++) list3.add(c.charAt(i)); outerloop: while(list1.size()!=0 || list2.size()!=0 || list3.size()!=0 ) { if(current==1) { while(list1.size()!=0 &&list1.get(0)=='a' ) { list1.remove(0); } if(list1.size()!=0 && list1.get(0)=='b' ) current =2; if( list1.size()!=0 && list1.get(0)=='c') current =3; if(list1.size()!=0) list1.remove(0); else break outerloop; } else if(current==2) { while(list2.size()!=0 && list2.get(0)=='b') { list2.remove(0); } if(list2.size()!=0 && list2.get(0)=='a' ) current =1; if(list2.size()!=0 && list2.get(0)=='c') current =3; if(list2.size()!=0) list2.remove(0); else break outerloop; } else if(current==3) { while(list3.size()!=0 && list3.get(0)=='c' ) { list3.remove(0); } if(list3.size()!=0 &&list3.get(0)=='a') current =1; if(list3.size()!=0 && list3.get(0)=='b' ) current =2; if(list3.size()!=0) list3.remove(0); else break outerloop; } } if(list1.size()==0) System.out.println("A"); else if(list2.size()==0) System.out.println("B"); else if(list3.size()==0) System.out.println("C"); } }
Main.java:4: error: class HelloWorld is public, should be declared in a file named HelloWorld.java public class HelloWorld{ ^ 1 error
s198814597
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string X,Y,Z;cin>>X>>Y>>Z; int lx=X.size(); int ly=Y.size(); int lz=Z.size(); int p=1,q=0,r=0; char S=X.at(0); while(true){ if(S=='a'){ S=X.at(p); p++; } else if(S=='b'){ S=Y.at(q); q++; } else{ S=Z.at(r); r++; } char ans; if(S=='a'&&p==lx){ ans='A'; break; } else if(S=='b' && q==ly){ ans='B'; break; } else if(S=='c' && r==lz){ ans='C'; break; } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:38:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | cout<<ans<<endl; | ^~~ | abs
s496308631
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string X,Y,Z;cin>>X>>Y>>Z; int lx=X.size(); int ly=Y.size(); int lz=Z.size(); int p=1,q=0;r=0; char S=X.at(0); while(true){ if(S=='a'){ S=X.at(p); p++; } else if(S=='b'){ S=Y.at(q); q++; } else{ S=Z.at(r); r++; } char ans; if(S=='a'&&p==lx){ ans='A'; break; } else if(S=='b' && q==ly){ ans='B'; break; } else if(S=='c' && r==lz){ ans='C'; break; } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:15: error: 'r' was not declared in this scope 9 | int p=1,q=0;r=0; | ^ a.cc:38:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | cout<<ans<<endl; | ^~~ | abs
s211263220
p03998
C++
#include <iostream> #include <cmath> #include <algorithm> #include <bitset> #include <iomanip> #include <cstdio> #include <new> #include <vector> #include <cstdlib> #include <string> #include <set> #include <tuple> #include<map> using namespace std; int main() { string sa, sb, sc; cin >> sa >> sb >> sc; char turn = 'a'; char ans; while (true) { if (turn == 'a') { if (sa.size == 0) { ans = 'A'; break; } turn = sa[sa.size()-1]; sa.pop_back(); } else if (turn == 'b') { if (sb.size()==0) { ans = 'B'; break; } turn = sb[sb.size() - 1]; sb.pop_back(); } else if (turn == 'c') { if (sc.size()==0) { ans = 'C'; break; } turn = sc[sc.size() - 1]; sc.pop_back(); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:26:32: 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 (sa.size == 0) { | ~~~^~~~ | ()
s927727903
p03998
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; #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++) int main() { string A, B, C; cin >> A >> B >> C; int Al = A.size(); int Bl = B.size(); int Cl = C.size(); int Ac, Bc, Cc; Ac = Bc = Cc = 0; int a = b = c = 0; a++; rep(i, Al + Bl + Cl - 3) { if(a == 1) { if(A.at(Ac) == 'a') { Ac++; } if(A.at(Ac) == 'b') { Bc++; a--; b++; } if(A.at(Ac) == 'c') { Cc++; a--; c++; } } if(b == 1) { if(A.at(Bc) == 'a') { Bc++; b--; a++; } if(A.at(Bc) == 'b') { Bc++; } if(A.at(Bc) == 'c') { Bc++; b--; c++; } } if(c == 1) { if(A.at(Cc) == 'a') { Cc++; c--; b++; } if(A.at(Cc) == 'b') { Cc++; c--; b++; } if(A.at(Cc) == 'c') { Cc++; } } if(Ac == Al - 1 || Bc == Bl - 1 || Cc == Cl - 1) { break; } } if(a == 1) { cout << "A" << endl; } if(b == 1) { cout << "B" << endl; } if(c == 1) { cout << "C" << endl; } }
a.cc: In function 'int main()': a.cc:15:11: error: 'b' was not declared in this scope 15 | int a = b = c = 0; | ^ a.cc:15:15: error: 'c' was not declared in this scope 15 | int a = b = c = 0; | ^
s747868246
p03998
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; #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++) int main() { string A, B, C; cin >> A >> B >> C; int Al = A.size(); int Bl = B.size(); int Cl = C.size(); int Ac = Bc = Cc = 0; int a = b = c = 0; a++; rep(i, A + B + C - 3) { if(a == 1) { if(A.at(Ac) == 'a') { Ac++; } if(A.at(Ac) == 'b') { Bc++; a--; b++; } if(A.at(Ac) == 'c') { Cc++; a--; c++; } } if(b == 1) { if(A.at(Bc) == 'a') { Bc++; b--; a++; } if(A.at(Bc) == 'b') { Bc++; } if(A.at(Bc) == 'c') { Bc++; b--; c++; } } if(c == 1) { if(A.at(Cc) == 'a') { Cc++; c--; b++; } if(A.at(Cc) == 'b') { Cc++; c--; b++; } if(A.at(Cc) == 'c') { Cc++; } } if(Ac == Al - 1 || Bc == Bl - 1 || Cc == Cl - 1) { break; } } if(a == 1) { cout << "A" << endl; } if(b == 1) { cout << "B" << endl; } if(c == 1) { cout << "C" << endl; } }
a.cc: In function 'int main()': a.cc:13:12: error: 'Bc' was not declared in this scope; did you mean 'Ac'? 13 | int Ac = Bc = Cc = 0; | ^~ | Ac a.cc:13:17: error: 'Cc' was not declared in this scope; did you mean 'Ac'? 13 | int Ac = Bc = Cc = 0; | ^~ | Ac a.cc:14:11: error: 'b' was not declared in this scope 14 | int a = b = c = 0; | ^ a.cc:14:15: error: 'c' was not declared in this scope 14 | int a = b = c = 0; | ^ a.cc:16:20: error: no match for 'operator-' (operand types are 'std::__cxx11::basic_string<char>' and 'int') 16 | rep(i, A + B + C - 3) { | ~~~~~~~~~ ^ ~ | | | | | int | std::__cxx11::basic_string<char> a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ 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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ 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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::complex<_Tp>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::complex<_Tp>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: mismatched types 'const std::complex<_Tp>' and 'int' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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:16:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 16 | rep(i, A + B + C - 3) { | ^ a.cc:5:45: note: in definition of macro 'rep' 5 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ /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(-, __m
s299322067
p03998
C++
#include<iostream> #include<bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない int main(){ string Sa,Sb,Sc; cin>>Sa>>Sb>>Sc; string next; next.push_back(Sa[0]); while(true) { if(next=="a") { if(Sa.empty()) { cout<<"A"<<endl; break; } next=*Sa.begin(); Sa.erase(Sa.begin()); } if(next=="b") { if(Sb.empty()) { cout<<"B"<<endl; break; } next=*Sb.begin(); Sb.erase(Sb.begin()); } if(next=="c") { if(Sa.empty()) { cout<<"C"<<endl; break; } next=*Sc.begin(); Sc.erase(Sc.begin()); } } return 0; } ++; } } return 0; }
a.cc:51:1: error: expected unqualified-id before '++' token 51 | ++; | ^~ a.cc:52:9: error: expected declaration before '}' token 52 | } | ^ a.cc:53:5: error: expected declaration before '}' token 53 | } | ^ a.cc:54:5: error: expected unqualified-id before 'return' 54 | return 0; | ^~~~~~ a.cc:55:1: error: expected declaration before '}' token 55 | } | ^
s096333457
p03998
C++
#include<iostream> #include<bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない int main(){ string Sa,Sb,Sc; cin>>Sa>>Sb>>Sc; string next; next.push_back(a[0]); while(true) { if(next=="a") { if(Sa.empty()) { cout<<"A"<<endl; break; } next=*Sa.begin(); Sa.erase(Sa.begin()); } if(next=="b") { if(Sb.empty()) { cout<<"B"<<endl; break; } next=*Sb.begin(); Sb.erase(Sb.begin()); } if(next=="c") { if(Sa.empty()) { cout<<"C"<<endl; break; } next=*Sc.begin(); Sc.erase(Sc.begin()); } } return 0; } #include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { string A, B, C; cin >> A >> B >> C; string next; next.push_back( A[ 0 ] ); int a{}, b{}, c{}; while( true ) { if( next == "a" ) { if( A.empty() ) { cout << "A" << endl; break; } next = *A.begin(); A.erase( A.begin() ); a++; } if( next == "b" ) { if( B.empty() ) { cout << "B" << endl; break; } next = *B.begin(); B.erase( B.begin() ); b++; } if( next == "c" ) { if( C.empty() ) { cout << "C" << endl; break; } next = *C.begin(); C.erase( C.begin() ); c++; } } return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: 'a' was not declared in this scope; did you mean 'Sa'? 12 | next.push_back(a[0]); | ^ | Sa a.cc: At global scope: a.cc:53:8: error: redefinition of 'struct cww' 53 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; | ^~~ a.cc:5:8: note: previous definition of 'struct cww' 5 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない | ^~~ a.cc:53:59: error: conflicting declaration 'int star' 53 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; | ^~~~ a.cc:5:59: note: previous declaration as 'cww star' 5 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない | ^~~~ a.cc:54:5: error: redefinition of 'int main()' 54 | int main() | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main(){ | ^~~~
s494308954
p03998
C++
#include<iostream> #include<bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない int main(){ string a,b,c; cin>>a>>b>>c; string next; next.push_back(a[0]); while(true) { if(next=="a") { if(Sa.empty()) { cout<<"A"<<endl; break; } next=*Sa.begin(); Sa.erase(Sa.begin()); } if(next=="b") { if(Sb.empty()) { cout<<"B"<<endl; break; } next=*Sb.begin(); Sb.erase(Sb.begin()); } if(next=="c") { if(Sa.empty()) { cout<<"C"<<endl; break; } next=*Sc.begin(); Sc.erase(Sc.begin()); } } return 0; } #include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { string A, B, C; cin >> A >> B >> C; string next; next.push_back( A[ 0 ] ); int a{}, b{}, c{}; while( true ) { if( next == "a" ) { if( A.empty() ) { cout << "A" << endl; break; } next = *A.begin(); A.erase( A.begin() ); a++; } if( next == "b" ) { if( B.empty() ) { cout << "B" << endl; break; } next = *B.begin(); B.erase( B.begin() ); b++; } if( next == "c" ) { if( C.empty() ) { cout << "C" << endl; break; } next = *C.begin(); C.erase( C.begin() ); c++; } } return 0; }
a.cc: In function 'int main()': a.cc:18:28: error: 'Sa' was not declared in this scope; did you mean 'a'? 18 | if(Sa.empty()) | ^~ | a a.cc:23:31: error: 'Sa' was not declared in this scope; did you mean 'a'? 23 | next=*Sa.begin(); | ^~ | a a.cc:28:28: error: 'Sb' was not declared in this scope; did you mean 'b'? 28 | if(Sb.empty()) | ^~ | b a.cc:33:23: error: 'Sb' was not declared in this scope; did you mean 'b'? 33 | next=*Sb.begin(); | ^~ | b a.cc:38:28: error: 'Sa' was not declared in this scope; did you mean 'a'? 38 | if(Sa.empty()) | ^~ | a a.cc:43:23: error: 'Sc' was not declared in this scope; did you mean 'c'? 43 | next=*Sc.begin(); | ^~ | c a.cc: At global scope: a.cc:53:8: error: redefinition of 'struct cww' 53 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; | ^~~ a.cc:5:8: note: previous definition of 'struct cww' 5 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない | ^~~ a.cc:53:59: error: conflicting declaration 'int star' 53 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; | ^~~~ a.cc:5:59: note: previous declaration as 'cww star' 5 | struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; //処理早くするためのおまじない | ^~~~ a.cc:54:5: error: redefinition of 'int main()' 54 | int main() | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main(){ | ^~~~
s061946060
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ queue<char>A;queue<char>B;queue<char>C; string a,b,c; cin>>a>>b>>c; for(int i=0;i<a.size();i++)A.push(a.at(i)); for(int i=0;i<b.size();i++)B.push(b.at(i)); for(int i=0;i<c.size();i++)C.push(c.at(i)); int count=0; for(int i=0;i<500;i++){ if(count==0){ if(A.empty()){cout<<"A"<<endl;return 0;} count=A.top()-97; A.pop(); } else if(count==1){ if(B.empty()){cout<<"B"<<endl;return 0;} count=B.top()-97; B.pop(); } else{ if(C.empty()){cout<<"C"<<endl;return 0;} count=C.top()-97; C.pop(); } } }
a.cc: In function 'int main()': a.cc:13:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'? 13 | count=A.top()-97; | ^~~ | pop a.cc:18:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'? 18 | count=B.top()-97; | ^~~ | pop a.cc:23:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'? 23 | count=C.top()-97; | ^~~ | pop
s546613569
p03998
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); string s1,s2,s3; cin>>s1>>s2>>s3; stack<char>a,b,c; int a1=s1.length(); int b2=s2.length(); int c1=s3.length(); for(int i=a1-1;i>=0;i--) { a.push(s1[i]); } for(int i=b1-1;i>=0;i--) { b.push(s2[i]); } for(int i=c1-1;i>=0;i--) { c.push(s3[i]); } char ch='a'; bool p=false; char ans; while(!p) { if(ch=='a') { if(a.empty()) { p=true; ans='A'; break; } a.pop(); ch=a.top(); } else if(ch=='b') { if(b.empty()) { p=true; ans='B'; break; } b.pop(); ch=b.top(); } else { if(c.empty()) { p=true; ans='C'; break; } c.pop(); ch=c.top(); } if(p) { break; } } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:18:15: error: 'b1' was not declared in this scope; did you mean 'c1'? 18 | for(int i=b1-1;i>=0;i--) | ^~ | c1
s081387278
p03998
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); string s1,s2,s3; cin>>s1>>s2>>s3; stack<char>a,b,c; int a1=s1.length(); int b2=s2.length(); int c1=s3.length(); for(int i=a-1;i>=0;i--) { a.push(s1[i]); } for(int i=b-1;i>=0;i--) { b.push(s2[i]); } for(int i=c-1;i>=0;i--) { c.push(s3[i]); } char ch='a'; bool p=false; char ans; while(!p) { if(ch=='a') { if(a.empty()) { p=true; ans='A'; break; } a.pop(); ch=a.top(); } else if(ch=='b') { if(b.empty()) { p=true; ans='B'; break; } b.pop(); ch=b.top(); } else { if(c.empty()) { p=true; ans='C'; break; } c.pop(); ch=c.top(); } if(p) { break; } } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:14:16: error: no match for 'operator-' (operand types are 'std::stack<char>' and 'int') 14 | for(int i=a-1;i>=0;i--) | ~^~ | | | | | int | std::stack<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:17: note: 'std::stack<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::move_iterator<_IteratorL>' 14 | for(int i=a-1;i>=0;i--) | ^ 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:17: note: 'std::stack<char>' is not derived from 'const std::complex<_Tp>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::complex<_Tp>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::valarray<_Tp>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: 'std::stack<char>' is not derived from 'const std::valarray<_Tp>' 14 | for(int i=a-1;i>=0;i--) | ^ /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:17: note: mismatched types 'const std::valarray<_Tp>' and 'int' 14 | for(int i=a-1;i>=0;i--) | ^ a.cc:18:16: error: no match for 'operator-' (operand types are 'std::stack<char>' and 'int') 18 | for(int i=b-1;i>=0;i--) | ~^~ | | | | | int | std::stack<char> /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:18:17: note: 'std::stack<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | for(int i=b-1;i>=0;i--) | ^ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype (
s960415681
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string a, b, c; cin >> a >> b >> c; char next = 'a'; while (1) { if (next == 'a') { next = a.at(0); a.erase(a.begin()); if (a.size() == 0) { cout << A << endl; break; } } if (next == 'b') { next = b.at(0); b.erase(b.begin()); if (b.size() == 0) { cout << B << endl; break; } } if (next == 'c') { next = c.at(0); a.erase(c.begin()); if (c.size() == 0) { cout << C << endl; break; } } } }
a.cc: In function 'int main()': a.cc:15:17: error: 'A' was not declared in this scope 15 | cout << A << endl; | ^ a.cc:23:17: error: 'B' was not declared in this scope 23 | cout << B << endl; | ^ a.cc:31:17: error: 'C' was not declared in this scope 31 | cout << C << endl; | ^
s788186337
p03998
C++
#include <iostream> #include <stdio.h> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <map> using namespace std; int main() { string p[3]; char men[3] = {'A', 'B', 'C'}; int idx[3] = {}; for (int i=0; i<3; i++) cin >> p[i]; int who = 0; while(1) { if ((int)p[who].length() == idx[who]) {cout << men[who] << endl; return 0;} idx[who]++; who = [who][idx[who]-1] - 'a'; //while(p[i].length() > idx[i] && p[i][idx[i]-1] == men[i]+32) idx[i]++; //cout << men[i] << " " << idx[i] << endl; //if ((int)p[i].length() == idx[i]) {cout << men[i] << endl; return 0;} } return 0; }
a.cc: In lambda function: a.cc:20:16: error: expected '{' before '[' token 20 | who = [who][idx[who]-1] - 'a'; | ^ a.cc: In function 'int main()': a.cc:20:16: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
s893681037
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string a, b, c; cin >> a >> b >> c; char t = 'a'; while (true) { if (t == 'a') { if (!a.size()) { cout << "A"; break; } t = a.front(); a = a.substr(1, a.size() - 1); } else if (t == 'b') { if (!b.size()) { cout << "B"; break; } t = b.front(); b = b.substr(1, b.size() - 1); } else if (t == 'c') { if (!c.size()) { cout << "C"; break; } t = c.front(); c = c.substr(1, c.size() - 1); } }
a.cc: In function 'int main()': a.cc:38:6: error: expected '}' at end of input 38 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s505249698
p03998
C++
#include <bits/stdc++.h> #include <string.h> #include <vector> //s#define rep(i, n) for (int i = 0; i < (n); i++) #define MAX 10000 using namespace std; #define ll long long #define pb push_back #define mp make_pair #define all(a) (a).begin(),(a).end() #define rep(i,a,n) for(int i=a; i<n; i++) #define r0 return 0 #define INF (int)1e15 #define MOD 1000000007 int gcd(int a,int b){ if(a%b == 0) return b; else return gcd(b,a%b); } long long numbers[500005]; int main(){ string a,b,c; cin>>a>>b>>c; char first = a[0]; a.erase(0,1); while(1){ if(n == 'a'){ if(a.size() == 0){ cout<<"A"<<endl; return 0; } n = a[0]; a.erase(0,1); }else if(n == 'b'){ if(b.size() == 0){ cout<<"B"<<endl; return 0; } n = b[0]; b.erase(0,1); } else if(n == 'c'){ if(c.size() == 0){ cout<<"C"<<endl; return 0; } n = c[0]; c.erase(0,1); } } return 0; }
a.cc: In function 'int main()': a.cc:39:9: error: 'n' was not declared in this scope 39 | if(n == 'a'){ | ^
s495799950
p03998
C
#include <stdio.h> #include <stdlib.h> #include <string.h> char s[3][110]; int now[3]={0,0,0}; int rec(int i){ if(now[i] == strlen(s[i])) return i; char next = s[i][now[i]]; now[i]++; return rec(next - 'a'); } int main(){ for(int i = 0; i < 3; i++) int ret = scanf("%s", s[i]); printf("%c\n", rec(0) + 'A'); return 0; }
main.c: In function 'main': main.c:16:32: error: expected expression before 'int' 16 | for(int i = 0; i < 3; i++) int ret = scanf("%s", s[i]); | ^~~
s385161958
p03998
Java
import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); ArrayList<String> sa = new ArrayList<>(); for(String s: scanner.next().split("")) { sa.add(s); } ArrayList<String> sb = new ArrayList<>(); for(String s: scanner.next().split("")) { sb.add(s); } ArrayList<String> sc = new ArrayList<>(); for(String s: scanner.next().split("")) { sc.add(s); } HashMap<String, ArrayList> smap = new HashMap<>(); smap.put("a", sa); smap.put("b", sb); smap.put("c", sc); // 手番プレイヤーをAに決める // 繰り返し // 手番プレイヤーの配列0番目を見て、"a"なら次の人はAのように次の人を決める // 手番プレイヤーの配列0番目を捨てる // 手番プレイヤーの配列が長さ0なら手番プレイヤーの勝利で終わり String player = "a"; while(true) { ArrayList<String> splayer = smap.get(player); if(splayer.size() == 0) { System.out.println(player.toUpperCase()); break; } player = splayer.get(0); splayer.remove(0); } } }
Main.java:20: error: cannot find symbol HashMap<String, ArrayList> smap = new HashMap<>(); ^ symbol: class HashMap location: class Main Main.java:20: error: cannot find symbol HashMap<String, ArrayList> smap = new HashMap<>(); ^ symbol: class HashMap location: class Main 2 errors
s966681730
p03998
C
a = list(input()) b = list(input()) c = list(input()) check = "a" while len(a) != 0 and len(b) != 0 and len(c) != 0: if check == "a": check = a[0] a.pop(0) elif check == "b": check = b[0] b.pop(0) else: check = c[0] c.pop(0) if len(a) == 1: print("A") elif len(b) == 1: print("B") else: print("C")
main.c:1:1: warning: data definition has no type or storage class 1 | a = list(input()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:5: error: implicit declaration of function 'list' [-Wimplicit-function-declaration] 1 | a = list(input()) | ^~~~ main.c:1:10: error: implicit declaration of function 'input' [-Wimplicit-function-declaration] 1 | a = list(input()) | ^~~~~ main.c:1:5: error: initializer element is not constant 1 | a = list(input()) | ^~~~ main.c:2:1: error: expected ',' or ';' before 'b' 2 | b = list(input()) | ^
s383356044
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string Sa,Sb,Sc; char card; int a = 1,b = 0,c = 0; int len_a,len_b,len_c; bool flag = true; cin >> Sa >> Sb >> Sc; len_a = Sa.size(); len_b = Sb.size(); len_c = Sc.size(); card = Sa[0]; while(flag){ switch (card){ case 'a': if(a == len_a - 1){ cout << "A" << endl; flag =false; break; } else{ a++; card = Sa[a]; } break; case 'b'; if(b == len_b - 1){ cout << "B" << endl; flag = false; break; } else{ b++; card = Sb[b]; } break; case 'c': if(c == len_c - 1){ cout << "C" << endl; flag = false; break; } else{ c++; card = Sc[c]; } break; } } }
a.cc: In function 'int main()': a.cc:31:17: error: expected ':' before ';' token 31 | case 'b'; | ^ | :
s985481542
p03998
C++
#include<iostream> using namespace std; int main(){ string sa, sb, sc; cin >> sa >> sb >> sc; int total = sa.length() + sb.length() + sc.length(); int a = 0,b = 0,c = 0; char x = 'a'; for (int i = 0; i < total - 2; i ++){ if (x == 'a' && a <= sa.length() - 1){ x = sa[a]; a += 1; } if (x == 'b' && b <= sb.length() - 1){ x = sb[b]; b += 1; } if (x == 'c' && c <= sc.length() - 1){ x = sc[c]; c += 1; } if (a > sa.length() - 1){ return 'A'; } if (b > sb.length() - 1){ return 'B' } if (c > sc.length() - 1){ return 'C' } } }
a.cc: In function 'int main()': a.cc:30:23: error: expected ';' before '}' token 30 | return 'B' | ^ | ; 31 | } | ~ a.cc:33:23: error: expected ';' before '}' token 33 | return 'C' | ^ | ; 34 | } | ~
s534144059
p03998
C++
#include<iostream> using namespace std; int main(){ string sa, sb, sc; cin >> sa >> sb >> sc; int total = sa.length() + sb.length() + sc.length(); int a = 0,b = 0,c = 0; char x = 'a'; for (int i = 1; i < total; i ++){ if (x == 'a' && a <= sa.length() - 1){ x = sa[a]; a += 1; } if (x == 'b' && b <= sb.length() - 1){ x = sb[b]; b += 1; } if (x == 'c' && c <= sc.length() - 1){ x = sc[c]; c += 1; } if (a > sa.length() - 1){ return 'A'; } if (b > sb.length() - 1){ return 'B' } if (c > sc.length() - 1){ return 'C' } } }
a.cc: In function 'int main()': a.cc:28:23: error: expected ';' before '}' token 28 | return 'B' | ^ | ; 29 | } | ~ a.cc:31:23: error: expected ';' before '}' token 31 | return 'C' | ^ | ; 32 | } | ~
s292120782
p03998
C++
#include<iostream> using namespace std; int main(){ string sa, sb, sc; cin >> s a>> sb >> sc; int total = sa.length() + sb.length() + sc.length(); int a = 0,b = 0,c = 0; char x = 'a'; for (int i = 1; i < total; i ++){ if (x == 'a' && a <= sa.length() - 1){ x = sa[a]; a += 1; } if (x == 'b' && b <= sb.length() - 1){ x = sb[b]; b += 1; } if (x == 'c' && c <= sc.length() - 1){ x = sc[c]; c += 1; } if (a > sa.length() - 1){ cout << 'A'; } if (b > sb.length() - 1){ cout << 'B'; } if (c > sc.length() - 1){ cout << 'C'; } } }
a.cc: In function 'int main()': a.cc:6:12: error: 's' was not declared in this scope; did you mean 'sc'? 6 | cin >> s a>> sb >> sc; | ^ | sc
s046648729
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length(); int a=0,b=0,c=0; char x='a'; for(int i=1;i<total;i++){ if(x=='a'&&a<=sa.length()-1){ x=sa[a]; a+=1; } if(x=='b'&&b<=sb.length()-1){ x=sb[b]; b+=1; } if(x=='c'&&c<=sc.length()-1){ x=sc[c]; c+=1; } if(a>sa.length()-1){ cout<<'a'; return; } if(b>sb.length()-1){ cout<<'b'; return; } if(c>sc.length()-1){ cout<<'c'; return; } } }
a.cc: In function 'int main()': a.cc:26:13: error: return-statement with no value, in function returning 'int' [-fpermissive] 26 | return; | ^~~~~~ a.cc:30:13: error: return-statement with no value, in function returning 'int' [-fpermissive] 30 | return; | ^~~~~~ a.cc:34:13: error: return-statement with no value, in function returning 'int' [-fpermissive] 34 | return; | ^~~~~~
s244487263
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length(); int a=0,b=0,c=0; char x='a'; for(int i=1;i<total;i++){ if(x=="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x=="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x=="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout<<"a"; } if(b>sb.length()){ cout<<"b"; } if(c>sc.length()){ cout<<"c"; } } }
a.cc: In function 'int main()': a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(x=="a"&&a<=sa.length()){ | ~^~~~~ a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | if(x=="b"&&b<=sb.length()){ | ~^~~~~ a.cc:20:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(x=="c"&&c<=sc.length()){ | ~^~~~~
s421640596
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length(); int a=0,b=0,c=0; string x='a'; for(int i=1;i<total;i++){ if(x=="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x=="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x=="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout<<"a"; } if(b>sb.length()){ cout<<"b"; } if(c>sc.length()){ cout<<"c"; } } }
a.cc: In function 'int main()': a.cc:9:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 9 | string x='a'; | ^~~
s661866023
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length() int a=0,b=0,c=0; string x='a'; for(int i=1;i<total;i++){ if(x="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout<<"a"; } if(b>sb.length()){ cout<<"b"; } if(c>sc.length()){ cout<<"c"; } } }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int a=0,b=0,c=0; | ^~~ a.cc:9:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 9 | string x='a'; | ^~~ a.cc:12:19: error: 'a' was not declared in this scope 12 | if(x="a"&&a<=sa.length()){ | ^ a.cc:16:19: error: 'b' was not declared in this scope 16 | if(x="b"&&b<=sb.length()){ | ^ a.cc:20:19: error: 'c' was not declared in this scope 20 | if(x="c"&&c<=sc.length()){ | ^ a.cc:24:12: error: 'a' was not declared in this scope 24 | if(a>sa.length()){ | ^ a.cc:27:12: error: 'b' was not declared in this scope 27 | if(b>sb.length()){ | ^ a.cc:30:12: error: 'c' was not declared in this scope 30 | if(c>sc.length()){ | ^
s510424058
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length() int a=0,b=0,c=0; for(int i=1;i<total;i++){ string x='a'; if(x="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout<<"a"; } if(b>sb.length()){ cout<<"b"; } if(c>sc.length()){ cout<<"c"; } } }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int a=0,b=0,c=0; | ^~~ a.cc:10:18: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string x='a'; | ^~~ a.cc:11:19: error: 'a' was not declared in this scope 11 | if(x="a"&&a<=sa.length()){ | ^ a.cc:15:19: error: 'b' was not declared in this scope 15 | if(x="b"&&b<=sb.length()){ | ^ a.cc:19:19: error: 'c' was not declared in this scope 19 | if(x="c"&&c<=sc.length()){ | ^ a.cc:23:12: error: 'a' was not declared in this scope 23 | if(a>sa.length()){ | ^ a.cc:26:12: error: 'b' was not declared in this scope 26 | if(b>sb.length()){ | ^ a.cc:29:12: error: 'c' was not declared in this scope 29 | if(c>sc.length()){ | ^
s637702166
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length() int a=0,b=0,c=0; for(int i=1;i<total;i++){ string x='a'; if(x="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout>>"a"; } if(b>sb.length()){ cout>>"b"; } if(c>sc.length()){ cout>>"c"; } } }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int a=0,b=0,c=0; | ^~~ a.cc:10:18: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string x='a'; | ^~~ a.cc:11:19: error: 'a' was not declared in this scope 11 | if(x="a"&&a<=sa.length()){ | ^ a.cc:15:19: error: 'b' was not declared in this scope 15 | if(x="b"&&b<=sb.length()){ | ^ a.cc:19:19: error: 'c' was not declared in this scope 19 | if(x="c"&&c<=sc.length()){ | ^ a.cc:23:12: error: 'a' was not declared in this scope 23 | if(a>sa.length()){ | ^ a.cc:24:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]') 24 | cout>>"a"; | ~~~~^~~~~ | | | | | const char [2] | std::ostream {aka std::basic_ostream<char>} 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/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:24:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 24 | cout>>"a"; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[2]]': a.cc:24:19: required from here 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:26:12: error: 'b' was not declared in this scope 26 | if(b>sb.length()){ | ^ a.cc:27:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]') 27 | cout>>"b"; | ~~~~^~~~~ | | | | | const char [2] | std::ostream {aka std::basic_ostream<char>} /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:27:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 27 | cout>>"b"; | ^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 27 | cout>>"b";
s780755709
p03998
C++
#include <iostream> using namespace std; int main(){ string sa,sb,sc; cin>>sa>>sb>>sc; int total=sa.length()+sb.length()+sc.length() int a=0,b=0,c=0; for(int i=1;i<total;i++){ string x='a' if(x="a"&&a<=sa.length()){ x=sa[a]; a+=1; } if(x="b"&&b<=sb.length()){ x=sb[b]; b+=1; } if(x="c"&&c<=sc.length()){ x=sc[c]; c+=1; } if(a>sa.length()){ cout>>"a"; } if(b>sb.length()){ cout>>"b"; } if(c>sc.length()){ cout>>"c"; } } }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int a=0,b=0,c=0; | ^~~ a.cc:10:18: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string x='a' | ^~~ a.cc:11:9: error: expected ',' or ';' before 'if' 11 | if(x="a"&&a<=sa.length()){ | ^~ a.cc:15:19: error: 'b' was not declared in this scope 15 | if(x="b"&&b<=sb.length()){ | ^ a.cc:19:19: error: 'c' was not declared in this scope 19 | if(x="c"&&c<=sc.length()){ | ^ a.cc:23:12: error: 'a' was not declared in this scope 23 | if(a>sa.length()){ | ^ a.cc:24:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]') 24 | cout>>"a"; | ~~~~^~~~~ | | | | | const char [2] | std::ostream {aka std::basic_ostream<char>} 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/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:24:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 24 | cout>>"a"; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:24:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[2]]': a.cc:24:19: required from here 24 | cout>>"a"; | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:26:12: error: 'b' was not declared in this scope 26 | if(b>sb.length()){ | ^ a.cc:27:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]') 27 | cout>>"b"; | ~~~~^~~~~ | | | | | const char [2] | std::ostream {aka std::basic_ostream<char>} /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:27:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 27 | cout>>"b"; | ^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 27 | cout>>"b"; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:27:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 27 | cout>>"b"; |
s927540631
p03998
C++
#include<iostream> using namespace std; int getNextTurn(int currentTurn, string decks){ if(decks[currentTurn].length() == 0){ return -1; } int nextTurn = decks[currentTurn][0] - 'a'; decks[currentTurn] = decks[currentTurn].substr(1); return nextTurn; } int main(){ string decks[3]; for(int i=0; i<3; i++){ cin >> decks[i]; } int currentTurn = 0; while(true){ int nextTurn = getNextTurn(currentTurn, decks); if(nextTurn < 0){ cout << ((char)('A'+currentTurn)) << '\n'; break; } currentTurn = nextTurn; } }
a.cc: In function 'int getNextTurn(int, std::string)': a.cc:5:27: error: request for member 'length' in 'decks.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)currentTurn))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 5 | if(decks[currentTurn].length() == 0){ | ^~~~~~ a.cc:8:38: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript 8 | int nextTurn = decks[currentTurn][0] - 'a'; | ^ a.cc:9:45: error: request for member 'substr' in 'decks.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)currentTurn))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 9 | decks[currentTurn] = decks[currentTurn].substr(1); | ^~~~~~ a.cc: In function 'int main()': a.cc:21:49: error: could not convert '(std::string*)(& decks)' from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'} 21 | int nextTurn = getNextTurn(currentTurn, decks); | ^~~~~ | | | std::string* {aka std::__cxx11::basic_string<char>*}
s080343775
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C,D={}; cin >> A >> B >> C; D=A; while(A.empty!=1 && (B.empty!=1 && C.empty!=)){ if(D==A){ if(A[0]==a){ A = A.substr(1,A.size()-1); D = A; } else if(A[0]==b){ A = A.substr(1,A.size()-1); D = B; } else if(A[0]==c){ A = A.substr(1,A.size()-1); D = C; } } if(D==B){ if(B[0]==a){ B = B.substr(1,B.size()-1); D = A; } else if(B[0]==b){ B = B.substr(1,B.size()-1); D = B; } else if(B[0]==c){ B = B.substr(1,B.size()-1); D = C; } } if(D==C){ if(C[0]==a){ C = C.substr(1,C.size()-1); D = A; } else if(C[0]==b){ C = C.substr(1,C.size()-1); D = B; } else if(C[0]==c){ C = C.substr(1,C.size()-1); D = C; } } } if(A=={}) cout << "A" << endl; else if(B=={}) cout << "B" << endl; else if(C=={}) cout << "C" << endl; }
a.cc: In function 'int main()': a.cc:8:17: error: invalid use of member function 'bool std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::empty() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' (did you forget the '()' ?) 8 | while(A.empty!=1 && (B.empty!=1 && C.empty!=)){ | ~~^~~~~ | () a.cc:8:32: error: invalid use of member function 'bool std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::empty() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' (did you forget the '()' ?) 8 | while(A.empty!=1 && (B.empty!=1 && C.empty!=)){ | ~~^~~~~ | () a.cc:8:53: error: expected primary-expression before ')' token 8 | while(A.empty!=1 && (B.empty!=1 && C.empty!=)){ | ^ a.cc:10:26: error: 'a' was not declared in this scope 10 | if(A[0]==a){ | ^ a.cc:14:31: error: 'b' was not declared in this scope 14 | else if(A[0]==b){ | ^ a.cc:18:31: error: 'c' was not declared in this scope 18 | else if(A[0]==c){ | ^ a.cc:26:26: error: 'a' was not declared in this scope 26 | if(B[0]==a){ | ^ a.cc:30:31: error: 'b' was not declared in this scope 30 | else if(B[0]==b){ | ^ a.cc:34:31: error: 'c' was not declared in this scope 34 | else if(B[0]==c){ | ^ a.cc:42:26: error: 'a' was not declared in this scope 42 | if(C[0]==a){ | ^ a.cc:46:31: error: 'b' was not declared in this scope 46 | else if(C[0]==b){ | ^ a.cc:50:31: error: 'c' was not declared in this scope 50 | else if(C[0]==c){ | ^ a.cc:59:15: error: expected primary-expression before '{' token 59 | if(A=={}) cout << "A" << endl; | ^ a.cc:59:15: error: expected ')' before '{' token 59 | if(A=={}) cout << "A" << endl; | ~ ^ | ) a.cc:60:20: error: expected primary-expression before '{' token 60 | else if(B=={}) cout << "B" << endl; | ^ a.cc:60:20: error: expected ')' before '{' token 60 | else if(B=={}) cout << "B" << endl; | ~ ^ | ) a.cc:61:20: error: expected primary-expression before '{' token 61 | else if(C=={}) cout << "C" << endl; | ^ a.cc:61:20: error: expected ')' before '{' token 61 | else if(C=={}) cout << "C" << endl; | ~ ^ | )
s983557987
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C,D={}; cin >> A >> B >> C; D=A; while(A[0]!="" && (B[0]!="" && C[0]!="")){ if(D==A){ if(A[0]==a){ A = A.substr(1,A.size()-1); D = A; } else if(A[0]==b){ A = A.substr(1,A.size()-1); D = B; } else if(A[0]==c){ A = A.substr(1,A.size()-1); D = C; } } if(D==B){ if(B[0]==a){ B = B.substr(1,B.size()-1); D = A; } else if(B[0]==b){ B = B.substr(1,B.size()-1); D = B; } else if(B[0]==c){ B = B.substr(1,B.size()-1); D = C; } } if(D==C){ if(C[0]==a){ C = C.substr(1,C.size()-1); D = A; } else if(C[0]==b){ C = C.substr(1,C.size()-1); D = B; } else if(C[0]==c){ C = C.substr(1,C.size()-1); D = C; } } } if(A=={}) cout << "A" << endl; else if(B=={}) cout << "B" << endl; else if(C=={}) cout << "C" << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | while(A[0]!="" && (B[0]!="" && C[0]!="")){ a.cc:8:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | while(A[0]!="" && (B[0]!="" && C[0]!="")){ a.cc:8:44: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | while(A[0]!="" && (B[0]!="" && C[0]!="")){ a.cc:10:26: error: 'a' was not declared in this scope 10 | if(A[0]==a){ | ^ a.cc:14:31: error: 'b' was not declared in this scope 14 | else if(A[0]==b){ | ^ a.cc:18:31: error: 'c' was not declared in this scope 18 | else if(A[0]==c){ | ^ a.cc:26:26: error: 'a' was not declared in this scope 26 | if(B[0]==a){ | ^ a.cc:30:31: error: 'b' was not declared in this scope 30 | else if(B[0]==b){ | ^ a.cc:34:31: error: 'c' was not declared in this scope 34 | else if(B[0]==c){ | ^ a.cc:42:26: error: 'a' was not declared in this scope 42 | if(C[0]==a){ | ^ a.cc:46:31: error: 'b' was not declared in this scope 46 | else if(C[0]==b){ | ^ a.cc:50:31: error: 'c' was not declared in this scope 50 | else if(C[0]==c){ | ^ a.cc:59:15: error: expected primary-expression before '{' token 59 | if(A=={}) cout << "A" << endl; | ^ a.cc:59:15: error: expected ')' before '{' token 59 | if(A=={}) cout << "A" << endl; | ~ ^ | ) a.cc:60:20: error: expected primary-expression before '{' token 60 | else if(B=={}) cout << "B" << endl; | ^ a.cc:60:20: error: expected ')' before '{' token 60 | else if(B=={}) cout << "B" << endl; | ~ ^ | ) a.cc:61:20: error: expected primary-expression before '{' token 61 | else if(C=={}) cout << "C" << endl; | ^ a.cc:61:20: error: expected ')' before '{' token 61 | else if(C=={}) cout << "C" << endl; | ~ ^ | )
s068014644
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C,D={}; cin >> A >> B >> C; D=A; while(A[0]!={} && (B[0]!={} && C[0]!={})){ if(D==A){ if(A[0]==a){ A = A.substr(1,A.size()-1); D = A; } else if(A[0]==b){ A = A.substr(1,A.size()-1); D = B; } else if(A[0]==c){ A = A.substr(1,A.size()-1); D = C; } } if(D==B){ if(B[0]==a){ B = B.substr(1,B.size()-1); D = A; } else if(B[0]==b){ B = B.substr(1,B.size()-1); D = B; } else if(B[0]==c){ B = B.substr(1,B.size()-1); D = C; } } if(D==C){ if(C[0]==a){ C = C.substr(1,C.size()-1); D = A; } else if(C[0]==b){ C = C.substr(1,C.size()-1); D = B; } else if(C[0]==c){ C = C.substr(1,C.size()-1); D = C; } } } if(A=={}) cout << "A" << endl; else if(B=={}) cout << "B" << endl; else if(C=={}) cout << "C" << endl; }
a.cc: In function 'int main()': a.cc:8:21: error: expected primary-expression before '{' token 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ^ a.cc:8:21: error: expected ')' before '{' token 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ~ ^ | ) a.cc:8:27: error: expected identifier before '(' token 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ^ a.cc:8:41: error: expected ';' before '[' token 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ^ | ; a.cc:8:48: error: expected primary-expression before ')' token 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ^ a.cc:59:15: error: expected primary-expression before '{' token 59 | if(A=={}) cout << "A" << endl; | ^ a.cc:59:15: error: expected ')' before '{' token 59 | if(A=={}) cout << "A" << endl; | ~ ^ | ) a.cc:60:20: error: expected primary-expression before '{' token 60 | else if(B=={}) cout << "B" << endl; | ^ a.cc:60:20: error: expected ')' before '{' token 60 | else if(B=={}) cout << "B" << endl; | ~ ^ | ) a.cc:61:20: error: expected primary-expression before '{' token 61 | else if(C=={}) cout << "C" << endl; | ^ a.cc:61:20: error: expected ')' before '{' token 61 | else if(C=={}) cout << "C" << endl; | ~ ^ | ) a.cc:8:40: error: label 'C' used but not defined 8 | while(A[0]!={} && (B[0]!={} && C[0]!={})){ | ^
s707173941
p03998
C++
#include<bits/stdc++.h> using namespace std; int main(){ string A,B,C,D={}; cin >> A >> B >> C; D=A; while(A!={} && (B!={} && C!={})){ if(D==A){ if(A[0]==a){ A = A.substr(1,A.size()-1); D = A; } else if(A[0]==b){ A = A.substr(1,A.size()-1); D = B; } else if(A[0]==c){ A = A.substr(1,A.size()-1); D = C; } } if(D==B){ if(B[0]==a){ B = B.substr(1,B.size()-1); D = A; } else if(B[0]==b){ B = B.substr(1,B.size()-1); D = B; } else if(B[0]==c){ B = B.substr(1,B.size()-1); D = C; } } if(D==C){ if(C[0]==a){ C = C.substr(1,C.size()-1); D = A; } else if(C[0]==b){ C = C.substr(1,C.size()-1); D = B; } else if(C[0]==c){ C = C.substr(1,C.size()-1); D = C; } } } if(A=={}) cout << "A" << endl; else if(B=={}) cout << "B" endl; else if(C=={}) cout << "C" endl; }
a.cc: In function 'int main()': a.cc:8:18: error: expected primary-expression before '{' token 8 | while(A!={} && (B!={} && C!={})){ | ^ a.cc:8:18: error: expected ')' before '{' token 8 | while(A!={} && (B!={} && C!={})){ | ~ ^ | ) a.cc:8:24: error: expected identifier before '(' token 8 | while(A!={} && (B!={} && C!={})){ | ^ a.cc:8:37: error: expected primary-expression before '{' token 8 | while(A!={} && (B!={} && C!={})){ | ^ a.cc:8:39: error: expected primary-expression before ')' token 8 | while(A!={} && (B!={} && C!={})){ | ^ a.cc:59:15: error: expected primary-expression before '{' token 59 | if(A=={}) cout << "A" << endl; | ^ a.cc:59:15: error: expected ')' before '{' token 59 | if(A=={}) cout << "A" << endl; | ~ ^ | ) a.cc:60:20: error: expected primary-expression before '{' token 60 | else if(B=={}) cout << "B" endl; | ^ a.cc:60:20: error: expected ')' before '{' token 60 | else if(B=={}) cout << "B" endl; | ~ ^ | ) a.cc:60:35: error: expected ';' before 'endl' 60 | else if(B=={}) cout << "B" endl; | ^~~~~ | ; a.cc:61:20: error: expected primary-expression before '{' token 61 | else if(C=={}) cout << "C" endl; | ^ a.cc:61:20: error: expected ')' before '{' token 61 | else if(C=={}) cout << "C" endl; | ~ ^ | ) a.cc:61:35: error: expected ';' before 'endl' 61 | else if(C=={}) cout << "C" endl; | ^~~~~ | ; a.cc:8:34: error: label 'C' used but not defined 8 | while(A!={} && (B!={} && C!={})){ | ^
s490326045
p03998
C
#include <bits/stdc++.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ string a, b, c; cin >> a >> b >> c; int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0; char ch = a[0]; while(1){ if(ch == 'a'){ if(i == sa){ cout << 'A'; return; } ch = a[i]; i++; continue; } if(ch == 'b'){ if(j == sb){ cout << 'B'; return; } ch = b[j]; j++; continue; } if(ch == 'c'){ if(k == sc){ cout << 'C'; return; } ch = c[k]; k++; continue; } } } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s649346858
p03998
C++
#include <bits/stdc++.h> #include <Windows.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ string a, b, c; cin >> a >> b >> c; int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0; char ch = a[0]; while(1){ if(ch == 'a'){ if(i == sa){ cout << 'A'; return; } ch = a[i]; i++; continue; } if(ch == 'b'){ if(j == sb){ cout << 'B'; return; } ch = b[j]; j++; continue; } if(ch == 'c'){ if(k == sc){ cout << 'C'; return; } ch = c[k]; k++; continue; } } } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
a.cc:2:10: fatal error: Windows.h: No such file or directory 2 | #include <Windows.h> | ^~~~~~~~~~~ compilation terminated.
s274450194
p03998
C++
#include <bits/stdc++.h> #include <Windows.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ string a, b, c; cin >> a >> b >> c; int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0; char ch = a[0]; while(1){ if(ch == 'a'){ if(i == sa){ cout << 'A'; return; } ch = a[i]; i++; continue; } if(ch == 'b'){ if(j == sb){ cout << 'B'; return; } ch = b[j]; j++; continue; } if(ch == 'c'){ if(k == sc){ cout << 'C'; return; } ch = c[k]; k++; continue; } } } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
a.cc:2:10: fatal error: Windows.h: No such file or directory 2 | #include <Windows.h> | ^~~~~~~~~~~ compilation terminated.
s536834854
p03998
C++
#include <bits/stdc++.h> #include <Windows.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ string a, b, c; cin >> a >> b >> c; int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0; char ch = a[0]; while(1){ if(ch == 'a'){ if(i == sa){ cout << 'A'; return; } ch = a[i]; i++; continue; } if(ch == 'b'){ if(j == sb){ cout << 'B'; return; } ch = b[j]; j++; continue; } if(ch == 'c'){ if(k == sc){ cout << 'C'; return; } ch = c[k]; k++; continue; } } } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
a.cc:2:10: fatal error: Windows.h: No such file or directory 2 | #include <Windows.h> | ^~~~~~~~~~~ compilation terminated.
s609523725
p03998
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-i); } return res;} int main() { string sa,sb,sc; cin>>sa>>sb>>sc; ll a=1; for(ll i=1; i>0; i++){ if(a=1){ if(sa.size()==0){ cout<<'A'<<endl; break;} if(sa.at(0)=='a'){ a=1;} else if(sa.at(0)=='b'){ a=2;} else a=3; sa=sa.substr(1,sa.size()-1);} if(a=2){ if(sb.size()==0){ cout<<'B'<<endl; break;} if(sb.at(0)=='a'){ a=1;} else if(sb.at(0)=='b'){ a=2;} else a=3; sb=sb.substr(1,sb.size()-1);} if(a=3){ if(sc.size()==0){ cout<<'C'<<endl; break;} if(sc.at(0)=='a'){ a=1;} else if(sc.at(0)=='b'){ a=2;} else a=3; sc=sc.substr(1,sc.size()-1);}}
a.cc: In function 'int main()': a.cc:56:31: error: expected '}' at end of input 56 | sc=sc.substr(1,sc.size()-1);}} | ^ a.cc:19:12: note: to match this '{' 19 | int main() { | ^
s235544690
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string[3] S; for (int i = 0; i < 3; ++i) cin >> S[i]; vector<vector<int>> cards(3); for (int i = 0; i < 3; ++i) { for (auto &c : S[i]) { int n = -1; if (c == 'a') n = 0; if (c == 'b') n = 1; if (c == 'c') n = 2; cards[i].emplace_back(n); } } for (int i = 0; i < 3; ++i) reverse(cards[i].begin(), cards[i].end()); int now = 0; while (1) { if (cards[now].empty()) break; int tmp = cards[now].back(); cards[now].pop_back(); now = tmp; } cout << now << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: expected identifier before numeric constant 5 | string[3] S; | ^ a.cc:5:10: error: expected ']' before numeric constant 5 | string[3] S; | ^ | ] a.cc:5:9: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'} 5 | string[3] S; | ^ a.cc:5:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:5:9: error: empty structured binding declaration a.cc:5:13: error: expected initializer before 'S' 5 | string[3] S; | ^ a.cc:6:38: error: 'S' was not declared in this scope 6 | for (int i = 0; i < 3; ++i) cin >> S[i]; | ^ a.cc:10:20: error: 'S' was not declared in this scope 10 | for (auto &c : S[i]) { | ^
s617698983
p03998
C++
#include<iostream> #include<vector> int main(){ std::vector<std::string> s(3); std::cin>>s[0]>>s[1]>>s[2]; int t = 0; std::vector<int> i(3); while(1){ if(s[t].size()==i[t]){ std::cout<< 'A'+t std::endl; break; } t = s[t][i[t]++]; } }
a.cc: In function 'int main()': a.cc:10:24: error: expected ';' before 'std' 10 | std::cout<< 'A'+t std::endl; | ^~~~ | ;
s675852259
p03998
C++
/* * atcoder/abc089/b.cpp */ // C++ 14 #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <cstring> // memset #include <cassert> using namespace std; #define ll long long #define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++) template <class T> ostream & operator << (ostream & out, vector<T> const & v) { for (auto &&a: v) out << a << " "; out << endl; return out; } template <class T> void dump(T &a) { cout << a << endl; } void solve(); int main() { solve(); return 0; } void solve() { vector<string> S(3); vector<int> A(3); vector<vector<int> > B(3); vector<int> I(3, 0); loop(i,0,3) cin >> S[i]; loop(i,0,3) A[i] = S[i].size(); loop(i,0,3) { for (auto&&c: S[i]) { B[i].push_back(c-'a'); } assert(B[i].size() == A[i]); } int cur = 0; while (I[0] < A[0] and I[1] < A[1] and I[2] < A[2]) { cur = B[I[cur]++]; } string C = "ABC"; loop(i,0,3) { if (I[i] == A[i]) { cout << C[i] << endl; return; } } cout << "D" << endl; }
a.cc: In function 'void solve()': a.cc:38:21: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment 38 | cur = B[I[cur]++]; | ^
s450629098
p03998
C++
#include <bits/stdc++.h> using namespace std; int main() { string a, b, c; cin >> a >> b>> c; string x=a; char ans='A'; while (1){ if (x.empty()){ cout << ans << endl; return 0; } x.erase(0,1); if (x.empty) continue; x=x.at(0); ans=char(x.at(0)-32); } }
a.cc: In function 'int main()': a.cc:15:20: error: cannot convert 'std::__cxx11::basic_string<char>::empty' from type 'bool (std::__cxx11::basic_string<char>::)() const noexcept' to type 'bool' 15 | if (x.empty) continue; | ^
s105091673
p03998
C++
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(long long)(n);i++) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const ll MOD=1e9+7; const ll INF=1e18; const int MAX=510000; const double pi=acos(-1); int dx[8] = {1,0,-1,0,1,1,-1,-1}; int dy[8] = {0,1,0,-1,-1,1,1,-1}; // int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ cin.tie(0); ios::sync_with_stdio(false); vector<string> s(3); vector<int>used(3); rep(i,3) cin >> s[i]; int now=0; while(true){ if(s[now].size() > used[now].size()){ used[now]++; now = s[now][used[now]-1]-'a'; } else{ cout << char('a'+now) << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:29:34: error: request for member 'size' in 'used.std::vector<int>::operator[](((std::vector<int>::size_type)now))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 29 | if(s[now].size() > used[now].size()){ | ^~~~
s353722905
p03998
C++
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(long long)(n);i++) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const ll MOD=1e9+7; const ll INF=1e18; const int MAX=510000; const double pi=acos(-1); int dx[8] = {1,0,-1,0,1,1,-1,-1}; int dy[8] = {0,1,0,-1,-1,1,1,-1}; // int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ cin.tie(0); ios::sync_with_stdio(false); vector<string> s(3),used(3); rep(i,3) cin >> s[i]; int now=0; while(true){ if(s[now].size() > used[now].size()){ used[now]++; now = s[now][used[now]-1]-'a'; } else{ cout << char('a'+now) << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:29:16: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 29 | used[now]++; a.cc:30:29: 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') 30 | now = s[now][used[now]-1]-'a'; 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:30:30: 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>' 30 | now = s[now][used[now]-1]-'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:30:30: 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>' 30 | now = s[now][used[now]-1]-'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:30:30: 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::complex<_Tp>' 30 | now = s[now][used[now]-1]-'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:30:30: 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::complex<_Tp>' 30 | now = s[now][used[now]-1]-'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:30:30: note: mismatched types 'const std::complex<_Tp>' and 'int' 30 | now = s[now][used[now]-1]-'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:30:30: 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::_Expr<_Dom1, typename _Dom1::value_type>' 30 | now = s[now][used[now]-1]-'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:30:30: 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::_Expr<_Dom1, typename _Dom1::value_type>' 30 | now = s[now][used[now]-1]-'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:30:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 30 | now = s[now][used[now]-1]-'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:30:30: 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::_Expr<_Dom1, typename _Dom1::value_type>' 30 | now = s[now][used[now]-1]-'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:30:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 30 | now = s[now][used[now]-1]-'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:30:30: 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::valarray<_Tp>' 30 | now = s[now][used[now]-1]-'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:30:30: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::_
s876640851
p03998
C++
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(long long)(n);i++) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const ll MOD=1e9+7; const ll INF=1e18; const int MAX=510000; const double pi=acos(-1); int dx[8] = {1,0,-1,0,1,1,-1,-1}; int dy[8] = {0,1,0,-1,-1,1,1,-1}; // int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ cin.tie(0); ios::sync_with_stdio(false); vector<string> s(3),used(3); rep(i,3) cin >> s[i] int now=0; while(true){ if(s[now].size() > used[now].size()){ used[now]++; now = s[now][used[now]-1]-'a'; } else{ cout << char('a'+now) << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:25:23: error: expected ';' before 'int' 25 | rep(i,3) cin >> s[i] | ^ | ; 26 | int now=0; | ~~~ a.cc:28:10: error: 'now' was not declared in this scope; did you mean 'pow'? 28 | if(s[now].size() > used[now].size()){ | ^~~ | pow
s685951100
p03998
Java
import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); String popped = A.remove(0); while (true) { if (popped.equals("a")) { if (A.size() == 0) { System.out.println("A"); break; } popped = A.remove(0); } else if (popped.equals("b")) { if (B.size() == 0) { System.out.println("B"); break; } popped = B.remove(0); } else if (popped.equals("c")) { if (C.size() == 0) { System.out.println("C"); break; } popped = C.remove(0); } } } }
Main.java:8: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:9: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:10: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main 3 errors
s990424578
p03998
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); String popped = A.remove(0); while (true) { if (popped.equals("a")) { if (A.size() == 0) { System.out.println("A"); break; } popped = A.remove(0); } else if (popped.equals("b")) { if (B.size() == 0) { System.out.println("B"); break; } popped = B.remove(0); } else if (popped.equals("c")) { if (C.size() == 0) { System.out.println("C"); break; } popped = C.remove(0); } } } }
Main.java:7: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:8: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:8: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:8: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:9: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:9: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:9: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main 9 errors
s703081519
p03998
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); String popped = A.remove(0); while (true) { if (popped.equals("a")) { if (A.size() == 0) { System.out.println("A"); break; } popped = A.remove(0); } else if (popped.equals("b")) { if (B.size() == 0) { System.out.println("B"); break; } popped = B.remove(0); } else if (popped.equals("c")) { if (C.size() == 0) { System.out.println("C"); break; } popped = C.remove(0); } } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:6: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:6: error: cannot find symbol ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:7: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main Main.java:8: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:8: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: class ArrayList location: class Main Main.java:8: error: cannot find symbol ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split(""))); ^ symbol: variable Arrays location: class Main 11 errors
s257877648
p03998
C++
#include<iostream> #include<string> 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; return 0; } else if(t=='b'&&b.empty()){ cout<<"B"<<endl; return 0; } else if(t=="C"&&c.empty()){ cout<<"C"<<endl; return 0; } if(t=='a'){ t=a[0]; a.erase(a.begin()); } else if(t=='b'){ t=b[0]; b.erase(b.begin()); } else if(t=='c'){ t=c[0]; c.erase(c.begin()); } } return 0; }
a.cc: In function 'int main()': a.cc:18:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | else if(t=="C"&&c.empty()){ | ~^~~~~
s330544731
p03998
C++
#include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<stack> #include<iomanip> #include<sstream> #define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); using namespace std; #define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); } void err(istream_iterator<string> it) { cout << '\n';} template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cout << '[' << *it << " = " << a << "] "; err(++it, args...); } #define fcout cout<<fixed<<setprecision(15) #define repp(i,j,k) for(int i=j; i<k; ++i) #define rep(i,j) repp(i,0,j) #define rrep(i,j,k) for(int i=j; i>=k; --i) #define all(x) (x).begin(), (x).end() #define sort(x) sort(x.begin(), x.end()) #define lb(x,val) lower_bound(x.begin(), x.end(), val) #define ub(x,val) upper_bound(x.begin(), x.end(), val) #define pb(x) emplace_back(x); typedef long long int lli; typedef pair<int,int> pii; typedef pair<lli,lli> pll; typedef vector<int> vi; typedef vector<lli> vl; typedef tuple<lli, lli> tii; typedef tuple<lli, lli, lli> tiii; //const lli M=998244353ll; const lli M=1000000007ll; const double D=1.0; void solve(){ string sa,sb,sc; cin>>sa>>sb>>sc; int ca=0,cb=0,cc=0; int t=0; while(1){ if(0){ t=sa[ca++]-'a'; if(ca==sa.size()){ cout<<"A"; break; } }else if(1){ t=sb[cb++]-'a'; if(cb==sb.size()){ cout<<"B"; break; } }else{ t=sc[cc++]-'a'; if(cc=sc.size()){ cout<<"C" break; } } } } int main(){ fast_io int tc=1; //cin>>tc; while(tc--){solve();} return 0; }
a.cc:18:6: error: variable or field 'err' declared void 18 | void err(istream_iterator<string> it) { cout << '\n';} | ^~~ a.cc:18:10: error: 'istream_iterator' was not declared in this scope 18 | void err(istream_iterator<string> it) { cout << '\n';} | ^~~~~~~~~~~~~~~~ a.cc:11:1: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>' 10 | #include<iomanip> +++ |+#include <iterator> 11 | #include<sstream> a.cc:18:33: error: expected primary-expression before '>' token 18 | void err(istream_iterator<string> it) { cout << '\n';} | ^ a.cc:18:35: error: 'it' was not declared in this scope; did you mean 'int'? 18 | void err(istream_iterator<string> it) { cout << '\n';} | ^~ | int a.cc:20:6: error: variable or field 'err' declared void 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^~~ a.cc:20:10: error: 'istream_iterator' was not declared in this scope 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^~~~~~~~~~~~~~~~ a.cc:20:10: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>' a.cc:20:33: error: expected primary-expression before '>' token 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^ a.cc:20:35: error: 'it' was not declared in this scope; did you mean 'int'? 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^~ | int a.cc:20:41: error: expected primary-expression before 'a' 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^ a.cc:20:48: error: expected primary-expression before '...' token 20 | void err(istream_iterator<string> it, T a, Args... args) { | ^~~ a.cc: In function 'void solve()': a.cc:68:42: error: expected ';' before 'break' 68 | cout<<"C" | ^ | ; 69 | break; | ~~~~~
s119399322
p03998
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i,n) for (int i=0;i < (n); ++i) #define ALL(x) (x).begin(), (x).end() using namespace std; using ll = long long; int main() { string a,b,c; cin >> a >> b >> c; char trun = 'a'; while(true){ if(trun=='a'){ turn = a[0]; a.erase(a.begin()); } if(trun=='b'){ turn = b[0]; b.erase(b.begin()); } if(trun=='c'){ turn = c[0]; c.erase(c.begin()); } if(a.empty()) { cout << 'A' << endl; return 0; } if(b.empty()) { cout << 'B' << endl; return 0; } if(c.empty()) { cout << 'C' << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:14:13: error: 'turn' was not declared in this scope; did you mean 'trun'? 14 | turn = a[0]; | ^~~~ | trun a.cc:18:13: error: 'turn' was not declared in this scope; did you mean 'trun'? 18 | turn = b[0]; | ^~~~ | trun a.cc:22:13: error: 'turn' was not declared in this scope; did you mean 'trun'? 22 | turn = c[0]; | ^~~~ | trun
s891738826
p03998
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i,n) for (int i=0;i < (n); ++i) #define ALL(x) (x).begin(), (x).end() using namespace std; using ll = long long; int main() { string a,b,c; cin >> a >> b >> c; char turn = 'a'; while(true){ if(trun=='a'){ turn = a[0]; a.erase(a.begin()); } if(trun=='b'){ turn = b[0]; b.erase(b.begin()); } if(trun=='c'){ turn = c[0]; c.erase(c.begin()); } if(a.empty()) { cout << 'A' << endl; return 0; } if(b.empty()) { cout << 'B' << endl; return 0; } if(c.empty()) { cout << 'C' << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:13:12: error: 'trun' was not declared in this scope; did you mean 'turn'? 13 | if(trun=='a'){ | ^~~~ | turn a.cc:17:12: error: 'trun' was not declared in this scope; did you mean 'turn'? 17 | if(trun=='b'){ | ^~~~ | turn a.cc:21:12: error: 'trun' was not declared in this scope; did you mean 'turn'? 21 | if(trun=='c'){ | ^~~~ | turn
s855425308
p03998
Java
import java.util.Scanner; public class Practice { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String c = sc.next(); StringBuilder aa = new StringBuilder(a); StringBuilder bb = new StringBuilder(b); StringBuilder cc = new StringBuilder(c); char x = aa.charAt(0); String ans = ""; while (true) { if (x == 'a') { if (aa.length() == 0) { ans = "A"; break; } else { x = aa.charAt(0); aa.delete(0,1); } } if(x == 'b') { if (bb.length() == 0) { ans = "B"; break; } else { x = bb.charAt(0); bb.delete(0,1); } } if(x == 'c') { if (cc.length() == 0) { ans = "C"; break; } else { x = cc.charAt(0); cc.delete(0,1); } } } System.out.println(ans); } }
Main.java:3: error: class Practice is public, should be declared in a file named Practice.java public class Practice { ^ 1 error
s430038520
p03998
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ string A, B, C; cin >> A >> B >> C; int ca = 1, cb = 1, cc = 1; char ans = 'a'; while(ca < A.size() && cb < B.size() && cc < C.size()){ if(ans == 'a'){ ans = A[ca]; ca++; }else if(ans == 'b'){ ans = B[cb]; cb++; }else{ ans = C[cc]; cc++; } } if(ca == A.size()){ans = 'a';} else if(cb == B.size()){ans = 'b';} else{ans = 'c'} cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:19: error: expected ';' before '}' token 24 | else{ans = 'c'} | ^ | ;
s616996526
p03998
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ string A, B, C; cin >> A >> B >> C; int ca = 1, cb = 1, cc = 1; char ans = a; while(ca < A.size() && cb < B.size() && cc < C.size()){ if(ans == 'a'){ ans = A[ca]; ca++; }else if(ans == 'b'){ ans = B[cb]; cb++; }else{ ans = C[cc]; cc++; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:14: error: 'a' was not declared in this scope 9 | char ans = a; | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s628027800
p03998
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ string A, B, C; cin >> A >> B >> C; int ca = 1, cb = 1, cc = 1; char ans = a; while(ca < A.size() && cb < B.size() && cc < C.size()){ if(ans == a){ ans = A[ca]; ca++; }else if(ans == b){ ans = B[cb]; cb++; }else{ ans = C[cc]; cc++; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:14: error: 'a' was not declared in this scope 9 | char ans = a; | ^ a.cc:14:19: error: 'b' was not declared in this scope 14 | }else if(ans == b){ | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s983823864
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; string X=a; for(int i=0; i<a.length()+b.length()+c.length();i++){ if (X.at(0)=='a'){ if(X.length()==0){ cout << X << endl; return; } else{ X.substr(0); X=a; } } else if(X.at(0)=='b'){ if(X.length()==0){ cout << X << endl; } else { X.substr(0); X=b; } } else if (X.at(0)=='c'){ if(X.length()==0){ cout << X << endl; } else { X.substr(0); X=c; } } } }
a.cc: In function 'int main()': a.cc:12:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 12 | return; | ^~~~~~ a.cc:15:17: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 15 | X.substr(0); | ~~~~~~~~^~~ 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:7: note: declared here 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ^~~~~~ a.cc:24:17: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 24 | X.substr(0); | ~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:3208:7: note: declared here 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ^~~~~~ a.cc:33:17: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 33 | X.substr(0); | ~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:3208:7: note: declared here 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ^~~~~~
s882052111
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; string X=a; for(int i=0; i<a.length()+b.length()+c.length();i++){ if (X.at(0)=='a'){ if(X.length()==0){ cout << X << endl; return; } else{ substr(0); X=a; } } else if(X.at(0)=='b'){ if(X.length()==0){ cout << X << endl; } else { substr(0); X=b; } } else if (X.at(0)=='c'){ if(X.length()==0){ cout << X << endl; } else { substr(0); X=c; } } } }
a.cc: In function 'int main()': a.cc:12:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 12 | return; | ^~~~~~ a.cc:15:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 15 | substr(0); | ^~~~~~ | strstr a.cc:24:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 24 | substr(0); | ^~~~~~ | strstr a.cc:33:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 33 | substr(0); | ^~~~~~ | strstr
s504908578
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; string X=a; for(int i=0; i<a.length()+b.length()+c.length();i++){ if (X.at(0)=='a'){ if(X.length()==0){ cout << X << endl; return; } else{ substr(1,X.length()-1); X=a; } } else if(X.at(0)=='b'){ if(X.length()==0){ cout << X << endl; } else { substr(1,X.length()-1); X=b; } } else if (X.at(0)=='c'){ if(X.length()==0){ cout << X << endl; } else { substr(1, X.length()-1); X=c; } } } }
a.cc: In function 'int main()': a.cc:12:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 12 | return; | ^~~~~~ a.cc:15:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 15 | substr(1,X.length()-1); | ^~~~~~ | strstr a.cc:24:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 24 | substr(1,X.length()-1); | ^~~~~~ | strstr a.cc:33:9: error: 'substr' was not declared in this scope; did you mean 'strstr'? 33 | substr(1, X.length()-1); | ^~~~~~ | strstr
s309883542
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a, b, c; cin >> a >> b >> c; string X=a; for(int i=0; i<a.length()+b.length()+c.length();i++){ if (X.at(0)=='a'){ substr(1,X.length()-1); X=a; } else if(X.at(0)=='b'){ substr(1,X.length()-1); X=b; } else if (X.at(0)=='c'){ substr(1, X.length()-1); X=c; } } }
a.cc: In function 'int main()': a.cc:10:7: error: 'substr' was not declared in this scope; did you mean 'strstr'? 10 | substr(1,X.length()-1); | ^~~~~~ | strstr a.cc:14:7: error: 'substr' was not declared in this scope; did you mean 'strstr'? 14 | substr(1,X.length()-1); | ^~~~~~ | strstr a.cc:18:7: error: 'substr' was not declared in this scope; did you mean 'strstr'? 18 | substr(1, X.length()-1); | ^~~~~~ | strstr
s832218839
p03998
C++
//#pragma GCC optimize(\"Ofast,no-stack-protector\") //#pragma GCC target(\"sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx\") //#pragma GCC target(\"avx,tune=native\") // Neil #include<bits/stdc++.h> using namespace std; typedef complex<double> base; typedef long double ld; typedef long long ll; #define endl "\n" #define pb push_back #define pii pair<int,int> #define pll pair< ll , ll > #define vi vector<int> #define vvi vector< vi > const int MAXN=(int)(2e5+5); const ll MOD=(ll)(1e9+7); int t; int func(string s, int pos){ if(s[pos] == 'a') return 1; else if(s[pos]=='b') return 2; else if(s[pos]=='c) return 3; return 0; } int main() { ios_base::sync_with_stdio(0);cin.tie(0); string s1,s2, s3; cin>>s1>>s2>>s3; int i=0,j=0,k=0; int turn = 1; while(true){ if(turn == 1){ turn = func(s1, i++); } else if(turn ==2){ turn = func(s2, j++); } else if(turn == 3){ turn = func(s3, k++); } else break; } if(i==s1.size()) cout<<"A"<<endl; else if(j==s2.size()) cout<<"B"<<endl; else cout<<"C"<<endl; return 0; }
a.cc:28:25: warning: missing terminating ' character 28 | else if(s[pos]=='c) | ^ a.cc:28:25: error: missing terminating ' character 28 | else if(s[pos]=='c) | ^~~ a.cc: In function 'int func(std::string, int)': a.cc:29:7: error: expected primary-expression before 'return' 29 | return 3; | ^~~~~~ a.cc:30:6: error: expected primary-expression before 'return' 30 | return 0; | ^~~~~~ a.cc:29:16: error: expected ')' before 'return' 29 | return 3; | ^ | ) 30 | return 0; | ~~~~~~ a.cc:28:16: note: to match this '(' 28 | else if(s[pos]=='c) | ^ a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type] 31 | } | ^
s248107710
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string A,B,C; cin >> A >> B >> C; bool run = true; string turn = "A"; while(run){ if (turn == "A"){ if (A.size() == 0){ run = false; } else{ turn = A[0]; A.erase(A.begin()); } } else if(turn == "B"){ if(B.size() ==0){ run = false; } else{ turn = B[0]; B.erase(B.begin()); } } else{ if(C.size() == 0){ run = false; } else{ turn = C[0]; C.erase(C.begin()); } } } if(turn == "a"){ turn = "A"; }else if(turn == "b"){ turn = "B"; }else{ turn = "C" } cout << turn << endl; }
a.cc: In function 'int main()': a.cc:44:19: error: expected ';' before '}' token 44 | turn = "C" | ^ | ; 45 | } | ~
s730013336
p03998
C++
#include <bits/stdc++.h> using namespace std; int main(){ string A,B,C; cin >> A >> B >> C; bool run = true; string turn = "A"; while(run){ if (turn == "A"){ if (A.size() == 0){ run = false; } else{ turn = A[0]; A.erase(A.begin()); } } else if(turn == "B"){ if(B.size() ==0){ run = false; } else{ turn = B[0]; B.erase(B.begin()); } } else{ if(C.size() == 0){ run = false; } else{ turn = C[0]; C.erase(C.begin()); } } } cout << transform(turn.begin(), turn.end(), turn.begin(), toupper) << endl; }
a.cc: In function 'int main()': a.cc:39:20: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)' 39 | cout << transform(turn.begin(), turn.end(), turn.begin(), toupper) << endl; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)' 4209 | transform(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4209:5: note: template argument deduction/substitution failed: a.cc:39:20: note: couldn't deduce template parameter '_UnaryOperation' 39 | cout << transform(turn.begin(), turn.end(), turn.begin(), toupper) << endl; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)' 4247 | transform(_InputIterator1 __first1, _InputIterator1 __last1, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate expects 5 arguments, 4 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)' 156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result, | ^~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate expects 5 arguments, 4 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)' 162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, | ^~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate expects 6 arguments, 4 provided
s048570403
p03998
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; #define MODSIZE 1000000007 int main(){ int na; int nb; int nc; int sp[3]; sp[0] = sp[1] = sp[2] = 0; char s[3][105]; scanf("%s %s %s", s[0], s[1], s[2]); na = strlen(s[0]); nb = strlen(s[1]); nc = strlen(s[2]); char t; t = 'a'; while(1){ sp[t - 'a']++; t = s[t - 'a'][sp[t - 'a']]; if(sp[t - 'a'] == na - 1 || sp[t - 'a'] == nb - 1 || sp[t - 'a'] == nc - 1) break; } if(sp[2] == nc - 1) printf("C\n"); else if(sp[1] == nb - 1) printf("B\n"); else printf("A\n"); return 0;
a.cc: In function 'int main()': a.cc:38:12: error: expected '}' at end of input 38 | return 0; | ^ a.cc:7:11: note: to match this '{' 7 | int main(){ | ^
s873068727
p03998
C++
from sys import exit sa = input() sb = input() sc = input() turn = 'a' while True: if turn == 'a': if len(sa) == 0: print('A') exit() else: turn = sa[0] sa = sa[1:] if turn == 'b': if len(sb) == 0: print('B') exit() else: turn = sb[0] sb = sb[1:] if turn == 'c': if len(sc) == 0: print('C') exit() else: turn = sc[0] sc = sc[1:]
a.cc:1:1: error: 'from' does not name a type 1 | from sys import exit | ^~~~
s314524486
p03998
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String c = sc.next(); StringBuilder aa = new StringBuilder(a); StringBuilder bb = new StringBuilder(b); StringBuilder cc = new StringBuilder(c); char x = aa.charAt(0); String ans = ""; while (true) { if (x == 'a') { if (aa.length() == 0) { ans = "A"; break; } else { x = aa.charAt(0); aa.delete(0,1); } } if(x == 'b') { if (bb.length() == 0) { ans = "B"; break; } else { x = bb.charAt(0); bb.delete(0,1); } } if(x == 'c') { if (cc.length() == 0) { ans = "C"; break; } else { x = cc.charAt(0); cc.delete(0,1); } } } System.out.println(ans); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s165661348
p03998
Java
ss
Main.java:1: error: reached end of file while parsing ss ^ 1 error
s106064364
p03998
C++
#include <iostream> #include <string> using namespace std; int main() { string a, b, c; bool flag; int a_length, b_length, c_length = 0; int turn = 0; cin >> a >> b >> c; flag = false; while (flag) { if (turn == 0) { a_length++; if (a_length == a.length()) flag = true; if (a[a_length - 1] == "a") turn = 0; else if (a[a_length - 1] == "b") turn = 1; else turn = 2; } else if (turn == 1) { b_length++; if (b_length == b.length()) flag = true; if (b[b_length - 1] == "a") turn = 0; else if (b[b_length - 1] == "b") turn = 1; else turn = 2; } else if (turn == 2) { c_length++; if (c_length == c.length()) flag = true; if (c[c_length - 1] == "a") turn = 0; else if (c[c_length - 1] == "b") turn = 1; else turn = 2; } } if (a_length == a.length()) cout << 'A' << endl; else if (b_length == b.length()) cout << 'B' << endl; eles cout << 'C' << endl; }
a.cc: In function 'int main()': a.cc:22:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if (a[a_length - 1] == "a") turn = 0; a.cc:23:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 23 | else if (a[a_length - 1] == "b") turn = 1; a.cc:32:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 32 | if (b[b_length - 1] == "a") turn = 0; a.cc:33:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 33 | else if (b[b_length - 1] == "b") turn = 1; a.cc:42:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 42 | if (c[c_length - 1] == "a") turn = 0; a.cc:43:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 43 | else if (c[c_length - 1] == "b") turn = 1; a.cc:50:3: error: 'eles' was not declared in this scope 50 | eles cout << 'C' << endl; | ^~~~
s671768992
p03998
C++
#include <iostream> #include <string> using namespace std; char select(char a){ if(a=='a'){ return 'A'; } else if(a=='b'){ return 'B'; } else if(a=='c'){ return 'C'; } } int main(){ string a,b,c; getline(cin,a); getline(cin,b); getline(cin,c); char flag='A',turn='A'; while(true){ if(flag=='A'){ if(a.empty()){ turn='A' break; } flag=a.front(); a.erase(a.begin()); flag=select(flag); } if(flag=='B'){ if(b.empty()){ turn='B' break; } flag=b.front(); b.erase(b.begin()); flag=select(flag); } if(flag=='C'){ if(c.empty()){ turn='C' break; } flag=c.front(); c.erase(c.begin()); flag=select(flag); } } cout<<turn<<endl; }
a.cc: In function 'int main()': a.cc:26:17: error: expected ';' before 'break' 26 | turn='A' | ^ | ; 27 | break; | ~~~~~ a.cc:35:17: error: expected ';' before 'break' 35 | turn='B' | ^ | ; 36 | break; | ~~~~~ a.cc:44:17: error: expected ';' before 'break' 44 | turn='C' | ^ | ; 45 | break; | ~~~~~ a.cc: In function 'char select(char)': a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type] 15 | } | ^
s031976192
p03998
C++
#include <iostream> #include <string> using namespace std; char select(char a){ if(a=='a'){ return 'A'; } else if(a=='b'){ return 'B'; } else if(a=='c'){ return 'C'; } } int main(){ string a,b,c; getline(cin,a); getline(cin,b); getline(cin,c); char flag='A',turn='A'; while(!a.empty() and !b.empty() and !c.empty()){ turn=flag if(flag=='A'){ flag=a.front(); a.erase(a.begin()); flag=select(flag); } if(flag=='B'){ flag=b.front(); b.erase(b.begin()); flag=select(flag); } if(flag=='C'){ flag=c.front(); c.erase(c.begin()); flag=select(flag); } } cout<<turn<<endl; }
a.cc: In function 'int main()': a.cc:24:14: error: expected ';' before 'if' 24 | turn=flag | ^ | ; 25 | if(flag=='A'){ | ~~ a.cc: In function 'char select(char)': a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type] 15 | } | ^
s935615937
p03998
C++
#include <iostream> #include <string> using namespace std; char select(char a){ if(a=='a'){ return 'A' } else if(a=='b'){ return 'B' } else if(a=='c'){ return 'C' } } int main(){ string a,b,c; getline(cin,a); getline(cin,b); getline(cin,c); char flag='A'; while(true){ if(flag=='A'){ flag=a.front(); a.erase(a.begin(),a.begin()); flag=select(flag); } if(flag=='B'){ flag=b.front(); b.erase(b.begin(),b.begin()); flag=select(flag); } if(flag=='C'){ flag=c.front(); c.erase(c.begin(),c.begin()); flag=select(flag); } if(a.empty() or b.empty() or c.empty()){ break; } } cout<<flag<<endl; }
a.cc: In function 'char select(char)': a.cc:7:15: error: expected ';' before '}' token 7 | return 'A' | ^ | ; 8 | } | ~ a.cc:10:15: error: expected ';' before '}' token 10 | return 'B' | ^ | ; 11 | } | ~ a.cc:13:15: error: expected ';' before '}' token 13 | return 'C' | ^ | ; 14 | } | ~ a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type] 15 | } | ^
s174862013
p03998
C++
#include <iostream> #include <string> using namespace std; char select(char a){ if(a=='a'){ return 'A' } else if(a=='b'){ return 'B' } else if(a=='c'){ return 'C' } } int main(){ string a,b,c; getline(cin,a); getline(cin,b); getline(cin,c); char flag='A'; while(true){ if(flag=='A'){ flag=a.front(); a.erase(a.begin(),a.begin()); flag=select(s); } if(flag=='B'){ flag=b.front(); b.erase(b.begin(),b.begin()); flag=select(s); } if(flag=='C'){ flag=c.front(); c.erase(c.begin(),c.begin()); flag=select(s); } if(a.empty() or b.empty() or c.empty()){ break; } } cout<<flag<<endl; }
a.cc: In function 'char select(char)': a.cc:7:15: error: expected ';' before '}' token 7 | return 'A' | ^ | ; 8 | } | ~ a.cc:10:15: error: expected ';' before '}' token 10 | return 'B' | ^ | ; 11 | } | ~ a.cc:13:15: error: expected ';' before '}' token 13 | return 'C' | ^ | ; 14 | } | ~ a.cc: In function 'int main()': a.cc:26:19: error: 's' was not declared in this scope 26 | flag=select(s); | ^ a.cc:31:19: error: 's' was not declared in this scope 31 | flag=select(s); | ^ a.cc:36:19: error: 's' was not declared in this scope 36 | flag=select(s); | ^ a.cc: In function 'char select(char)': a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type] 15 | } | ^
s235526269
p03998
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; void ABC40(void); void ABC41(void); void ABC42(void); void ABC43(void); void ABC44(void); void ABC45(void); void ABC46(void); void ABC47(void); void ABC48(void); void ABC49(void); int main(void){ ABC45(); } void ABC45(){ int a,b,c; char ch='a',ans; string sa,sb,sc; cin>>sa>>sb>>sc; a=sa.length(); asize=sa.length(); b=sb.length(); bsize=sb.length(); c=sc.length(); csize=sc.length(); while(1){ if(ch=='a'){ ch=sa[asize-a]; a--; if(a==0){ ans='A'; break; } } if(ch=='b'){ ch=sb[bsize-b]; b--; if(b==0){ ans='B'; break; } } if(ch=='c'){ ch=sc[csize-c]; c--; if(c==0){ ans='C'; break; } } } cout<<ans<<endl; }
a.cc: In function 'void ABC45()': a.cc:25:5: error: 'asize' was not declared in this scope; did you mean 'dysize'? 25 | asize=sa.length(); | ^~~~~ | dysize a.cc:27:5: error: 'bsize' was not declared in this scope; did you mean 'dysize'? 27 | bsize=sb.length(); | ^~~~~ | dysize a.cc:29:5: error: 'csize' was not declared in this scope; did you mean 'dysize'? 29 | csize=sc.length(); | ^~~~~ | dysize