submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s044193237 | p00311 | C++ | 0 20
10 0
1 1 10 0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0 20
| ^
|
s686362048 | p00311 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int h1, h2, k1, k2, a, b, c, d, p1, p2;
cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;
p1 = h1 * a + h2 *b + (h1 / 10) * c + (h2 / 10) * d;
p2 = k1 * a + k2 *b + (k1 / 10) * c + (k2 / 10) * d;
if(p1 > p2){
cout << "hiroshi";
}else if(p1 < p2){
cout << "kenjiro";
}else cout "even";
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before string constant
16 | }else cout "even";
| ^~~~~~~
| ;
|
s159094770 | p00311 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int x1,x2,y1,y2;
cout<<x1<<x2<<y1<<y2;
cout<<a<<b<<c<<d;
int x=x1*a+x1/10*c+x2*b+x2/20*d;
int y=y1*a+y1/10*c+y2*b+y2/20*d;
if(x<y) cout<<k"enjiro"<<endl;
else if(x>y) cout<<"hiroshi"<<endl;
else cout<<"even"<<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cout' was not declared in this scope
6 | cout<<x1<<x2<<y1<<y2;
| ^~~~
a.cc:7:11: error: 'a' was not declared in this scope
7 | cout<<a<<b<<c<<d;
| ^
a.cc:7:14: error: 'b' was not declared in this scope
7 | cout<<a<<b<<c<<d;
| ^
a.cc:7:17: error: 'c' was not declared in this scope
7 | cout<<a<<b<<c<<d;
| ^
a.cc:7:20: error: 'd' was not declared in this scope
7 | cout<<a<<b<<c<<d;
| ^
a.cc:10:19: error: 'k' was not declared in this scope
10 | if(x<y) cout<<k"enjiro"<<endl;
| ^
a.cc:11:39: error: 'endl' was not declared in this scope
11 | else if(x>y) cout<<"hiroshi"<<endl;
| ^~~~
a.cc:12:28: error: 'endl' was not declared in this scope
12 | else cout<<"even"<<endl;
| ^~~~
|
s244793383 | p00311 | C++ | int main(){
int h1, h2, k1, k2;
int a, b, c, d;
int p1, p2;
cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >>d;
p1 = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 10) * d;
p2 = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 10) * d;
if(p1 > p2){
cout << "hiroshi";
}else if(p1 < p2){
cout << "kenziro";
}else cout << "even";
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >>d;
| ^~~
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout << "hiroshi";
| ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << "kenziro";
| ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
15 | }else cout << "even";
| ^~~~
a.cc:16:3: error: 'cout' was not declared in this scope
16 | cout << endl;
| ^~~~
a.cc:16:11: error: 'endl' was not declared in this scope
16 | cout << endl;
| ^~~~
|
s661760763 | p00311 | C++ | int main(){
int h1, h2, k1, k2;
int a, b, c, d;
int p1, p2;
cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >>d;
p1 = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 10) * d;
p2 = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 10) * d;
if(p1 > p2){
cout << "hiroshi";
}else if(p1 < p2){
cout << "kenjiro";
}else cout << "even";
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >>d;
| ^~~
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout << "hiroshi";
| ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << "kenjiro";
| ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
15 | }else cout << "even";
| ^~~~
a.cc:16:3: error: 'cout' was not declared in this scope
16 | cout << endl;
| ^~~~
a.cc:16:11: error: 'endl' was not declared in this scope
16 | cout << endl;
| ^~~~
|
s292289340 | p00311 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int x1,x2,y1,y2;
cin<<x1<<x2;
cin<<y1<<y2;
cin<<a<<b<<c<<d;
int x=x1*a+x1/10*c+x2*b+x2/20*d;
int y=y1*a+y1/10*c+y2*b+y2/20*d;
if(x<y) cout<<k"enjiro"<<endl;
else if(x>y) cout<<"hiroshi"<<endl;
else cout<<"even"<<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin<<x1<<x2;
| ^~~
a.cc:8:10: error: 'a' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:13: error: 'b' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:16: error: 'c' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:19: error: 'd' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:11:13: error: 'cout' was not declared in this scope
11 | if(x<y) cout<<k"enjiro"<<endl;
| ^~~~
a.cc:11:19: error: 'k' was not declared in this scope
11 | if(x<y) cout<<k"enjiro"<<endl;
| ^
a.cc:12:22: error: 'cout' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi"<<endl;
| ^~~~
a.cc:12:39: error: 'endl' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi"<<endl;
| ^~~~
a.cc:13:14: error: 'cout' was not declared in this scope
13 | else cout<<"even"<<endl;
| ^~~~
a.cc:13:28: error: 'endl' was not declared in this scope
13 | else cout<<"even"<<endl;
| ^~~~
|
s507585705 | p00311 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int x1,x2,y1,y2;
cin<<x1<<x2;
cin<<y1<<y2;
cin<<a<<b<<c<<d;
int x=x1*a+x1/10*c+x2*b+x2/20*d;
int y=y1*a+y1/10*c+y2*b+y2/20*d;
if(x<y) cout<<"kenjiro"<<endl;
else if(x>y) cout<<"hiroshi"<<endl;
else cout<<"even"<<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin<<x1<<x2;
| ^~~
a.cc:8:10: error: 'a' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:13: error: 'b' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:16: error: 'c' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:19: error: 'd' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:11:13: error: 'cout' was not declared in this scope
11 | if(x<y) cout<<"kenjiro"<<endl;
| ^~~~
a.cc:11:30: error: 'endl' was not declared in this scope
11 | if(x<y) cout<<"kenjiro"<<endl;
| ^~~~
a.cc:12:22: error: 'cout' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi"<<endl;
| ^~~~
a.cc:12:39: error: 'endl' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi"<<endl;
| ^~~~
a.cc:13:14: error: 'cout' was not declared in this scope
13 | else cout<<"even"<<endl;
| ^~~~
a.cc:13:28: error: 'endl' was not declared in this scope
13 | else cout<<"even"<<endl;
| ^~~~
|
s302147970 | p00311 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int h1,h2,k1,k2;
cin<<h1<<h2;
cin<<k1<<k2;
cin<<a<<b<<c<<d;
int x=h1*a+h1/10*c+h2*b+h2/20*d;
int y=k1*a+k1/10*c+k2*b+k2/20*d;
if(x<y) cout<<"kenjiro";
else if(x>y) cout<<"hiroshi";
else cout<<"even";
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin<<h1<<h2;
| ^~~
a.cc:8:10: error: 'a' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:13: error: 'b' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:16: error: 'c' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:8:19: error: 'd' was not declared in this scope
8 | cin<<a<<b<<c<<d;
| ^
a.cc:11:13: error: 'cout' was not declared in this scope
11 | if(x<y) cout<<"kenjiro";
| ^~~~
a.cc:12:22: error: 'cout' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi";
| ^~~~
a.cc:13:14: error: 'cout' was not declared in this scope
13 | else cout<<"even";
| ^~~~
|
s775731273 | p00311 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int h1,h2,k1,k2;
cin>>h1>>h2;
cin>>k1>>k2;
cin>>a>>b>>c>>d;
int x=h1*a+h1/10*c+h2*b+h2/20*d;
int y=k1*a+k1/10*c+k2*b+k2/20*d;
if(x<y) cout<<"kenjiro";
else if(x>y) cout<<"hiroshi";
else cout<<"even";
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin>>h1>>h2;
| ^~~
a.cc:8:10: error: 'a' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:13: error: 'b' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:16: error: 'c' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:19: error: 'd' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:11:13: error: 'cout' was not declared in this scope
11 | if(x<y) cout<<"kenjiro";
| ^~~~
a.cc:12:22: error: 'cout' was not declared in this scope
12 | else if(x>y) cout<<"hiroshi";
| ^~~~
a.cc:13:14: error: 'cout' was not declared in this scope
13 | else cout<<"even";
| ^~~~
|
s551416401 | p00311 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int h1,h2,k1,k2;
cin>>h1>>h2;
cin>>k1>>k2;
cin>>a>>b>>c>>d;
int x=h1*a+h1/10*c+h2*b+h2/20*d;
int y=k1*a+k1/10*c+k2*b+k2/20*d;
if(x<y) cout<<"kenjiro";
else if(x>y) cout<<"hiroshi";
else cout<<"even";
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: 'a' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:13: error: 'b' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:16: error: 'c' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
a.cc:8:19: error: 'd' was not declared in this scope
8 | cin>>a>>b>>c>>d;
| ^
|
s391040558 | p00311 | C++ | h1, h2 = gets.split.map(&:to_i)
k1, k2 = gets.split.map(&:to_i)
a, b, c, d, = gets.split.map(&:to_i)
f = -> i, y { a * i + b * y + c * (i / 10) + d * (y / 20) }
h = f[h1, h2]
k = f[k1, k2]
puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'even'
| a.cc:7:14: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
7 | puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'even'
| ^~~~~~~~~
a.cc:7:34: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
7 | puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'even'
| ^~~~~~~~~
a.cc:7:46: warning: multi-character character constant [-Wmultichar]
7 | puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'even'
| ^~~~~~
a.cc:1:1: error: 'h1' does not name a type
1 | h1, h2 = gets.split.map(&:to_i)
| ^~
a.cc:5:1: error: 'h' does not name a type
5 | h = f[h1, h2]
| ^
|
s029156504 | p00312 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int D = scan.nextInt();
int L = scan.nextInt();
int x;
int y;
x = D/L;
y = x/3;
System.out.println(x+y);
| Main.java:13: error: reached end of file while parsing
System.out.println(x+y);
^
1 error
|
s307693935 | p00312 | C | 1 #include <stdio.h>
2 int main(void){
3 int times,dist,len;
4
5 scanf("%d %d",&dist,&len);
6
7 times=(dist/len)+(dist%len);
8
9 printf("%d\n",times);
10
11 return 0;
12
13 } | main.c:1:2: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
|
s780547430 | p00312 | C | 1 #include <stdio.h>
2 int main(void){
3 int times,dist,len;
4
5 scanf("%d %d",&dist,&len);
6
7 times=(dist/len)+(dist%len);
8
9 printf("%d\n",times);
10
11 return 0;
12
13 } | main.c:1:2: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:4: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
|
s498706106 | p00312 | C | #include<stdio.h>;
int main(void){
int d l,h;
scanf("%d %d",&d,&l);
h=d/l+d%l;
printf("%d\n",h);
return 0;
} | main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>;
| ^
main.c: In function 'main':
main.c:4:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'l'
4 | int d l,h;
| ^
main.c:4:11: error: 'l' undeclared (first use in this function)
main.c:4:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:13: error: 'h' undeclared (first use in this function)
4 | int d l,h;
| ^
main.c:5:20: error: 'd' undeclared (first use in this function)
5 | scanf("%d %d",&d,&l);
| ^
|
s750344448 | p00312 | C | #include<stdio.h>
int main(void){
int d l,h;
scanf("%d %d",&d,&l);
h=d/l+d%l;
printf("%d\n",h);
return 0;
} | main.c: In function 'main':
main.c:4:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'l'
4 | int d l,h;
| ^
main.c:4:11: error: 'l' undeclared (first use in this function)
main.c:4:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:13: error: 'h' undeclared (first use in this function)
4 | int d l,h;
| ^
main.c:5:20: error: 'd' undeclared (first use in this function)
5 | scanf("%d %d",&d,&l);
| ^
|
s202663638 | p00312 | C | #include <stdio.h>
int main(void){
scanf("%d %d\n",&dist,&len);
times=(dist/len)+(dist%len);
return 0;
} | main.c: In function 'main':
main.c:3:22: error: 'dist' undeclared (first use in this function)
3 | scanf("%d %d\n",&dist,&len);
| ^~~~
main.c:3:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:28: error: 'len' undeclared (first use in this function)
3 | scanf("%d %d\n",&dist,&len);
| ^~~
main.c:4:5: error: 'times' undeclared (first use in this function)
4 | times=(dist/len)+(dist%len);
| ^~~~~
|
s601845637 | p00312 | C | #include <stdio.h>
2 int main(void)
3 {
4 int time,disit,len;
5 scanf("%d %d",&disit,&len);
6 time = len/disit + len%disit;
7 printf("%d\n",time);
8
9 return 0;
10 } | main.c:2:3: error: expected identifier or '(' before numeric constant
2 | 2 int main(void)
| ^
|
s005359316 | p00312 | C | #include <stdio.h>
int main(void){
int times,dist,len;
scanf("%d %d\n",&dist,&len);
times=(dist/len)+(dist%len);
printf("%d\n",&dist,&len)
return 0;
} | main.c: In function 'main':
main.c:6:30: error: expected ';' before 'return'
6 | printf("%d\n",&dist,&len)
| ^
| ;
7 | return 0;
| ~~~~~~
|
s318906763 | p00312 | C | #include <stdio.h>
int main(void){
int D,L,times;
times=0;
scanf("%d %d",&D,&L);
times=D/L;
times=times+D%L;
printf(""%d\n",times);
return 0;
} | main.c: In function 'main':
main.c:8:12: error: stray '\' in program
8 | printf(""%d\n",times);
| ^
main.c:8:11: error: 'd' undeclared (first use in this function)
8 | printf(""%d\n",times);
| ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:12: error: expected ')' before 'n'
8 | printf(""%d\n",times);
| ~ ^~
| )
main.c:8:14: warning: missing terminating " character
8 | printf(""%d\n",times);
| ^
main.c:8:14: error: missing terminating " character
8 | printf(""%d\n",times);
| ^~~~~~~~~
main.c:9:10: error: expected ';' before '}' token
9 | return 0;
| ^
| ;
10 |
11 | }
| ~
|
s306300001 | p00312 | C | #include <stdio.h>
int main(void){
int times,dist,len;
scanf("%d %d\n",&dist,&len);
times=(dist/len)+(dist%len);
printf("%d\n",times)
return 0;
} | main.c: In function 'main':
main.c:6:25: error: expected ';' before 'return'
6 | printf("%d\n",times)
| ^
| ;
7 | return 0;
| ~~~~~~
|
s685792015 | p00312 | C | #include <stdio.h>
2 int main (void)
3 {
4 int l,d,t;
5 scanf("%d%d",&d,&l);
6
7 t=d/l+d%l;
8 printf("%d\n",t);
9
10 return 0;
11 } | main.c:2:3: error: expected identifier or '(' before numeric constant
2 | 2 int main (void)
| ^
|
s503772165 | p00312 | C | #include <stdio.h>
int main(void){
int times,dist,len;
scanf("%d %d",&dist,%len);
times=dist/len;
times+=dist%len;
printf("%d\n",times);
return 0;
} | main.c: In function 'main':
main.c:5:25: error: expected expression before '%' token
5 | scanf("%d %d",&dist,%len);
| ^
|
s393120273 | p00312 | C | 1 #include <stdio.h>
2 int main(void){
3 int d, l;
4
5 scanf("%d %d",&d, &l);
6
7 int m = d / l;
8 int n = d % l;
9
10 int s = m + n;
11
12
13 printf("%d\n",s);
14
15
16 return 0;
17 }
18
~
~
~ | main.c:1:3: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:5: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
main.c:18:2: error: expected identifier or '(' before numeric constant
18 | 18
| ^~
|
s523064428 | p00312 | C | #include <stdio.h>
2 int main(void)
3 {
4 int time,disit,len;
5 scanf("%d %d",&disit,&len);
6 time = len/disit + len%disit;
7 printf("%d\n",time);
8
9 return 0;
10 }
~ | main.c:2:3: error: expected identifier or '(' before numeric constant
2 | 2 int main(void)
| ^
main.c:11:1: error: expected identifier or '(' before '~' token
11 | ~
| ^
|
s265938237 | p00312 | C | #include <stdio.h>
2 int main(void)
3 {
4 int time,disit,len;
5 scanf("%d %d",&disit,&len);
6 time = len/disit + len%disit;
7 printf("%d\n",time);
8
9 return 0;
10 }
~ | main.c:2:3: error: expected identifier or '(' before numeric constant
2 | 2 int main(void)
| ^
main.c:11:1: error: expected identifier or '(' before '~' token
11 | ~
| ^
|
s330432665 | p00312 | C | #include <stdio.h>
2 int main(void)
3 {
4 int time,disit,len;
5 scanf("%d %d",&disit,&len);
6 time = len/disit + len%disit;
7 printf("%d\n",time);
8
9 return 0;
10 }
~ | main.c:2:3: error: expected identifier or '(' before numeric constant
2 | 2 int main(void)
| ^
main.c:11:1: error: expected identifier or '(' before '~' token
11 | ~
| ^
|
s623244074 | p00312 | C | #incude <stdio.h>
int main(void){
int d, l;
scanf("%d %d",&d, &l);
int m = d / l;
int n = d % l;
int s = m + n;
printf("%d\n",s);
return 0;
} | main.c:1:2: error: invalid preprocessing directive #incude; did you mean #include?
1 | #incude <stdio.h>
| ^~~~~~
| include
main.c: In function 'main':
main.c:5:6: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%d %d",&d, &l);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #incude <stdio.h>
main.c:5:6: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | scanf("%d %d",&d, &l);
| ^~~~~
main.c:5:6: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
13 | printf("%d\n",s);
| ^~~~~~
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s472239278 | p00312 | C++ | #include <stdio.h>
int main(void){
int D,L,sam;
scanf("%d %d",&D,&L);
sam=(D/L)+(D%L);
printf("%d\n",sam);
return 0; | a.cc: In function 'int main()':
a.cc:10:18: error: expected '}' at end of input
10 | return 0;
| ^
a.cc:2:15: note: to match this '{'
2 | int main(void){
| ^
|
s862586515 | p00312 | C++ | #include <iostream>
using namespace std;
int main(){
int d,l;
cin >>d>>l;
int lcount =d/l;
int num=d-lcount*l;
if(num<0){
num =d-lcount*l+l;
cout << num+lcount-1<<endl;
}else cout <<lcount<<endl;
return 0;-1
} | a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before '}' token
12 | return 0;-1
| ^
| ;
13 | }
| ~
|
s394346512 | p00312 | C++ | #include <bits/stdc++.h>
int main() {
int D,L;
std:cin >> D >> L;
int sum;
int a = 1;
while(1) {
sum = L * a;
if(D > sum) {
--a;
break;
}else if(D <= sum) {
++a;
continue;
}
}
std::cout << a + (D - sum) << std::endl;
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | std:cin >> D >> L;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s404524083 | p00312 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int d,l,i;
i=0;
cin>>d>>l;
while(d>=l){
d=d-l;
i++
}
cout<<i+d<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:4: error: expected ';' before '}' token
10 | i++
| ^
| ;
11 | }
| ~
|
s535430859 | p00312 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int d,l;
cin>>d>>l;
x=d/l+d%l;
cout<<x<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'x' was not declared in this scope
7 | x=d/l+d%l;
| ^
|
s203144966 | p00313 | C | #include <stdio.h>
int main(int argc, char const *argv[]) {
int n;
int a,b,c;
int count=0;
int x[100],y[100],z[100];
int i,j;
scanf("%d%d%d%d",&n,&a,&b,&c);
for(i=0;i<a;i++){
scanf("%d",x[i] );
}
for(i=0;i<b;i++){
scanf("%d",y[i] );
}
for(i=0;i<c;i++){
scanf("%d",z[i] );
for(j=0;j<a;j++){
for(k=0;k<b;k++){
if (z[i]!=x[j]!=y[k]) {
count += 1;
} else if (z[i]==y[k]) {
count += 1;
}
}
}
}
printf("%d\n"count);
return 0;
} | main.c: In function 'main':
main.c:19:14: error: 'k' undeclared (first use in this function)
19 | for(k=0;k<b;k++){
| ^
main.c:19:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:17: error: expected ')' before 'count'
28 | printf("%d\n"count);
| ~ ^~~~~
| )
|
s781802665 | p00313 | C | #include <stdio.h>
int main(int argc, char const *argv[]) {
int n;
int a,b,c;
int count=0;
int x[100],y[100],z[100];
int i,j,k;
scanf("%d%d%d%d",&n,&a,&b,&c);
for(i=0;i<a;i++){
scanf("%d",x[i] );
}
for(i=0;i<b;i++){
scanf("%d",y[i] );
}
for(i=0;i<c;i++){
scanf("%d",z[i] );
for(j=0;j<a;j++){
for(k=0;k<b;k++){
if (z[i]!=x[j]!=y[k]) {
count += 1;
} else if (z[i]==y[k]) {
count += 1;
}
}
}
}
printf("%d\n"count);
return 0;
} | main.c: In function 'main':
main.c:28:17: error: expected ')' before 'count'
28 | printf("%d\n"count);
| ~ ^~~~~
| )
|
s990264552 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z,lnum=0;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d",&xnum[i]);
}
scanf("\n");
scanf("%d",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d",&ynum[ia]);
}
scanf("\n");
scanf("%d",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d",&znum[ib]);
}
scanf("\n");
int s,h=0;,g;
if(i>=ia){
g=i;
}else{
g=ia;
}
for(int m=0;m<=ib;m++){
s=0;
while(s==0){
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}else if(h==g){
s++;
}
h++;
}
lnum++;
}
printf("%d\n",lnum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:26:15: error: expected primary-expression before ',' token
26 | int s,h=0;,g;
| ^
a.cc:26:16: error: 'g' was not declared in this scope
26 | int s,h=0;,g;
| ^
|
s568953629 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z,lnum=0;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d ",&xnum[i]);
}
scanf("\n");
scanf("%d ",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d ",&ynum[ia]);
}
scanf("\n");
scanf("%d ",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d ",&znum[ib]);
}
scanf("\n");
int s,h=0;,g;
if(i>=ia){
g=i;
}else{
g=ia;
}
for(int m=0;m<=ib;m++){
s=0;
while(s==0){
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}else if(h==g){
s++;
}
h++;
}
lnum++;
}
printf("%d\n",lnum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:26:15: error: expected primary-expression before ',' token
26 | int s,h=0;,g;
| ^
a.cc:26:16: error: 'g' was not declared in this scope
26 | int s,h=0;,g;
| ^
|
s542309698 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z,lnum=0;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d ",&xnum[i]);
}
scanf("\n");
scanf("%d ",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d ",&ynum[ia]);
}
scanf("\n");
scanf("%d ",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d ",&znum[ib]);
}
scanf("\n");
int s,h=0;,g;
if(i>=ia){
g=i;
}else{
g=ia;
}
for(int m=0;m<ib+1;m++){
s=0;
while(s==0){
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}else if(h==g){
s++;
}
h++;
}
lnum++;
}
printf("%d\n",lnum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:26:15: error: expected primary-expression before ',' token
26 | int s,h=0;,g;
| ^
a.cc:26:16: error: 'g' was not declared in this scope
26 | int s,h=0;,g;
| ^
|
s004088791 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z,lnum=0;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d ",&xnum[i]);
}
scanf("\n");
scanf("%d ",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d ",&ynum[ia]);
}
scanf("\n");
scanf("%d ",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d ",&znum[ib]);
}
scanf("\n");
int s,h=0;,g;
if(i>=ia){
g=i+1;
}else{
g=ia+1;
}
for(int m=0;m<ib+1;m++){
s=0;
while(s==0){
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}else if(h==g){
s++;
}
h++;
}
lnum++;
}
printf("%d\n",lnum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:26:15: error: expected primary-expression before ',' token
26 | int s,h=0;,g;
| ^
a.cc:26:16: error: 'g' was not declared in this scope
26 | int s,h=0;,g;
| ^
|
s916150827 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d ",&xnum[i]);
}
scanf("\n");
scanf("%d ",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d ",&ynum[ia]);
}
scanf("\n");
scanf("%d ",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d ",&znum[ib]);
}
scanf("\n");
int s=0,h,g;
if(i>=ia){
g=i+1;
}else{
g=ia+1;
}
for(int m=0;m<ib+1;m++){
s=0;
for(h=0;h<g;h++)
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}
}
}
printf("%d\n",s);
return 0;
}
| a.cc:40:11: error: expected constructor, destructor, or type conversion before '(' token
40 | printf("%d\n",s);
| ^
a.cc:41:5: error: expected unqualified-id before 'return'
41 | return 0;
| ^~~~~~
a.cc:42:1: error: expected declaration before '}' token
42 | }
| ^
|
s552032552 | p00313 | C++ | #include<stdio.h>
int main(){
int n,x,y,z;
int xnum[100];
int ynum[100];
int znum[100];
scanf("%d\n",&n);
scanf("%d ",&x);
int i;
for(i=0;i<x;i++){
scanf("%d ",&xnum[i]);
}
scanf("\n");
scanf("%d ",&y);
int ia;
for(ia=0;ia<y;ia++){
scanf("%d ",&ynum[ia]);
}
scanf("\n");
scanf("%d ",&z);
int ib;
for(ib=0;ib<z;ib++){
scanf("%d ",&znum[ib]);
}
scanf("\n");
int s=0,h,g;
if(i>=ia){
g=i+1;
}else{
g=ia+1;
}
for(int m=0;m<ib+1;m++){
for(h=0;h<g;h++)
if(znum[m]==xnum[h]||znum[m]==ynum[h]){
s++;
}
}
}
printf("%d\n",s);
return 0;
}
| a.cc:39:11: error: expected constructor, destructor, or type conversion before '(' token
39 | printf("%d\n",s);
| ^
a.cc:40:5: error: expected unqualified-id before 'return'
40 | return 0;
| ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
41 | }
| ^
|
s820017259 | p00313 | C++ | #include<stdio.h>
int main(void)
{
int n,x,y,z,i,j,flg,fcnt,cnt1,cnt2;
int a[101],b[101],c[101];
scanf("%d %d",&n,&x);
for(i=0;i<x;i++) scanf("%d",&a[i]);
scanf("%d",&y);
for(i=0;i<y;i++) scanf("%d",&b[i]);
scanf("%d",&z);
for(i=0;i<z;i++) scanf("%d",&c[i]);
fcnt=0;
for(i=0;i<x;i++){
for(j=0;j<z;j++){
if(a[i]==c[j]){
c[j]=0; fcnt++;
}
}
}
cnt1=0; flg=0;
if(fcnt!=0){
for(i=0;i<z;i++){
if(c[i]!=0) cnt1++;
}
}
if(cnt1!=0) flg=1;
cnt2=0;
if(cnt1==0){
for(i=0;i<y;i++){
for(j=0;j<z;j++){
if(b[i]==c[j]) cnt2++;
}
}
}
if(cnt1==0||cnt2==0) cnt2=z;
if(flg==1) printf("%d\n",cnt1);
else printf("%d\n",cnt2);
return 0; | a.cc: In function 'int main()':
a.cc:38:18: error: expected '}' at end of input
38 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s953332555 | p00313 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n+1]={};
int x;
cin>>x;
for(int i=0;i<x;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=1;
}
}
}
int y;
cin>>y;
for(int i=0;i<y;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=10;
}
}
}
int z;
cin>>z;
for(int i=0;i<z;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=100;
}
}
}
int c=0;
for(int i=0;i<=n;i++){
if(a[i]==100||a[i]==110||a[i]==111){
c+=1;
}
}
cout<<c<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n+1]={};
int x;
cin>>x;
for(int i=0;i<x;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=1;
}
}
}
int y;
cin>>y;
for(int i=0;i<y;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=10;
}
}
}
int z;
cin>>z;
for(int i=0;i<z;i++){
int b;
cin>>b;
for(int j=0;j<100;j++){
if(b==j){
a[j]+=100;
}
}
}
int c=0;
for(int i=0;i<=n;i++){
if(a[i]==100||a[i]==110||a[i]==111){
c+=1;
}
}
cout<<c<<endl;
return 0;
}
| a.cc:51:5: error: redefinition of 'int main()'
51 | int main(){
| ^~~~
a.cc:3:5: note: 'int main()' previously defined here
3 | int main(){
| ^~~~
|
s081925460 | p00313 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n=0,a=0,count=0;
cin>>n;
int x[3][100];
for(int i=0;i<3;i++){
cin>>a;
for(int j=0;j<a;j++){
cin>>b;
x[i][j]=1;
}
}
for(int j=0;j<a;j++){
if(x[1][j]==0 && x[3][j]==1){
count++;
}
if(x[2][j]==1 && x[3][j]==1){
count++;
}
if(x[1][j]==0 && x[2][j]==1 && x[3][j]==1){
count--;
}
}
cout<<count<<endl;
}
| a.cc: In function 'int main()':
a.cc:14:18: error: 'b' was not declared in this scope
14 | cin>>b;
| ^
|
s909978987 | p00313 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int n=0,a=0,count=0,b=0,t=0;
cin>>n;
int x[3][100]={};
for(int i=0;i<3;i++){
cin>>a;
t=a;
for(int j=0;j<t;j++){
cin>>b;
x[i][b-1]=1;
}
}
for(int j=0;j<n;j++){
if(x[0][j]==0 && x[2][j]==1){
count++;
}
if(x[1][j]==1 && x[2][j]==1){
count++;
}
if(x[0][j]==0 && x[1][j]==1 && x[2][j]==1){
count--;
}
}
cout<<count<<endl;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s417349873 | p00313 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s541518449 | p00313 | C++ | #include<iostream>
using namespace std;
int main(){
int n,x[3],p[100]={},ans =0;
cin>>n;
for(int i =0;i<3;i++){
cin>>x[i]
for(int j =0;j<x[i];j++){
int t;
cin>>t;t--;
p[t] += 1;
}
if(i != 2)for(int j=0;j<n;j++)p[j] *= 2;
}
for(int i =0;i<n;i++){
if(p[i]==7||p[i]==3||p[i]==1)ans++;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'for'
8 | cin>>x[i]
| ^
| ;
9 | for(int j =0;j<x[i];j++){
| ~~~
a.cc:9:22: error: 'j' was not declared in this scope
9 | for(int j =0;j<x[i];j++){
| ^
|
s132589417 | p00313 | C++ | #include<iostream>
using namespace std;
int main(){
int n,x[3],p[100]={},ans =0;
cin>>n;
for(int i =0;i<3;i++){
cin>>x[i]
for(int j =0;j<x[i];j++){
int t;
cin>>t;
t--;
p[t] += 1;
}
if(i != 2)for(int j=0;j<n;j++)p[j] *= 2;
}
for(int i =0;i<n;i++){
if(p[i]==7||p[i]==3||p[i]==1)ans++;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'for'
8 | cin>>x[i]
| ^
| ;
9 | for(int j =0;j<x[i];j++){
| ~~~
a.cc:9:22: error: 'j' was not declared in this scope
9 | for(int j =0;j<x[i];j++){
| ^
|
s282863481 | p00313 | C++ | #include<bits/stdc++>
using namespace std;
int main(){
int n,x,t,ans =0;
cin>>n;
set<int>s[3];
for(int i =0;i<3;i++){
cin>>x;
for(int j =0;j<x;j++){
cin>>t;
s[i].insert(t);
}
}
for(int i=o;i<n;i++){
int a[3]={};
for(int j=0;j<3;j++){
if(s[j].count(i))a[j]++;
}
if(a[2] && !a[0] || a[2] && a[1])ans++;
}
cout<<ans<<endl;
}
| a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s990085529 | p00313 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,x,t,ans =0;
cin>>n;
set<int>s[3];
for(int i =0;i<3;i++){
cin>>x;
for(int j =0;j<x;j++){
cin>>t;
s[i].insert(t);
}
}
for(int i=o;i<n;i++){
int a[3]={};
for(int j=0;j<3;j++){
if(s[j].count(i))a[j]++;
}
if(a[2] && !a[0] || a[2] && a[1])ans++;
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:15:15: error: 'o' was not declared in this scope
15 | for(int i=o;i<n;i++){
| ^
|
s261803651 | p00314 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vectot<int> v(n);
for(int i=0;i<n;i++){
cin>>v[i];
}
sort(v.rbegin(),v.rend());
for(int i=0;i<n;i++){
if(v[i]<=i+1){
cout<<i+1<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'vectot' was not declared in this scope
6 | vectot<int> v(n);
| ^~~~~~
a.cc:6:12: error: expected primary-expression before 'int'
6 | vectot<int> v(n);
| ^~~
a.cc:8:14: error: 'v' was not declared in this scope
8 | cin>>v[i];
| ^
a.cc:10:10: error: 'v' was not declared in this scope
10 | sort(v.rbegin(),v.rend());
| ^
|
s821952873 | p00314 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> v(101);
fill(v.begin(),v.end(),0)
for(int i=0;i<n;i++){
int a;
cin>>a;
v[a]++;
}
for(int i=100;i>0;i+=-1){
v[i-1]+=v[i];
}
for(int i=100;i>=0;i+=-1){
if(v[i]<=i){
cout<<i<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:7:30: error: expected ';' before 'for'
7 | fill(v.begin(),v.end(),0)
| ^
| ;
8 | for(int i=0;i<n;i++){
| ~~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for(int i=0;i<n;i++){
| ^
|
s507786099 | p00314 | C++ | #include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
int n,i;
scanf("%d",&n);
vector<int>v(n);
for(i=0;i<n;i++)scanf("%d",&v[i]);
sort(v.begin(),v.end(),greater<int>());
for(i=0;i<n&&v[i]>=i+1;i++);
printf("%d\n",i);
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
7 | scanf("%d",&n);
| ^~~~~
a.cc:12:9: error: 'printf' was not declared in this scope
12 | printf("%d\n",i);
| ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
3 | #include <functional>
+++ |+#include <cstdio>
4 | using namespace std;
|
s423640791 | p00314 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int N;
cin>>N;
int p[100];
for(int i=0;i<N;i++){
cin>>p[i];
}
sort(p,p+N);
int score=0;
for(int i=1; i<=N;i++){
if(((p+N)-lower_bound(p,p+N,i))>=i){
score=i;s
}
else{
break;
}
}
cout<<score<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:20:33: error: 's' was not declared in this scope
20 | score=i;s
| ^
|
s330330835 | p00314 | C++ | #include <stdio.h>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < n; ++i)
int main(void) {
int n, i, j, k;
scanf("%d", &n);
int f[n];
rep(i, n) scanf("%d", &f[i]);
std::sort(f, f + n, std::greater<int>());
rep(i, n) {
if(p[i] <= i + 1) {
ans = p[i];
break;
}
}
printf("%d\n", ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:28: error: 'greater' is not a member of 'std'
10 | std::sort(f, f + n, std::greater<int>());
| ^~~~~~~
a.cc:10:36: error: expected primary-expression before 'int'
10 | std::sort(f, f + n, std::greater<int>());
| ^~~
a.cc:12:8: error: 'p' was not declared in this scope
12 | if(p[i] <= i + 1) {
| ^
a.cc:13:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | ans = p[i];
| ^~~
| abs
a.cc:17:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
17 | printf("%d\n", ans);
| ^~~
| abs
|
s878212881 | p00314 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s349101461 | p00315 | C | #include<stdio.h>
#include<string.h>
#define MAX_N 1000
int e, n, d, r, c;
char p[MAX_N][MAX_N + 1];
int main(void)
{
int cnt;
int i, j;
scanf( "%d %d ", &e, &n );
for( i=0; i<n; i++ ) {
gets( p[i] );
}
cnt = 0;
while( 1 ) {
for( i=0; i<n/2; i++ ) {
for( j=0; j<n/2; j++ ) {
if ( !(p[j][i] == p[n-1-j][i] && p[n-1-j][i] == p[j][n-1-i] && p[j][n-1-i] == p[n-1-j][n-1-i]) ) break;
}
if ( j < n/2 ) break;
}
if ( i >= n/2 ) cnt++;
e--;
if ( e <= 0 ) break;
scanf( "%d", &d );
while( d-- ) {
scanf( "%d %d", &r, &c );
if ( p[r-1][c-1] == '1' ) p[r-1][c-1] = '0';
else p[r-1][c-1] = '1';
}
}
printf( "%d\n", cnt );
return 0;
} | main.c: In function 'main':
main.c:17:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
17 | gets( p[i] );
| ^~~~
| fgets
|
s965654951 | p00315 | C | #include<stdio.h>
#include<string.h>
#define MAX_N 1000
int e, n, d, r, c;
char p[MAX_N][MAX_N + 1];
int main(void)
{
int cnt;
int i, j;
scanf( "%d %d ", &e, &n );
for( i=0; i<n; i++ ) {
gets( p[i] );
}
cnt = 0;
while( 1 ) {
for( i=0; i<n/2; i++ ) {
for( j=0; j<n/2; j++ ) {
if ( !(p[j][i] == p[n-1-j][i] && p[n-1-j][i] == p[j][n-1-i] && p[j][n-1-i] == p[n-1-j][n-1-i]) ) break;
}
if ( j < n/2 ) break;
}
if ( i >= n/2 ) cnt++;
e--;
if ( e <= 0 ) break;
scanf( "%d", &d );
while( d-- ) {
scanf( "%d %d", &r, &c );
if ( p[r-1][c-1] == '1' ) p[r-1][c-1] = '0';
else p[r-1][c-1] = '1';
}
}
printf( "%d\n", cnt );
return 0;
} | main.c: In function 'main':
main.c:17:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
17 | gets( p[i] );
| ^~~~
| fgets
|
s646428320 | p00315 | C | #include<stdio.h>
#define N_MAX 10000
char pixel[ N_MAX ][ N_MAX ] ;
int main( void )
{
int SameOrDiff_H( char* ,int* ) ;
int SameOrDiff_V( char(*)[ N_MAX ] ,int* ,int* ) ;
int C ,N ;
scanf( "%d %d" ,&C ,&N ) ;
int cnt ;
int i ,j ;
for( i = cnt = 0 ; i < N ; ++i )
{
scanf( "%s" ,pixel[ i ] ) ;
if( cnt == 0 && SameOrDiff_H( pixel[ i ] ,&N ) == 1 )
{
++cnt ;
}
}
for( i = 0 ; cnt == 0 && i < N ; ++i )
{
if( SameOrDiff_V( pixel ,&i ,&N ) == 1 )
{
++cnt ;
}
}
int n ;
int Y[ 100 ] ,X[ 100 ] ;
int y ,x ;
for( i = 1 ; i < C ; ++i )
{
int same = cnt ;
int Yp = 0 ;
int Xp = 0 ;
int sameY[ N_MAX + 1 ] = { 0 } ;
int sameX[ N_MAX + 1 ] = { 0 } ;
scanf( "%d" ,&n ) ;
for( j = 0 ; j < n ; ++j )
{
scanf( "%d %d" ,&y ,&x ) ;
if( sameY[ y ] == 0 )
{
Y[ Yp++ ] = y - 1 ;
sameY[ y ] = 1 ;
}
if( sameX[ x ] == 0 )
{
X[ Xp++ ] = x - 1 ;
sameX[ x ] = 1 ;
}
pixel[ y - 1 ][ x - 1 ] = pixel[ y - 1 ][ x - 1 ] == '1' ? '0' : '1' ;
}
for( j = 0 ; j < Yp && cnt == same ; ++j )
{
if( SameOrDiff_H( pixel[ Y[ j ] ] ,&N ) == 1 )
{
++cnt ;
}
}
for( j = 0 ; j < Xp && cnt == same ; ++j )
{
if( SameOrDiff_V( pixel ,&X[ j ] ,&N ) == 1 )
{
++cnt ;
}
}
}
printf( "%d\n" ,C - cnt ) ;
return 0 ;
}
| /usr/bin/ld: /tmp/ccjyOsUF.o: in function `main':
main.c:(.text+0x8d): undefined reference to `SameOrDiff_H'
/usr/bin/ld: main.c:(.text+0xcc): undefined reference to `SameOrDiff_V'
/usr/bin/ld: main.c:(.text+0x2c0): undefined reference to `SameOrDiff_H'
/usr/bin/ld: main.c:(.text+0x314): undefined reference to `SameOrDiff_V'
collect2: error: ld returned 1 exit status
|
s583463086 | p00315 | C++ | #include<bits/stdc++.h>
usingnamespace std;
int main(){
int c,n;
int m[1000][1000];
cin>>c>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin<<m[i][j];
}
}
bool f=true;
int ans=0;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
f=false;
break;
}
}
}
if(f){
ans++;
c--;
while(c--){
int d;
cin>>d;
for(int i=0;i<d;i++){
int r,c;
cin>>r>>c;
r--;c--;
m[r][c]^=1;
}
f=true;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
if(f){
ans++;
}
}
}
}
f=false;
}
cout<<ans<<endl;
return 0;
}
| a.cc:2:1: error: 'usingnamespace' does not name a type
2 | usingnamespace std;
| ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>c>>n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:46:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
46 | cout<<ans<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:46:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
46 | cout<<ans<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:48:2: error: expected '}' at end of input
48 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s024206245 | p00315 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int c,n;
int m[1000][1000];
cin>>c>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin<<m[i][j];
}
}
bool f=true;
int ans=0;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
f=false;
break;
}
}
}
if(f){
ans++;
c--;
while(c--){
int d;
cin>>d;
for(int i=0;i<d;i++){
int r,c;
cin>>r>>c;
r--;c--;
m[r][c]^=1;
}
f=true;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
if(f){
ans++;
}
}
}
}
f=false;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:16: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
9 | cin<<m[i][j];
| ~~~^~~~~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:9:16: note: candidate: 'operator<<(int, int)' (built-in)
9 | cin<<m[i][j];
| ~~~^~~~~~~~~
a.cc:9:16: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
9 | cin<<m[i][j];
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin<<m[i][j];
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& |
s062937146 | p00315 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int c,n;
int m[1000][1000];
cin>>c>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>m[i][j];
}
}
bool f=true;
int ans=0;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
f=false;
break;
}
}
}
if(f){
ans++;
c--;
while(c--){
int d;
cin>>d;
for(int i=0;i<d;i++){
int r,c;
cin>>r>>c;
r--;c--;
m[r][c]^=1;
}
f=true;
for(int i=0;i<=n/2+1;i++){
for(int j=0;j<=n/2+1;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
if(f){
ans++;
}
}
}
}
f=false;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:48:2: error: expected '}' at end of input
48 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s113549437 | p00315 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int c,n;
int m[1000][1000];
cin>>c>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
char c;
cin>>c;
m[i][j]=(c==‘0’?0:1);
}
}
bool f=true;
int ans=0;
for(int i=0;i<(n+1)/2;i++){
for(int j=0;j<(n+1)/2;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
f=false;
break;
}
}
if(!f){
break;
}
}
if(f){
ans++;
}
c--;
while(c--){
int d;
cin>>d;
for(int i=0;i<d;i++){
int r,c;
cin>>r>>c;
r--;c--;
m[r][c]^=1;
}
f=true;
for(int i=0;i<(n+1)/2;i++){
for(int j=0;j<(n+1)/2;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
f=false;
break;
}
}
if(!f){
break;
}
}
if(f){
ans++;
}
}
cout<<ans<<endl;
return 0;
}
| a.cc:11:25: error: extended character ‘ is not valid in an identifier
11 | m[i][j]=(c==‘0’?0:1);
| ^
a.cc:11:25: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:25: error: '\U000020180\U00002019' was not declared in this scope
11 | m[i][j]=(c==‘0’?0:1);
| ^~~
|
s261599264 | p00315 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int c,n;
int m[1000][1000];
cin>>c>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
char c;
cin>>c;
m[i][j]=(c=='0'?0:1);
}
}
int ans=0;
set<int> s;
for(int i=0;i<(n+1)/2;i++){
for(int j=0;j<(n+1)/2;j++){
if(m[i][j]!=m[n-1-i][j]||m[i][j]!=m[n-1-i][n-1-j]||m[i][j]!=m[i][n-1-j]){
s.insert(i*n+j);
}
}
}
if(s.empty()){
ans++;
}
c--;
while(c--){
int d;
cin>>d;
for(int i=0;i<d;i++){
int r,c;
cin>>r>>c;
r--;c--;
m[r][c]^=1;
s.insert(min(r,n-1-r)*n+min(c,n-1-c));
}
f=true;
for(set<int>::iterator i=s.begin();i!=s.end();i++){
int h=*i;
int a=h/n,b=h%n;
if(m[a][b]==m[a][n-1-b]&&m[a][b]==m[n-1-a][n-1-b]&&m[a][b]==m[n-1-a][b]){
s.erase(h);
}
}
if(s.empty()){
ans++;
}
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:37:9: error: 'f' was not declared in this scope
37 | f=true;
| ^
|
s890009271 | p00315 | C++ | clude <bits/stdc++.h>
using namespace std;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
string board[1005];
bool sym[1005][1005];
int C,N;
int ans=0;
int miss=0;
unordered_set<int> rowdif;
unordered_set<int> coldif;
vector<set<int> > rowdifset(1005);
vector<set<int> > coldifset(1005);
void judge()
{
for(int i=0;i<N/2;i++)
{
for(int j=0;j<N;j++)
{
if(board[i][j]!=board[N-1-i][j])
{
rowdif.insert(i);
if(j<N/2)
{
rowdifset[i].insert(j);
}
else
{
rowdifset[i].insert(N-1-j);
}
}
}
}
for(int i=0;i<N/2;i++)
{
for(int j=0;j<N;j++)
{
if(board[j][i]!=board[j][N-1-i])
{
coldif.insert(i);
if(j<N/2)
{
coldifset[i].insert(j);
}
else
{
coldifset[i].insert(N-1-j);
}
}
}
}
}
int main(void)
{
cin >> C >> N;
for(int i=0;i<N;i++)
{
cin >> board[i];
}
judge();
if(rowdif.empty() && coldif.empty()) ans++;
for(int i=0;i<C-1;i++)
{
int change;
cin >> change;
for(int j=0;j<change;j++)
{
int row,col;
cin >> row >> col;
row--,col--;
if(row>=(N/2)) row=N-1-row;
if(col>=(N/2)) col=N-1-col;
auto it=rowdifset[row].find(col);
if(it==rowdifset[row].end())
{
rowdifset[row].insert(col);
rowdif.insert(row);
}
else
{
rowdifset[row].erase(col);
if(rowdifset[row].empty())
{
rowdif.erase(row);
}
}
it=coldifset[col].find(row);
if(it==coldifset[col].end())
{
coldifset[col].insert(row);
coldif.insert(col);
}
else
{
coldifset[col].erase(row);
if(coldifset[col].empty())
{
coldif.erase(col);
}
}
}
if(rowdif.empty() && coldif.empty())
{
cout << "Now Tile No. " << i+2 << endl;
ans++;
}
}
cout << ans << endl;
return 0;
}
| a.cc:1:1: error: 'clude' does not name a type
1 | clude <bits/stdc++.h>
| ^~~~~
a.cc:4:9: error: 'vector' does not name a type
4 | typedef vector<int> vi;
| ^~~~~~
a.cc:6:1: error: 'string' does not name a type
6 | string board[1005];
| ^~~~~~
a.cc:11:1: error: 'unordered_set' does not name a type
11 | unordered_set<int> rowdif;
| ^~~~~~~~~~~~~
a.cc:12:1: error: 'unordered_set' does not name a type
12 | unordered_set<int> coldif;
| ^~~~~~~~~~~~~
a.cc:13:1: error: 'vector' does not name a type
13 | vector<set<int> > rowdifset(1005);
| ^~~~~~
a.cc:14:1: error: 'vector' does not name a type
14 | vector<set<int> > coldifset(1005);
| ^~~~~~
a.cc: In function 'void judge()':
a.cc:21:14: error: 'board' was not declared in this scope
21 | if(board[i][j]!=board[N-1-i][j])
| ^~~~~
a.cc:23:15: error: 'rowdif' was not declared in this scope
23 | rowdif.insert(i);
| ^~~~~~
a.cc:26:19: error: 'rowdifset' was not declared in this scope
26 | rowdifset[i].insert(j);
| ^~~~~~~~~
a.cc:30:19: error: 'rowdifset' was not declared in this scope
30 | rowdifset[i].insert(N-1-j);
| ^~~~~~~~~
a.cc:39:14: error: 'board' was not declared in this scope
39 | if(board[j][i]!=board[j][N-1-i])
| ^~~~~
a.cc:41:15: error: 'coldif' was not declared in this scope
41 | coldif.insert(i);
| ^~~~~~
a.cc:44:19: error: 'coldifset' was not declared in this scope
44 | coldifset[i].insert(j);
| ^~~~~~~~~
a.cc:48:19: error: 'coldifset' was not declared in this scope
48 | coldifset[i].insert(N-1-j);
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:57:3: error: 'cin' was not declared in this scope
57 | cin >> C >> N;
| ^~~
a.cc:60:14: error: 'board' was not declared in this scope
60 | cin >> board[i];
| ^~~~~
a.cc:63:6: error: 'rowdif' was not declared in this scope
63 | if(rowdif.empty() && coldif.empty()) ans++;
| ^~~~~~
a.cc:63:24: error: 'coldif' was not declared in this scope
63 | if(rowdif.empty() && coldif.empty()) ans++;
| ^~~~~~
a.cc:75:19: error: 'rowdifset' was not declared in this scope
75 | auto it=rowdifset[row].find(col);
| ^~~~~~~~~
a.cc:79:15: error: 'rowdif' was not declared in this scope
79 | rowdif.insert(row);
| ^~~~~~
a.cc:86:19: error: 'rowdif' was not declared in this scope
86 | rowdif.erase(row);
| ^~~~~~
a.cc:89:14: error: 'coldifset' was not declared in this scope
89 | it=coldifset[col].find(row);
| ^~~~~~~~~
a.cc:93:15: error: 'coldif' was not declared in this scope
93 | coldif.insert(col);
| ^~~~~~
a.cc:100:19: error: 'coldif' was not declared in this scope
100 | coldif.erase(col);
| ^~~~~~
a.cc:104:10: error: 'rowdif' was not declared in this scope
104 | if(rowdif.empty() && coldif.empty())
| ^~~~~~
a.cc:104:28: error: 'coldif' was not declared in this scope
104 | if(rowdif.empty() && coldif.empty())
| ^~~~~~
a.cc:106:11: error: 'cout' was not declared in this scope
106 | cout << "Now Tile No. " << i+2 << endl;
| ^~~~
a.cc:106:45: error: 'endl' was not declared in this scope
106 | cout << "Now Tile No. " << i+2 << endl;
| ^~~~
a.cc:110:3: error: 'cout' was not declared in this scope
110 | cout << ans << endl;
| ^~~~
a.cc:110:18: error: 'endl' was not declared in this scope
110 | cout << ans << endl;
| ^~~~
|
s394986981 | p00315 | C++ | #include<iostream>
#include<set>
#include<algorithm>
using namespace std;
class Point{
public:
int x;
int y;
bool bin;
};
bool operator<(const Point& lp,const Point& rp){
return (lp.x + lp.y) < (rp.x + rp.y);
}
class FourPoint{
public:
Point lu;
Point ru;
Point ld;
Point rd;
friend ostream& operator<<(ostream& os,const FourPoint& fp){
os << fp.lu.x << " " << fp.lu.y;
return os;
}
};
bool operator<(const FourPoint& lfp,const FourPoint& rfp){
return (lfp.lu.x < rfp.lu.x) && (lfp.lu.y < rfp.lu.y) && (lfp.ru.x < rfp.ru.x) && (lfp.ru.y < rfp.ru.y) && (lfp.ld.x < rfp.ld.x) && (lfp.ld.y < rfp.ld.y) && (lfp.rd.x < rfp.rd.x) && (lfp.rd.y < rfp.rd.y);
}
int main(){
int c,n,d,x,y,count;
set<FourPoint> st;
set<FourPoint>::iterator itr;
Point ptmp[4];
FourPoint fptmp;
count = 0;
cin >> c >> n;
bool table[n][n];
string s[n];
for(int i=0;i<n;i++){
cin >> s[i];
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(s[i][j] == '0'){
table[i][j] =false;
}
else{
table[i][j] = true;
}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n/2;j++){
if(table[i][j] != table[i][n-j-1]){
ptmp[0].x = i; ptmp[0].y = j; ptmp[0].bin = table[i][j];
ptmp[1].x = n-i-1; ptmp[1].y = j; ptmp[1].bin = table[n-i-1][j];
ptmp[2].x = i; ptmp[2].y = n-j-1; ptmp[2].bin = table[i][n-j-1];
ptmp[3].x = n-i-1; ptmp[3].y = n-j-1; ptmp[3].bin = table[n-i-1][n-j-1];
sort(ptmp,ptmp+4);
fptmp.lu = ptmp[0];
if(ptmp[1].y < ptmp[2].y){
fptmp.ru = ptmp[1];
fptmp.ld = ptmp[2];
}
else{
fptmp.ru = ptmp[2];
fptmp.ld = ptmp[1];
}
fptmp.rd = ptmp[3];
st.insert(fptmp);
}
}
}
for(int i=0;i<n/2;i++){
for(int j=0;j<n;j++){
if(table[i][j] != table[n-i-1][j]){
ptmp[0].x = i; ptmp[0].y = j; ptmp[0].bin = table[i][j];
ptmp[1].x = n-i-1; ptmp[1].y = j; ptmp[1].bin = table[n-i-1][j];
ptmp[2].x = i; ptmp[2].y = n-j-1; ptmp[2].bin = table[i][n-j-1];
ptmp[3].x = n-i-1; ptmp[3].y = n-j-1; ptmp[3].bin = table[n-i-1][n-j-1];
sort(ptmp,ptmp+4);
fptmp.lu = ptmp[0];
if(ptmp[1].y < ptmp[2].y){
fptmp.ru = ptmp[1];
fptmp.ld = ptmp[2];
}
else{
fptmp.ru = ptmp[2];
fptmp.ld = ptmp[1];
}
fptmp.rd = ptmp[3];
st.insert(fptmp);
}
}
}
/* for(itr = st.begin(); itr != st.end(); ++itr) {
cout << *itr << "\n"; // ????????¬???????????????????????????????????¨???
}*/
if(st.size() == 0){
count++;
}
for(int k=0;k<c-1;k++){
/* for(itr = st.begin(); itr != st.end(); ++itr) {
std::cout << "key = " << itr->first // ???????????¨???
<< ", val = " << itr->second << "\n"; // ????????¨???
}*/
cin >> d;
/*for(int i=0;i<d;i++){
cout << i << endl;
for(int a=0;a<n;a++){
for(int b=0;b<n;b++){
if(table[a][b] == false){
cout << '0';
}
else{
cout << '1';
}
cout << ' ';
}
cout << endl;
}*/
for(int i=0;i<d;i++){
is_delete = false;
cin >> x >> y;
table[x-1][y-1] = !table[x-1][y-1];
//cout << "unsigned " << tmps << endl;
ptmp[0].x = x-1; ptmp[0].y = y-1; ptmp[0].bin = table[x-1][y-1];
ptmp[1].x = n-x; ptmp[1].y = y-1; ptmp[1].bin = table[n-x][y-1];
ptmp[2].x = x-1; ptmp[2].y = n-y; ptmp[2].bin = table[x-1][n-y];
ptmp[3].x = n-x; ptmp[3].y = n-y; ptmp[3].bin = table[n-x][n-y];
sort(ptmp,ptmp+4);
fptmp.lu = ptmp[0];
if(ptmp[1].y < ptmp[2].y){
fptmp.ru = ptmp[1];
fptmp.ld = ptmp[2];
}
else{
fptmp.ru = ptmp[2];
fptmp.ld = ptmp[1];
}
fptmp.rd = ptmp[3];
itr = st.find(fptmp);
if(itr != st.end()){
if(fptmp.lu.bin == fptmp.ru.bin && fptmp.ru.bin == fptmp.ld.bin && fptmp.ld.bin == fptmp.rd.bin){
st.erase(itr);
}
}
else{
st.insert(fptmp);
}
}
if(st.size() == 0){
//cout << "f1d2a " << k+2 << endl;
count++;
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:162:10: error: 'is_delete' was not declared in this scope; did you mean 'timer_delete'?
162 | is_delete = false;
| ^~~~~~~~~
| timer_delete
|
s377648933 | p00315 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int c,n,d,x,y,count;
count = 0;
cin >> c >> n;
bool table[n][n];
char cha;
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
cin >> cha;
table[i][j] = cha=='0' ? 0 : 1;
}
}
bool flag=true;
for(int i=0; i<n/2; i++){
for(int j=0; j<n/2; j++){
if( (table[i][j] + table[i][N-j] + table[N-i][j] + table[N-i][N-j]) % 4 != 0){
flag = false;
break;
}
}
if(!flag){
break;
}
}
if(flag){
count++;
}
for(int k=0;k<c-1;k++){
cin >> d;
for(int i=0;i<d;i++){
cin >> x >> y;
table[x-1][y-1] = !table[x-1][y-1];
}
flag=true;
for(int i=0; i<n/2; i++){
for(int j=0; j<n/2; j++){
if( (table[i][j] + table[i][N-j] + table[N-i][j] + table[N-i][N-j]) % 4 != 0){
flag = false;
break;
}
}
if(!flag){
break;
}
}
if(flag){
count++;
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:28:40: error: 'N' was not declared in this scope
28 | if( (table[i][j] + table[i][N-j] + table[N-i][j] + table[N-i][N-j]) % 4 != 0){
| ^
a.cc:55:42: error: 'N' was not declared in this scope
55 | if( (table[i][j] + table[i][N-j] + table[N-i][j] + table[N-i][N-j]) % 4 != 0){
| ^
|
s376724480 | p00315 | C++ | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;
int c, n;
int field[1010][1010];
bool check() {
for (int i = 0; i < n/2; i++) {
for (int j = 0; j < n; j++) {
if ((field[i][j] != field[n - i - 1][j])||
(field[j][i] != field[j][n-i-1])){
return 0;
}
}
}
return 1;
}
int main()
{
cin >> c >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
scanf_s("%1d",&field[i][j]);
}
if (check())ans++;
for (int i = 0; i < c-1; i++) {
int m; cin >> m;
for (int j = 0; j < m; j++) {
int x, y;
cin >> x >> y;
x--, y--;
if (field[x][y])field[x][y] = 0;
else field[x][y] = 1;
}
if (check())ans++;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:47:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
47 | scanf_s("%1d",&field[i][j]);
| ^~~~~~~
| scanf
|
s293696399 | p00315 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define down_queue(x) priority_queue<x>
#define up_queue(x) priority_queue<x, vector<x>, greater<x>>
#define vec(x) vector<x>
ll gcd(ll a,ll b){while(b){ll tmp = a % b;a = b;b = tmp;}return a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
#define rep(x, y) for(int x = 0; x < (y); x++)
#define rrep(x, y) for(int x = (y); x >= 0; x--)
#define REP(x, z, y) for(int x = (z); x < (y); x++)
#define RREP(x, z, y) for(int x = (y); x >= (z); x--)
#define all(x) x.begin(), x.end()
#define split_str(str, sp_word) istringstream stream(str); string res; for(int cnt = 0; getline(stream,res,sp_word); cnt++)
#define digit(x) ((int)log10((double)(x)) + 1)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define out(x) for(auto i : x) cout << i << " "; cout << endl;
#define outln(x) for(auto i : x) cout << i << " " << endl;
#define vec_cpy(to,from) copy(all(to),back_inserter(from))
#define ary_cpy(to,from) memcpy(to, from, sizeof from)
#define MOD = 1000000007;
#ifdef DEBUG
#define debug_echo(e) cout << "|" << __LINE__ << "| " << e << endl
#define debug_var(e) cout << "|" << __LINE__ << "| " << #e << ": " << e << endl
#define debug_echo_dp(dp, N) { cout << "[ "; rep(cnt, N) cout << dp[cnt] << " "; cout << "]" << endl; }
#else
#define debug_echo(e)
#define debug_var(e)
#define debug_echo_dp(dp, N)
#endif
int main(){
int C,n,d,r,c,ans = 0; cin >> C >> n;
int harf = n / 2;
int h_cnt = 0;
int w_cnt = 0;
vec(bool) h[harf],w[n],h_goal(n,true),w_goal(harf,true);
str p[n];
rep(i,n) cin >> p[i];
//????????????????????¨
rep(i,harf)
rep(j,n){
h[i].pb(p[i][j] == p[n - i - 1][j]);
if(p[i][j] != p[n - i - 1][j]) h_cnt++;
}
//?¨??????????????????¨
rep(i,n)
rep(j,harf){
w[i].pb(p[i][j] == p[i][n - j - 1]);
if(p[i][j] != p[i][n - j - 1]) w_cnt++;
}
debug_var(h_cnt);
debug_var(w_cnt);
if(w_cnt == 0 && h_cnt == 0) ans++;
rep(i,C - 1){
cin >> d;
rep(i,d){
cin >> r >> c;
r--; c--;
if(h[(r >= harf ? n - r - 1 : r)][c]) h_cnt++;
else h_cnt--;
if(w[r][(c >= harf ? n - c - 1 : c)]) w_cnt++;
else w_cnt--;
//????????¨???????????????????????¢
h[(r >= harf ? n - r - 1 : r)][c] = !h[(r >= harf ? n - r - 1 : r)][c];
w[r][(c >= harf ? n - c - 1 : c)] = !w[r][(c >= harf ? n - c - 1 : c)];
}
debug_var(h_cnt);
debug_var(w_cnt);
if(h_cnt == 0 && w_cnt == 0) ans++;
}
| a.cc: In function 'int main()':
a.cc:83:4: error: expected '}' at end of input
83 | }
| ^
a.cc:35:11: note: to match this '{'
35 | int main(){
| ^
|
s323987691 | p00315 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define down_queue(x) priority_queue<x>
#define up_queue(x) priority_queue<x, vector<x>, greater<x>>
#define vec(x) vector<x>
ll gcd(ll a,ll b){while(b){ll tmp = a % b;a = b;b = tmp;}return a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
#define rep(x, y) for(int x = 0; x < (y); x++)
#define rrep(x, y) for(int x = (y); x >= 0; x--)
#define REP(x, z, y) for(int x = (z); x < (y); x++)
#define RREP(x, z, y) for(int x = (y); x >= (z); x--)
#define all(x) x.begin(), x.end()
#define split_str(str, sp_word) istringstream stream(str); string res; for(int cnt = 0; getline(stream,res,sp_word); cnt++)
#define digit(x) ((int)log10((double)(x)) + 1)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define out(x) for(auto i : x) cout << i << " "; cout << endl;
#define outln(x) for(auto i : x) cout << i << " " << endl;
#define vec_cpy(to,from) copy(all(to),back_inserter(from))
#define ary_cpy(to,from) memcpy(to, from, sizeof from)
#define MOD = 1000000007;
#ifdef DEBUG
#define debug_echo(e) cout << "|" << __LINE__ << "| " << e << endl
#define debug_var(e) cout << "|" << __LINE__ << "| " << #e << ": " << e << endl
#define debug_echo_dp(dp, N) { cout << "[ "; rep(cnt, N) cout << dp[cnt] << " "; cout << "]" << endl; }
#else
#define debug_echo(e)
#define debug_var(e)
#define debug_echo_dp(dp, N)
#endif
int main(){
int C,n,d,r,c,ans = 0; cin >> C >> n;
int harf = n / 2;
int h_cnt = 0;
int w_cnt = 0;
vec(bool) h[harf],w[n],h_goal(n,true),w_goal(harf,true);
str p[n];
rep(i,n) cin >> p[i];
//????????????????????¨
rep(i,harf)
rep(j,n){
h[i].pb(p[i][j] == p[n - i - 1][j]);
if(p[i][j] != p[n - i - 1][j]) h_cnt++;
}
//?¨??????????????????¨
rep(i,n)
rep(j,harf){
w[i].pb(p[i][j] == p[i][n - j - 1]);
if(p[i][j] != p[i][n - j - 1]) w_cnt++;
}
debug_var(h_cnt);
debug_var(w_cnt);
if(w_cnt == 0 && h_cnt == 0) ans++;
rep(i,C - 1){
cin >> d;
rep(i,d){
cin >> r >> c;
r--; c--;
if(h[(r >= harf ? n - r - 1 : r)][c]) h_cnt++;
else h_cnt--;
if(w[r][(c >= harf ? n - c - 1 : c)]) w_cnt++;
else w_cnt--;
//????????¨???????????????????????¢
h[(r >= harf ? n - r - 1 : r)][c] = !h[(r >= harf ? n - r - 1 : r)][c];
w[r][(c >= harf ? n - c - 1 : c)] = !w[r][(c >= harf ? n - c - 1 : c)];
}
debug_var(h_cnt);
debug_var(w_cnt);
if(h_cnt == 0 && w_cnt == 0) ans++;
}
| a.cc: In function 'int main()':
a.cc:83:4: error: expected '}' at end of input
83 | }
| ^
a.cc:35:11: note: to match this '{'
35 | int main(){
| ^
|
s580888411 | p00315 | C++ | #include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
class Coster {
public:
Coster(int n);
~Coster();
void diff(const int& r, const int& c);
int SymmetryNum();
void FirstSym();
void SymCalc(int r, int c);
bool** pixel;
private:
int symmetry;
int N;
};
Coster::Coster(int n) {
N = n;
pixel = new bool*[n];
for (int i = 0; i < n; i++)
pixel[i] = new bool[n];
}
Coster::~Coster() {
delete[] pixel;
}
void Coster::diff(const int& r, const int& c) {
pixel[r-1][c-1] = !pixel[r-1][c-1];
}
int Coster::SymmetryNum() {
return symmetry;
}
void Coster::FirstSym() {
char same = 0;
for (int r = 0; r < N / 2; r++) {
for (int c = 0; c < N / 2; c++) {
same = pixel[r][c];
same |= pixel[r][N - c - 1] << 1;
same |= pixel[N - r - 1][c] << 2;
same |= pixel[N - r - 1][N - c - 1] << 3;
if (!(same == 0x0f || same == 0x00))
return;
}
}
symmetry++;
}
void Coster::SymCalc(int r, int c) {
char same = 0;
same = pixel[r][c];
same |= pixel[r][N - c - 1] << 1;
same |= pixel[N - r - 1][c] << 2;
same |= pixel[N - r - 1][N - c - 1] << 3;
if (same == 0x0f || same == 0x00)
symmetry++;
}
int main()
{
int C,N;
cin >> C >> N;
Coster coster(N);
char n;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> n;
coster.pixel[i][j] = (bool)(n - '0');
}
}
coster.FirstSym();
for (int I = 0; I < C-1; I++) {
int D;
cin >> D;
for (int i = 0; i < D; i++) {
int r, c;
cin >> r >> c;
coster.diff(r, c);
}
coster.SymCalc(r,c);
}
cout << coster.SymmetryNum() << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:82:32: error: 'r' was not declared in this scope
82 | coster.SymCalc(r,c);
| ^
a.cc:82:34: error: 'c' was not declared in this scope
82 | coster.SymCalc(r,c);
| ^
|
s503673829 | p00315 | C++ | int main() {
int c, n;
cin >> c >> n;
vector<string> p(n);
for(int i = 0; i < n; ++i) {
cin >> p[i];
}
int incorrect = 0;
for(int i = 0; i < n / 2; ++i) {
for(int j = 0; j < n / 2; ++j) {
incorrect += p[i][j] != p[i][n - j - 1] || p[i][j] != p[n - i - 1][j];
}
}
int ans = incorrect == 0;
for(int i = 0; i < c - 1; ++i) {
int d; cin >> d;
for(int j = 0; j < d; ++j) {
int r, c; cin >> r >> c;
r--; c--;
if(p[n - r - 1][c] == p[r][c] && p[r][c] == p[r][n - c - 1]) incorrect += 1;
p[r][c] = (p[r][c] == '0') ? '1' : '0';
if(p[n - r - 1][c] == p[r][c] && p[r][c] == p[r][n - c - 1]) incorrect -= 1;
}
ans += incorrect == 0;
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> c >> n;
| ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
4 | vector<string> p(n);
| ^~~~~~
a.cc:4:12: error: 'string' was not declared in this scope
4 | vector<string> p(n);
| ^~~~~~
a.cc:4:20: error: 'p' was not declared in this scope
4 | vector<string> p(n);
| ^
a.cc:28:5: error: 'cout' was not declared in this scope
28 | cout << ans << endl;
| ^~~~
a.cc:28:20: error: 'endl' was not declared in this scope
28 | cout << ans << endl;
| ^~~~
|
s891153509 | p00316 | C | /*
????????? ??¨?´?????????? ???????????????
A ???????????????????????§???????????????A ??????????????????????????¨?´???????????±???????????????????
?????????????????¨????????????A???????????? 1 ?????? N ??????????????????????????? N ??????????????¨???
1 ?????? M ??????????????????????????? M ?¨?????????¨?´?????????????????????¨?´????????????°??¶??????
????????????????????¨?´??????????????????????????????????A ?????????????????§?????????????????¨????????¨
?´?????????§??????????±???§???????????????????????¨???????????????????????£????????????
????????????????????????????????????????????????????¬??????????????????§??????????????? K ???????¨????
?????\????????????
??? ?????? a ??¨?????? b ???????????¨?´???????????±????????????????
??? ?????? c ?????¨?´???? x ???????±????????????????
???????????????????¨????????????°??????????????????????????£?????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????¨????????§???????????????????????¢
????????¨????????????
??????
K ???????¨????????????????????????¨???????????????????????¨????????§???????????????????????????????±????
???????????°????????????????????????
??\???
??\????????\????????¢?????§??????????????????
1 a b
?????????
2 c x
???????????°?????????1????????¨??????
??????a(1???a???N)??¨??????b(1???b???N)???????????¨?´???????????±??????????????????¨??????
??????????????????a???b??§?????????
???????????°?????????2????????¨??????
??????c(1???c???N)?????¨?´????x(1???x???M)???????±??????????????????¨????????????
????????¶???
??\?????????????????????????????????????§?????¶?????????????????????????
??????
?????????????????¨????????§??????????????????????????????????????????????????????????????????????????´???
??? 0 ???????????????????????????
http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2409100#1
*/
#include <stdio.h>
#define MAX_N 100001
int par[MAX_N];
int size[MAX_N];
int id[MAX_N];
int flg = 0;
/*
* ????????????????????????
*/
void init( void )
{
int i;
for( i = 0 ; i < MAX_N ; i++ ) {
par[ i ] = i;
size[ i ] = 1;
id[ i ] = -1;
}
}
/*
* ?????????????????????????´¢
*/
int find(
int x )
{
int ret;
if ( par[ x ] == x ) {
ret = x;
}
else {
par[ x ] = find( par[ x ] );
ret = par[ x ];
}
return ret;
}
/*
* ????????????????????????
*/
void unite(
int a,
int b )
{
a = find( a );
b = find( b );
if ( a == b ) return;
if ( size[ a ] > size[ b ]) swap( a, b );
par[ a]=b;
if(id[a]!=-1&&id[b]!=-1&&id[a]!=id[b])flg=true;
if(id[a]!=-1){
id[b]=id[a];
}
}
int N,M,K;
int main(){
init();
scanf("%d %d %d",&N,&M,&K);
for(int k=1;k<=K;k++){
int type,x,y;
scanf("%d %d %d",&type,&x,&y);
if(type==1){
unite(x,y);
}else if(type==2){
x=find(x);
if(id[x]!=-1&&id[x]!=y)flg=true;
id[x]=y;
}
if(flg){
cout<<k<<endl;
break;
}
}
if(!flg){
cout<<0<<endl;
}
return 0;
} | main.c: In function 'unite':
main.c:102:31: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
102 | if ( size[ a ] > size[ b ]) swap( a, b );
| ^~~~
main.c:106:45: error: 'true' undeclared (first use in this function)
106 | if(id[a]!=-1&&id[b]!=-1&&id[a]!=id[b])flg=true;
| ^~~~
main.c:51:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
50 | #include <stdio.h>
+++ |+#include <stdbool.h>
51 |
main.c:106:45: note: each undeclared identifier is reported only once for each function it appears in
106 | if(id[a]!=-1&&id[b]!=-1&&id[a]!=id[b])flg=true;
| ^~~~
main.c: In function 'main':
main.c:125:34: error: 'true' undeclared (first use in this function)
125 | if(id[x]!=-1&&id[x]!=y)flg=true;
| ^~~~
main.c:125:34: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:129:7: error: 'cout' undeclared (first use in this function)
129 | cout<<k<<endl;
| ^~~~
main.c:129:16: error: 'endl' undeclared (first use in this function)
129 | cout<<k<<endl;
| ^~~~
|
s601882047 | p00316 | C | /*
????????? ??¨?´?????????? ???????????????
A ???????????????????????§???????????????A ??????????????????????????¨?´???????????±???????????????????
?????????????????¨????????????A???????????? 1 ?????? N ??????????????????????????? N ??????????????¨???
1 ?????? M ??????????????????????????? M ?¨?????????¨?´?????????????????????¨?´????????????°??¶??????
????????????????????¨?´??????????????????????????????????A ?????????????????§?????????????????¨????????¨
?´?????????§??????????±???§???????????????????????¨???????????????????????£????????????
????????????????????????????????????????????????????¬??????????????????§??????????????? K ???????¨????
?????\????????????
??? ?????? a ??¨?????? b ???????????¨?´???????????±????????????????
??? ?????? c ?????¨?´???? x ???????±????????????????
???????????????????¨????????????°??????????????????????????£?????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????¨????????§???????????????????????¢
????????¨????????????
??????
K ???????¨????????????????????????¨???????????????????????¨????????§???????????????????????????????±????
???????????°????????????????????????
??\???
??\????????\????????¢?????§??????????????????
1 a b
?????????
2 c x
???????????°?????????1????????¨??????
??????a(1???a???N)??¨??????b(1???b???N)???????????¨?´???????????±??????????????????¨??????
??????????????????a???b??§?????????
???????????°?????????2????????¨??????
??????c(1???c???N)?????¨?´????x(1???x???M)???????±??????????????????¨????????????
????????¶???
??\?????????????????????????????????????§?????¶?????????????????????????
??????
?????????????????¨????????§??????????????????????????????????????????????????????????????????????????´???
??? 0 ???????????????????????????
http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2409100#1
*/
#include <stdio.h>
#include <string.h>
#define S_NUM 100000
#define C_NUM 100000
int n; // N ????????????
int m; // M ?¨?????????¨?´????
int k; // K ???????¨????
// ????????¨?´?????????\??£???????????????????????????????????????????????????
int s[ S_NUM + 1 ];
// ?????????????´????????????????????????¨?´?????????\??£???????????????????????????
// ??\??£???????????????????????????????????£???????????°???????????????????????§?????£
// ????????????????????¨?´??????????????????????????????°???-1 ??¨?????????
// ???????????????????????¨?´?????????\??£????????????????????????????????????????????????
int s2c[ S_NUM + 1 ];
// student to club
// ????????¨?´????????????????????????\??£????????????????????????????????????????????????
int c2s[ C_NUM + 1 ];
// club to student
/*
* x ?????¨?´????????????\???????????????????????¢???
* ????????¨?´????????????\??????????????????????????????????????????????????????????????° -1 ????????????
*/
int findClub(
int x )
{
int ret = -1;
int i = 0;
ret = c2s[ x ];
/*
for ( i = 1 ; i <= n ; i++ ) {
if ( s2c[ i ] == x ) {
ret = i;
break;
}
}
*/
// printf( "find club [%d] is %d\n", x, ret );
return ret; // ??¢??°?????????
}
/*
* a ??????????????§???????????£?????????????¢??????????
* ???????????????????????????????????¨?????? -1 ????????????
*/
int checkChain(
int a )
{
int ret = 0;
int club = s2c[ a ];
int idx = s[ a ];
// printf( "Chain chack %d(%d %d)->", a, idx, club );
// ?????§??????????????¨???????????§???????????????...
while ( idx != -1 ) {
// printf( "%d(%d %d)->", idx, s[ idx ], s2c[ idx ] );
if ( ( club != -1 ) && ( s2c[ idx ] == -1 ) ) {
// ????????¨?´??????¨??????????????????????????????????????¨?´????????????????????????£???
// ??? ??????????????§?¢???????????????????
s2c[ idx ] = club;
}
else if ( ( club != -1 ) && ( s2c[ idx ] != club ) ) {
// ???????????§????????????????????°????????¨?´?????????????????????????
ret = -1;
// printf( "!!! %d !!!", __LINE__ );
break;
}
else if ( ( club == -1 ) && ( s2c[ idx ] != -1 ) ) {
// ????????????????????¨?´??????????????????£??????????????§????????????????????¨?´???????
// ?¢????????????????????????????
// ??? ?????????????????????????????¨?????§????????????
a = idx;
club = s2c[ idx ];
}
idx = s[ idx ]; // ?¬???????????????????
if ( idx == a ) {
break; // ?????¨??????
}
}
// printf( "End.\n" );
return ret; // ??¢??°?????????
}
/*
* a ??¨ b ???????????¨?´?????????\??£???????????¨???????????§?????????????????????
* ???????????????????????????????????¨?????? -1 ????????????
*/
int clubChain(
int a,
int b )
{
int wa, wb;
wa = s[ a ];
wb = s[ b ];
if ( ( wa == -1 ) && ( wb == -1 ) ) {
// ?????????????????¨?´????
// printf( "(A) " );
s[ a ] = b;
s[ b ] = a;
}
else if ( ( wa != -1 ) && ( wb == -1 ) ) {
// a ????????¢???????????¨?´??????????????????? ??? a ??¨ wa ???????????????????????????
// printf( "(B) " );
s[ a ] = b; //
s[ b ] = wa;
}
else if ( ( wb != -1 ) && ( wa == -1 ) ) {
// b ????????¢???????????¨?´??????????????????? ??? b ??¨ wa ???????????????????????????
// printf( "(C) " );
s[ a ] = wb; //
s[ b ] = a;
}
else {
// printf( "(D) " );
// ?????????????????¢???????????¨?´???????????????????
while ( s[ wa ] != a ) {
wa = s[ wa ];
}
while ( s[ wb ] != b ) {
wb = s[ wb ];
}
s[ wa ] = b;
s[ wb ] = a;
}
// printf( "%d(%d) - %d(%d) is chain.\n", a, s[ a ], b, s[ b ] );
return checkChain( a ); // ??¢??°?????????
}
/*
* a ??¨ b ???????????¨?´?????????\??£????????????????????§????????????
* ???????????????????????????????????¨?????? -1 ????????????
*/
int clubSame(
int a,
int b )
{
int ret = 0;
// printf( "%d(%d) - %d(%d) is same club.\n", a, s[ a ], b, s[ b ] );
if ( ( s2c[ a ] != s2c[ b ] ) &&
( s2c[ a ] != -1 ) && ( s2c[ b ] != -1 ) ) {
// ???????????????????????¨?´?????????\??£??????????????§????????°?????????
ret = -1;
}
else if ( ( s2c[ a ] != -1 ) && ( s2c[ b ] == -1 ) ) {
// a ?????¨?´?????????\??£??????????????¨????¢??????????????????????b ??????????????£???
s2c[ b ] = s2c[ a ];
ret = clubChain( a, b );
}
else if ( ( s2c[ b ] != -1 ) && ( s2c[ a ] == -1 ) ) {
// b ?????¨?´?????????\??£??????????????¨????¢??????????????????????a ??????????????£???
s2c[ a ] = s2c[ b ];
ret = clubChain( b, a );
}
else if ( ( s2c[ b ] == -1 ) && ( s2c[ a ] == -1 ) ) {
// a ??? b ??????????????§???????±???????
ret = clubChain( a, b );
}
return ret; // ??¢??°?????????
}
/*
* ????????????????????????
*/
void init( void )
{
int i;
for ( i = 1 ; i <= n ; i++ ) {
s[ i ] = -1; // ?????????????????°??¨??????????????¨?´???????????±????????????????
s2c[ i ] = -1; // ??????????????????????????¨?´??????????????±????????????????
}
for ( i = 1 ; i <= m ; i++ ) {
c2s[ i ] = -1; // ????????¨?´????????????°???????±????????????????
}
return; // ??¢??°?????????
}
int main( void )
{
int t1, t2, t3;
int i, j;
int flag = -1;
scanf( "%d %d %d", &n, &m, &k );
init( );
for ( i = 0 ; i < k ; i++ ) {
scanf( "%d %d %d", &t1, &t2, &t3 );
// printf( "Line:%d %d %d %d\n", i + 1, t1, t2, t3 );
if ( t1 == 1 ) {
// ???????????°?????????1????????¨???????????? a(t2) ??¨?????? b(t3) ?????????
// ??¨?´???????????±??????????????????¨????????????
if ( ( t2 < 1 ) || ( t3 < 1 ) || ( t2 > n ) || ( t3 < n ) || ) {
flag = i + 1;
break;
}
else if ( clubSame( t2, t3 ) != 0 ) {
// printf( "!!! %d !!!", __LINE__ );
flag = i + 1;
break;
}
}
else {
// ???????????°?????????2????????¨???????????? c(t2) ?????¨?´???? x(t3) ??????
// ?±??????????????????¨????????????
if ( ( t2 < 1 ) || ( t3 < 1 ) || ( t2 > n ) || ( t3 < m ) || ) {
flag = i + 1;
break;
}
else if ( ( s2c[ t2 ] != -1 ) && ( s2c[ t2 ] != t3 ) ) {
// ??¢???????????¨?´???????????±??????????????????¨????????£?????????
// printf( "!!! %d !!!", __LINE__ );
flag = i + 1;
break;
}
j = findClub( t3 ); // x ?????¨?´?????????¢???????±????????????????????????¢???
if ( j == -1 ) {
// ????????¨?´???????????±?????????????????????????????¢??????????????????????
c2s[ t3 ] = t2;
s2c[ t2 ] = t3;
if ( checkChain( t2 ) != 0 ) {
// printf( "!!! %d !!!", __LINE__ );
flag = i + 1;
break;
}
}
else {
// ????????¨?´???????????±???????????????????????????§?????????????????????
s2c[ t2 ] = t3;
if ( checkChain( j ) != 0 ) {
// printf( "!!! %d !!!", __LINE__ );
flag = i + 1;
break;
}
}
}
// for ( j = 1 ; j <= n ; j++ ) {
// printf( "%3d ", s2c[ j ] );
// }
// printf( "\n" );
}
if ( flag == -1 ) {
printf( "0\n" );
}
else {
printf( "%d\n", flag );
}
return 0;
} | main.c: In function 'main':
main.c:270:86: error: expected expression before ')' token
270 | if ( ( t2 < 1 ) || ( t3 < 1 ) || ( t2 > n ) || ( t3 < n ) || ) {
| ^
main.c:283:86: error: expected expression before ')' token
283 | if ( ( t2 < 1 ) || ( t3 < 1 ) || ( t2 > n ) || ( t3 < m ) || ) {
| ^
|
s863046487 | p00316 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,k;
vector<int> club;
struct uf{
vector<int> par,ran;
uf(int N){
init(N);
}
void init(int a){
par.resize(a);
ran.resize(a,0);
for(int i=0;i<a;i++){
par[i]=i;
}
}
int find(int x){
return x==par[x]?x:par[x]=find(par[x]);
}
bool same(int x,int y){
return find(x)==find(y);
}
void unite(int x,int y){
x=find(x);y=find(y);
if(x!=y){
if(ran[x]<ran[y]){
par[x]=y;
}else{
par[y]=x;
if(ran[x]==ran[y]){
ran[x]++;
}
}
}
}
bool setclub(int nm,int cl){
if(club[nm]!=-1&&club[nm]!=cl){
return false;
}else if(par[nm]==nm){
club[nm]=cl;
return true;
}else{
club[nm]=cl;
if(setclub(par[nm],cl)){
return true;
}else{
return false;
}
}
}
};
int main(){
cin>>n>>m>>k;
club.resize(n,-1);
uf u(n);
int c=1;
while(k--){
int q,x,y;
cin>>q>>x>>y;
if(q==0){
if(club[x]!=club[y]){
cout<<c<<endl;
return 0;
}
u.unite(x,y);
if(club[x]==-1&&club[y]==-1){
continue;
}else if(club[y]==-1){
if(!u.setclub(y,club[x])){
cout<<c<<endl;
return 0;
}
}else if(club[x]==—1){
if(!u.setclub(x,club[y])){
cout<<c<<endl;
return 0;
}
}
}else{
if(club[x]!=-1&&club[x]!=y){
cout<<c<<endl;
return 0;
}else if(club[x]==-1){
if(!u.setclub(x,y)){
cout<<c<<endl;
return 0;
}
}
}
c++;
}
cout<<0<<endl;
return 0;
}
| a.cc:74:31: error: extended character — is not valid in an identifier
74 | }else if(club[x]==—1){
| ^
a.cc: In function 'int main()':
a.cc:74:31: error: '\U000020141' was not declared in this scope
74 | }else if(club[x]==—1){
| ^~
|
s940783134 | p00316 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,k;
vector<int> club;
struct uf{
vector<int> par,ran;
uf(int N){
init(N);
}
void init(int a){
par.resize(a);
ran.resize(a,0);
for(int i=0;i<a;i++){
par[i]=i;
}
}
int find(int x){
return x==par[x]?x:par[x]=find(par[x]);
}
bool same(int x,int y){
return find(x)==find(y);
}
void unite(int x,int y){
x=find(x);y=find(y);
if(x!=y){
if(ran[x]<ran[y]){
par[x]=y;
}else{
par[y]=x;
if(ran[x]==ran[y]){
ran[x]++;
}
}
}
}
bool setclub(int nm,int cl){
if(club[nm]!=-1&&club[nm]!=cl){
return false;
}else if(par[nm]==nm){
club[nm]=cl;
return true;
}else{
club[nm]=cl;
if(setclub(par[nm],cl)){
return true;
}else{
return false;
}
}
}
};
int main(){
cin>>n>>m>>k;
club.resize(n,-1);
uf u(n);
int c=1;
while(k--){
int q,x,y;
cin>>q>>x>>y;
if(q==0){
if(club[x]!=club[y]){
cout<<c<<endl;
return 0;
}
u.unite(x,y);
if(club[x]==-1&&club[y]==-1){
continue;
}else if(club[y]==-1){
if(!u.setclub(y,club[x])){
cout<<c<<endl;
return 0;
}
}else if(club[x]==—1){
if(!u.setclub(x,club[y])){
cout<<c<<endl;
return 0;
}
}
}else{
if(club[x]!=-1&&club[x]!=y){
cout<<c<<endl;
return 0;
}else if(club[x]==-1){
if(!u.setclub(x,y)){
cout<<c<<endl;
return 0;
}
}
}
c++;
}
cout<<0<<endl;
return 0;
}
| a.cc:74:31: error: extended character — is not valid in an identifier
74 | }else if(club[x]==—1){
| ^
a.cc: In function 'int main()':
a.cc:74:31: error: '\U000020141' was not declared in this scope
74 | }else if(club[x]==—1){
| ^~
|
s388424408 | p00316 | C++ |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;
int par[100010], rk[100010],club[100010];
void init(int n) {
for (int i = 1; i <= n; i++) {
par[i] = i;
rk[i] = 0;
}
}
int find(int x) {
if (par[x] == x)return x;
else
return par[x] = find(par[x]);
}
void unite(int x, int y) {
x = find(x);
y = find(y);
if (x == y)return;
if (rk[x] < rk[y])
par[x] = y;
else {
par[y] = x;
if (rk[x] == rk[y])rk[x]++;
}
}
bool same(int x, int y) {
return find(x) == find(y);
}
int main()
{
int n, m, k,ans=0;
bool flag = true;
cin >> n >> m >> k;
for (int i = 0; i < n; i++)
club[i] = -1;
init(n);
for (int i = 0; i < k; i++) {
int a, b, c;
cin >> a >> b >> c;
if (!flag)continue;
if (a == 1) {
b = find(b);
c = find(c);
if ((club[b] != -1 && club[c] != -1) && club[b] != club[c]) {
ans = i + 1;
flag = false;
}
}
else if (a == 2) {
b = find(b);
if (club[b] != -1 && club[b] != c) {
ans = i + 1;
flag = false;
club[b] = c;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:90:2: error: expected '}' at end of input
90 | }
| ^
a.cc:59:1: note: to match this '{'
59 | {
| ^
|
s773118331 | p00316 | C++ | //0321 部活動調査
//UF木
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
int root(int x){
if(x!=node[x]){
node[x]=return root(node[x]);
}
else return x;
}
int main(void)
{
LL i,j,n,m,k;
cin>>n>>m>>k;
for(i=0;i<k;i++) cin>>bol[i]>>r1[i]>>r2[i];
for(i=0;i<n;i++) club[i]=0,node[i]=i,size[i]=1;
for(i=0;i<k;i++) {
int x,y,c,s;
if(bol[i]==1) {
x=r1[i],y=r2[i];
x=root(x);
y=root(y);
if(club[x]!=0&&club[y]!=0&&club[x]!=club[y]) {
cout<<i+1<<endl;
break;
}
else if(club[x]!=0&&club[y]==0) club[y]=club[x];
else if(club[x]==0&&club[y]!=0) club[x]=club[y];
if(x!=y) {
if(size[x]>size[y]) node[y]=x;
else if(size[y]>size[x]) node[x]=y;
else node[y]=x,size[x]++;
}
}
else {
s=r1[i],c=r2[i];
s=root(s);
if(club[s]==0) club[s]=c;
else if(club[s]!=c) {
cout<<i+1<<endl;
break;
}
}
}
if(i==k) cout<<"0"<<endl;
} | a.cc: In function 'int root(int)':
a.cc:9:25: error: expected primary-expression before 'return'
9 | node[x]=return root(node[x]);
| ^~~~~~
a.cc: In function 'int main()':
a.cc:18:46: error: reference to 'size' is ambiguous
18 | for(i=0;i<n;i++) club[i]=0,node[i]=i,size[i]=1;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:3:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc:32:36: error: reference to 'size' is ambiguous
32 | if(size[x]>size[y]) node[y]=x;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc:32:44: error: reference to 'size' is ambiguous
32 | if(size[x]>size[y]) node[y]=x;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc:33:41: error: reference to 'size' is ambiguous
33 | else if(size[y]>size[x]) node[x]=y;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc:33:49: error: reference to 'size' is ambiguous
33 | else if(size[y]>size[x]) node[x]=y;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc:34:48: error: reference to 'size' is ambiguous
34 | else node[y]=x,size[x]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:6:64: note: 'long long int size [100010]'
6 | LL bol[200010],r1[200010],r2[200010],club[100010],node[100010],size[100010];
| ^~~~
a.cc: In function 'int root(int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
12 | }
| ^
|
s771899475 | p00317 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
struct Node
{
int N1 = 0;
int N2 = 0;
Node *C[26] = {};
};
void add(Node *node, string str, int p)
{
node->N2++;
if (p < str.length())
{
if (node->C.count(str[p]-'a') == 0)
node->C[str[p]-'a'] = new Node;
add(node->C[str[p]-'a'], str, p+1);
}
else
{
node->N1++;
}
}
string rev(string str)
{
reverse(str.begin(), str.end());
return str;
}
int count(Node *node, string str, int p)
{
if (str[p] == '*')
return node->N2;
else if (p>=str.length())
return node->N1;
else if (str[p] == '?')
{
int ans = 0;
for (int i=0; i<26; i++)
if (node->C.count(i) > 0)
ans += count(node->C[i], str, p+1);
return ans;
}
else
{
if (node->C.count(str[p]-'a'))
return count(node->C[str[p]-'a'], str, p+1);
else
return 0;
}
}
int main()
{
int N, M;
cin>>N>>M;
Node NL, NR;
for (int i=0; i<N; i++)
{
string str;
cin>>str;
add(&NL, str, 0);
add(&NR, rev(str), 0);
}
for (int i=0; i<M; i++)
{
string str;
cin>>str;
if (str[0]=='*')
cout<<count(&NR, rev(str), 0)<<endl;
else
cout<<count(&NL, str, 0)<<endl;
}
} | a.cc: In function 'void add(Node*, std::string, int)':
a.cc:23:21: error: request for member 'count' in 'node->Node::C', which is of non-class type 'Node* [26]'
23 | if (node->C.count(str[p]-'a') == 0)
| ^~~~~
a.cc: In function 'int count(Node*, std::string, int)':
a.cc:49:25: error: request for member 'count' in 'node->Node::C', which is of non-class type 'Node* [26]'
49 | if (node->C.count(i) > 0)
| ^~~~~
a.cc:55:21: error: request for member 'count' in 'node->Node::C', which is of non-class type 'Node* [26]'
55 | if (node->C.count(str[p]-'a'))
| ^~~~~
a.cc:60:1: warning: control reaches end of non-void function [-Wreturn-type]
60 | }
| ^
|
s383970585 | p00317 | C++ | #include<cstdio>
#include<algorithm>
#include<vector>
#include<deque>
#include<stack>
#include<queue>
#include<string>
#include<iostream>
#include<tuple>
#include<utility>
#include<set>
#include<queue>
#include<iomanip>
#include<iterator>
//#include<chrono>
#include<random>
using namespace std;
typedef long long int llint;
const int big=1e9+100000;
const int mod=1e9+7;
const long double pai=3.141592653589793238462643;
#define mt make_tuple
#define mp make_pair
#define fir first
#define sec second
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define res resize
#define ins insert
#define era erase
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
int main(void){
int i,n,m;
cin>>n>>m;
vector<string>word(n);
vector<string>drow(n);
for(i=0;i<n;i++){cin>>word[i];drow[i]=word[i];reverse(drow[i].begin(),drow[i].end());}
sort(word.begin(),word.end());
sort(drow.begin(),drow.end());
for(i=0;i<m;i++){
string sla;cin>>sla;
int ans=0,bas=-1,rec=0,kak=0;
if(sla[0]=='*'){reverse(sla.begin(),sla.end());rec=1;}
if(sla.back()=='*'){kak++;sla.pob();}
for(int j=0;j<sla.size();j++){
if(sla[j]=='?'){bas=j;break;}
}
string slap=sla;
for(char c='a';c<='z';c++){
if(bas!=-1){sla[bas]=c;slap[bas]=c;}
slap.back()++;
if(kak==1){
if(rec==0){ans+=lower_bound(word.begin(),word.end(),slap)-lower_bound(word.begin(),word.end(),sla);}
else{ans+=lower_bound(drow.begin(),drow.end(),slap)-lower_bound(drow.begin(),drow.end(),sla);}
}else{
auto it=lower_bound(word.begin(),word.end(),sla)
if(it!=word.end()&&(*it)==sla){ans++;}
}
slap.back()--;
}
if(bas==-1){ans/=26;}
cout<<ans<<endl;
}
} | a.cc: In function 'int main()':
a.cc:60:33: error: expected ',' or ';' before 'if'
60 | if(it!=word.end()&&(*it)==sla){ans++;}
| ^~
|
s101531730 | p00318 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MAX_N 100001
int n;
double X[MAX_N],R[MAX_N];
bool check(double y){
double l=-1e9;
double r=1e9;
for(int i=0;i<n;i++){
double a=X[i]- sqrt(R[i]*R[i]-y*y);
l=max(l,a);
double b=X[i]+ sqrt(R[i]*R[i]-y*y);
r=min(r,b);
}
return (l<r);
}
int main(){
double left=0,right=1e9,mid;
cin>>n;
for(int i=0;i<n;i++){
int x,r;
cin>>x>>r;
X[i]=x;
R[i]=r;
right=min(right,R[i]);
}
for(int i=0;i<100;i++){
mid=(left+right)*0.5;
if(check(mid))left=mid;
else right=mid;
}
printf("%.10f\n",left);
| a.cc: In function 'int main()':
a.cc:38:26: error: expected '}' at end of input
38 | printf("%.10f\n",left);
| ^
a.cc:19:11: note: to match this '{'
19 | int main(){
| ^
|
s786483999 | p00318 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define F first
#define S second
typedef pair<double, double> P;
int N, wh;
double kh;
P prev, next, next2, xr[100000];
double nx, ny;
P cross(int le, int ri)
{
double xx = (xr[le].S + xr[ri].S) / 2 + (xr[ri].F * xr[ri].F - xr[le].F * xr[le].F) / (2 * (xr[le].S - xr[ri].S));
double yy = sqrt(xr[le].F * xr[le].F - (xx - xr[le].S) * (xx - xr[le].S));
return MP(xx, yy);
}
int main()
{
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> xr[i].S >> xr[i].F;
}
sort(xr, xr + N);
prev = MP(xr[0].S, xr[0].F); // (x, r)
for(int i = 1; i < N; i++)
{
next = next2 = MP(INT_MAX, INT_MAX);
if(prev.F < xr[i].S)
next = cross(i, left);
if(prev.F > xr[i].S)
next2 = cross(i, right);
if(next.S < prev.S && next.F > prev.F)
{
prev = next;
}
if(next2.S < prev.S && next2.F < prev.F)
{
prev = next;
}
}
printf("%.10f\n", prev.S);
} | a.cc: In function 'int main()':
a.cc:25:9: error: reference to 'prev' is ambiguous
25 | prev = MP(xr[0].S, xr[0].F); // (x, r)
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
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_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:28:17: error: reference to 'next' is ambiguous
28 | next = next2 = MP(INT_MAX, INT_MAX);
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:29:20: error: reference to 'prev' is ambiguous
29 | if(prev.F < xr[i].S)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:30:25: error: reference to 'next' is ambiguous
30 | next = cross(i, left);
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:30:41: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
30 | next = cross(i, left);
| ^~~~
| |
| std::ios_base& (*)(std::ios_base&)
a.cc:11:21: note: initializing argument 2 of 'P cross(int, int)'
11 | P cross(int le, int ri)
| ~~~~^~
a.cc:31:20: error: reference to 'prev' is ambiguous
31 | if(prev.F > xr[i].S)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:32:42: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
32 | next2 = cross(i, right);
| ^~~~~
| |
| std::ios_base& (*)(std::ios_base&)
a.cc:11:21: note: initializing argument 2 of 'P cross(int, int)'
11 | P cross(int le, int ri)
| ~~~~^~
a.cc:33:20: error: reference to 'next' is ambiguous
33 | if(next.S < prev.S && next.F > prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:33:29: error: reference to 'prev' is ambiguous
33 | if(next.S < prev.S && next.F > prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:33:39: error: reference to 'next' is ambiguous
33 | if(next.S < prev.S && next.F > prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:33:48: error: reference to 'prev' is ambiguous
33 | if(next.S < prev.S && next.F > prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:35:25: error: reference to 'prev' is ambiguous
35 | prev = next;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:35:32: error: reference to 'next' is ambiguous
35 | prev = next;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:37:30: error: reference to 'prev' is ambiguous
37 | if(next2.S < prev.S && next2.F < prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:37:51: error: reference to 'prev' is ambiguous
37 | if(next2.S < prev.S && next2.F < prev.F)
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:39:25: error: reference to 'prev' is ambiguous
39 | prev = next;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:39:32: error: reference to 'next' is ambiguous
39 | prev = next;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:9:9: note: 'P next'
9 | P prev, next, next2, xr[100000];
| ^~~~
a.cc:42:27: error: reference to 'prev' is ambiguous
42 | printf("%.10f\n", prev.S);
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:9:3: note: 'P prev'
9 | P prev, next, next2, xr[100000];
| ^~~~
|
s646813733 | p00320 | C++ | using namespace std;
int main(){
int a2,a4,a6,b2,b4,b6,c,q,i,j,z=0,k=1,m[1000][1000]={0};
int a[1000]={0},b[1000]={0},w[1000]={0},e[5][2]={0};
for(a2=a4=a6=b2=b4=b6=i=0;i<6;i++){
cin>>q>>c;
w[q]++;
w[c]++;
if(q>c)m[q][c]++;
else m[c][q]++;
}
for(i=0;i<1000;i++){
for(j=0;j<1000;j++){
if(m[i][j]){a[j]+=m[i][j];b[i]+=m[i][j];
if(m[i][j]==4){ e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
else if(m[i][j]==6){ e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
else{ e[z][0]=i;e[z++][1]=j;}
}
}
}
if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
for(i=0;i<1000;i++){
if(w[i]%4)k=0;
if(a[i]==4)a4++;
if(a[i]==2)a2++;
if(a[i]==6)a6++;
if(b[i]==4)b4++;
if(b[i]==2)b2++;
if(b[i]==6)b6++;
}
if(a4&&a2&&b4&&b2&&k||a6&&b4&&b2&&k||b6&&a4&&a2&&k||b6&&a6&&k)cout<<"yes"<<endl;
else cout<<"no"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin>>q>>c;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:31:65: error: 'cout' was not declared in this scope
31 | if(a4&&a2&&b4&&b2&&k||a6&&b4&&b2&&k||b6&&a4&&a2&&k||b6&&a6&&k)cout<<"yes"<<endl;
| ^~~~
a.cc:31:65: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:78: error: 'endl' was not declared in this scope
31 | if(a4&&a2&&b4&&b2&&k||a6&&b4&&b2&&k||b6&&a4&&a2&&k||b6&&a6&&k)cout<<"yes"<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
a.cc:32:8: error: 'cout' was not declared in this scope
32 | else cout<<"no"<<endl;
| ^~~~
a.cc:32:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:20: error: 'endl' was not declared in this scope
32 | else cout<<"no"<<endl;
| ^~~~
a.cc:32:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s003495875 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int c,b,i,j,z=0,k=1,m[1001][1001]={0},e[6][2]={0};
for(i=0;i<6;i++){
cin>>b>>c;
if(b>c)m[b][c]++;
else m[c][b]++;
}
for(i=0;i<1001;i++)for(j=0;j<1001;j++){
if(m[i][j]==6){e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
else if(m[i][j]==4){e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
else{e[z][0]=i;e[z++][1]=j;}
}
}
if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1]||o>3)k=0;
if(k)cout<<"yes"<<endl;
else cout<<"no"<<endl;
} | a.cc:16:3: error: expected unqualified-id before 'if'
16 | if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1]||o>3)k=0;
| ^~
a.cc:17:3: error: expected unqualified-id before 'if'
17 | if(k)cout<<"yes"<<endl;
| ^~
a.cc:18:3: error: expected unqualified-id before 'else'
18 | else cout<<"no"<<endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s415224284 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
????for(i=0;i<6;i++){
????????cin>>q>>c;
????????w[q]++;
????????w[c]++;
????????if(q>c)m[q][c]++;
????????else m[c][q]++;
????}
????for(i=0;i<1001;i++){
????????if(w[i])o++;
????????????for(j=0;j<1001;j++){
????????????????if(m[i][j])for(o=0;o<m[i][j]/2){e[z][0]=i;e[z++][1]=j;}
??????????????}
????????}
????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
????if(k)cout<<"yes"<<endl;
????else cout<<"no"<<endl;
????return 0;
} | a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:2: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:3: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:4: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:5:1: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:4: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:20: error: expected primary-expression before ',' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:21: error: 'b' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:33: error: 'w' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:45: error: 'e' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:4: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:13: error: 'i' was not declared in this scope
6 | ????for(i=0;i<6;i++){
| ^
a.cc:13:1: error: expected primary-expression before '?' token
13 | ????for(i=0;i<1001;i++){
| ^
a.cc:13:2: error: expected primary-expression before '?' token
13 | ????for(i=0;i<1001;i++){
| ^
a.cc:13:3: error: expected primary-expression before '?' token
13 | ????for(i=0;i<1001;i++){
| ^
a.cc:13:4: error: expected primary-expression before '?' token
13 | ????for(i=0;i<1001;i++){
| ^
a.cc:13:5: error: expected primary-expression before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:13:5: error: expected ':' before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:13:5: error: expected primary-expression before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:13:5: error: expected ':' before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:13:5: error: expected primary-expression before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:13:5: error: expected ':' before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:13:5: error: expected primary-expression before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:13:5: error: expected ':' before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:13:5: error: expected primary-expression before 'for'
13 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:19:1: error: expected primary-expression before '?' token
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:19:2: error: expected primary-expression before '?' token
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:19:3: error: expected primary-expression before '?' token
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:19:4: error: expected primary-expression before '?' token
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:19:5: error: expected primary-expression before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:19:5: error: expected ':' before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:19:5: error: expected primary-expression before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:19:5: error: expected ':' before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:19:5: error: expected primary-expression before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:19:5: error: expected ':' before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:19:5: error: expected primary-expression before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:19:5: error: expected ':' before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:19:5: error: expected primary-expression before 'if'
19 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:20:1: error: expected primary-expression before '?' token
20 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:20:2: error: expected primary-expression before '?' token
20 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:20:3: error: expected primary-expression before '?' token
20 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:20:4: error: expected primary-expression before '?' token
20 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:20:5: error: expected primary-expres |
s884196948 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
for(i=0;i<6;i++){
cin>>q>>c;
w[q]++;
w[c]++;
if(q>c)m[q][c]++;
else m[c][q]++;
}
for(i=0;i<1001;i++){
if(w[i])o++;
for(j=0;j<1001;j++){
if(m[i][j])for(o=0;o<m[i][j]/2){e[z][0]=i;e[z++][1]=j;}
}
}
if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
if(k)cout<<"yes"<<endl;
else cout<<"no"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before ')' token
16 | if(m[i][j])for(o=0;o<m[i][j]/2){e[z][0]=i;e[z++][1]=j;}
| ^
| ;
|
s397061220 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
for(i=0;i<6;i++){
cin>>q>>c;
w[q]++;
w[c]++;
if(q>c)m[q][c]++;
else m[c][q]++;
}
for(i=0;i<1001;i++){
if(w[i])o++;
for(j=0;j<1001;j++){
if(m[i][j])for(o=0;o<m[i][j]/2){e[z][0]=i;e[z++][1]=j;}
}
}
if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
if(k)cout<<"yes"<<endl;
else cout<<"no"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before ')' token
16 | if(m[i][j])for(o=0;o<m[i][j]/2){e[z][0]=i;e[z++][1]=j;}
| ^
| ;
|
s201834552 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
????for(i=0;i<6;i++){
????????cin>>q>>c;
????????if(q>c)m[q][c]++;
????????else m[c][q]++;
????}
????for(i=0;i<1001;i++){
????????????for(j=0;j<1001;j++){
????????????????if(m[i][j]){
????????????if(m[i][j]==4){e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
????????????else if(m[i][j]==6){e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;e[z][0]=i;e[z++][1]=j;}
????????????else{ e[z][0]=i;e[z++][1]=j;}
????????}
??????????????}
????????}
????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
????if(k)cout<<"yes"<<endl;
????else cout<<"no"<<endl;
????return 0;
} | a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:2: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:3: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:4: error: expected primary-expression before '?' token
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:4:5: error: expected ':' before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
| :
a.cc:4:5: error: expected primary-expression before 'int'
4 | ????int c,q,i,j,z=0,k=1,o=0,m[1001][1001]={0};
| ^~~
a.cc:5:1: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:4: error: expected primary-expression before '?' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:5: error: expected ':' before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
| :
a.cc:5:5: error: expected primary-expression before 'int'
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^~~
a.cc:5:20: error: expected primary-expression before ',' token
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:21: error: 'b' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:33: error: 'w' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:5:45: error: 'e' was not declared in this scope
5 | ????int a[1001]={0},b[1001]={0},w[1001]={0},e[6][2]={0};
| ^
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:4: error: expected primary-expression before '?' token
6 | ????for(i=0;i<6;i++){
| ^
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:5: error: expected ':' before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
| :
a.cc:6:5: error: expected primary-expression before 'for'
6 | ????for(i=0;i<6;i++){
| ^~~
a.cc:6:13: error: 'i' was not declared in this scope
6 | ????for(i=0;i<6;i++){
| ^
a.cc:11:1: error: expected primary-expression before '?' token
11 | ????for(i=0;i<1001;i++){
| ^
a.cc:11:2: error: expected primary-expression before '?' token
11 | ????for(i=0;i<1001;i++){
| ^
a.cc:11:3: error: expected primary-expression before '?' token
11 | ????for(i=0;i<1001;i++){
| ^
a.cc:11:4: error: expected primary-expression before '?' token
11 | ????for(i=0;i<1001;i++){
| ^
a.cc:11:5: error: expected primary-expression before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:11:5: error: expected ':' before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:11:5: error: expected primary-expression before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:11:5: error: expected ':' before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:11:5: error: expected primary-expression before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:11:5: error: expected ':' before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:11:5: error: expected primary-expression before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:11:5: error: expected ':' before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
| :
a.cc:11:5: error: expected primary-expression before 'for'
11 | ????for(i=0;i<1001;i++){
| ^~~
a.cc:20:1: error: expected primary-expression before '?' token
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:20:2: error: expected primary-expression before '?' token
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:20:3: error: expected primary-expression before '?' token
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:20:4: error: expected primary-expression before '?' token
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:20:5: error: expected ':' before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
| :
a.cc:20:5: error: expected primary-expression before 'if'
20 | ????if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:21:1: error: expected primary-expression before '?' token
21 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:21:2: error: expected primary-expression before '?' token
21 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:21:3: error: expected primary-expression before '?' token
21 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:21:4: error: expected primary-expression before '?' token
21 | ????if(k)cout<<"yes"<<endl;
| ^
a.cc:21:5: error: expected primary-expression before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:21:5: error: expected ':' before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:21:5: error: expected primary-expression before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:21:5: error: expected ':' before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:21:5: error: expected primary-expression before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:21:5: error: expected ':' before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:21:5: error: expected primary-expression before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
a.cc:21:5: error: expected ':' before 'if'
21 | ????if(k)cout<<"yes"<<endl;
| ^~
| :
a.cc:21:5: error: expected primary-expres |
s479774098 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int c,q,i,j,z=0,k=1,m[1001][1001]={0},e[6][2]={0};
for(i=0;i<6;i++){
cin>>q>>c;
if(q>c)m[q][c]++;
else m[c][q]++;
}
for(i=0;i<1001;i++)for(j=0;j<1001;j++){
if(m[i][j]&&m[i][j]%2==0)for(c=0;c<m[i][j]/2;c++){e[z][0]=i;e[z++][1]=j;}
}
}
if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
if(k)cout<<"yes"<<endl;
else cout<<"no"<<endl;
} | a.cc:14:3: error: expected unqualified-id before 'if'
14 | if(e[0][0]!=e[2][1]||e[1][0]!=e[2][0]||e[0][1]!=e[1][1])k=0;
| ^~
a.cc:15:3: error: expected unqualified-id before 'if'
15 | if(k)cout<<"yes"<<endl;
| ^~
a.cc:16:3: error: expected unqualified-id before 'else'
16 | else cout<<"no"<<endl;
| ^~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s267534378 | p00320 | C++ | #include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
int n,i;
vector<pair<int,int> >v(6);
for(i=0;i<6;i++){
scanf("%d%d",&v[i].first,&v[i].second);
if(v[i].first>v[i].second)swap(v[i].first,v[i].second);
}
sort(v.begin(),v.end());
puts(v[0]==v[1] && v[2]==v[3] && v[4]==v[5] ? "yes" : "no");
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf' was not declared in this scope
9 | scanf("%d%d",&v[i].first,&v[i].second);
| ^~~~~
a.cc:13:9: error: 'puts' was not declared in this scope
13 | puts(v[0]==v[1] && v[2]==v[3] && v[4]==v[5] ? "yes" : "no");
| ^~~~
|
s142195661 | p00320 | C++ | #include "stdafx.h"
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
int main() {
vector<P>v;
for (int i = 0;i < 6;i++) {
int a, b;
cin >> a >> b;
v.push_back(make_pair(max(a, b), min(a, b)));
}
sort(v.begin(), v.end());
if (v[0] == v[1] && v[2] == v[3] && v[4] == v[5]) {
vector<int>num;
for (int i = 0;i < 3;i++) {
num.push_back(v[i * 2].first);
num.push_back(v[i * 2].second);
}
sort(num.begin(), num.end());
if (num[0] == num[1] && num[2] == num[3] && num[4] == num[5])cout << "yes" << endl;
else cout << "no" << endl;
}
else cout << "no" << endl;
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s180387682 | p00320 | C++ | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main(void){
std::map<pair<int,int>,bool > m;
int a,b;
for(int i=0;i<6;i++){
cin>>a>>b;
if(s[make_pair(a,b)]){
cout<<"no"<<endl;
return 0;
}
s[make_pair(a,b)]=true;
}
if(m.size()==3)cout<<"yes"<<endl;
else cout<<"no"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:20: error: 's' was not declared in this scope
11 | if(s[make_pair(a,b)]){
| ^
a.cc:15:17: error: 's' was not declared in this scope
15 | s[make_pair(a,b)]=true;
| ^
|
s839368576 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
pair<int,int> a[6];for(int i=0;i<6;i++){
cin>>a[i].first>>a[i].second;
if(a[i].first>a[i].second){
int tmp=a[i].first;
a[i].first=a[i].second;
a[i].second=tmp;
}
}
sort(a,a+6);
set<int>s;
if(a[0]==a[1]){
s.insert(a[0].sirst);
s.insert(a[1].second);
if(a[2]==a[3]){
s.insert(a[2].sirst);
s.insert(a[3].second);
if(a[4]==a[5]){
s.insert(a[4].sirst);
s.insert(a[5].second);
if(s.size()<=3)out<<"yes\n";
else cout<<"no\n";
}cout<<"no\n";
}cout<<"no\n";
}cout<<"no\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:15:31: error: 'struct std::pair<int, int>' has no member named 'sirst'; did you mean 'first'?
15 | s.insert(a[0].sirst);
| ^~~~~
| first
a.cc:18:39: error: 'struct std::pair<int, int>' has no member named 'sirst'; did you mean 'first'?
18 | s.insert(a[2].sirst);
| ^~~~~
| first
a.cc:21:47: error: 'struct std::pair<int, int>' has no member named 'sirst'; did you mean 'first'?
21 | s.insert(a[4].sirst);
| ^~~~~
| first
a.cc:23:48: error: 'out' was not declared in this scope
23 | if(s.size()<=3)out<<"yes\n";
| ^~~
|
s804105169 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
pair<int,int> a[6];for(int i=0;i<6;i++){
cin>>a[i].first>>a[i].second;
if(a[i].first>a[i].second){
int tmp=a[i].first;
a[i].first=a[i].second;
a[i].second=tmp;
}
}
sort(a,a+6);
set<int>s;
if(a[0]==a[1]){
s.insert(a[0].first);
s.insert(a[1].second);
if(a[2]==a[3]){
s.insert(a[2].first);
s.insert(a[3].second);
if(a[4]==a[5]){
s.insert(a[4].first);
s.insert(a[5].second);
if(s.size()<=3)out<<"yes\n";
else cout<<"no\n";
}cout<<"no\n";
}cout<<"no\n";
}cout<<"no\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:23:48: error: 'out' was not declared in this scope
23 | if(s.size()<=3)out<<"yes\n";
| ^~~
|
s257789504 | p00320 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
pair<int,int> a[6];for(int i=0;i<6;i++){
cin>>a[i].first>>a[i].second;
if(a[i].first>a[i].second){
int tmp=a[i].first;
a[i].first=a[i].second;
a[i].second=tmp;
}
}
sort(a,a+6);
set<int>s;
if(a[0]==a[1]){
s.insert(a[0].first);
s.insert(a[1].second);
if(a[2]==a[3]){
s.insert(a[2].first);
s.insert(a[3].second);
if(a[4]==a[5]){
s.insert(a[4].first);
s.insert(a[5].second);
if(s.size()==1)cout<<"yes\n";
else if(s.size()==2){
if(s[0]==s[2]&&s[2]==s[4])cout<<"no\n";
else cout<<"yes\n";
}
else if(s.size()==3){
for(int i=0;i<6;i++){
if(s[i].first==s[i].second){
cout<<"no\n";
return 0;
}
}
cout<<"yes\n";
}
else cout<<"no\n";
}else cout<<"no\n";
}else cout<<"no\n";
}else cout<<"no\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:25:45: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
25 | if(s[0]==s[2]&&s[2]==s[4])cout<<"no\n";
| ^
a.cc:25:51: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
25 | if(s[0]==s[2]&&s[2]==s[4])cout<<"no\n";
| ^
a.cc:25:57: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
25 | if(s[0]==s[2]&&s[2]==s[4])cout<<"no\n";
| ^
a.cc:25:63: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
25 | if(s[0]==s[2]&&s[2]==s[4])cout<<"no\n";
| ^
a.cc:30:53: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
30 | if(s[i].first==s[i].second){
| ^
a.cc:30:65: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
30 | if(s[i].first==s[i].second){
| ^
|
s049919732 | p00320 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
class plane{
public:
int w,h;
};
bool operator==(plane &a,plane &b){
if(a.h>a.w){
swap(a.h,a.w);
}
if(b.h>b.w){
swap(b.h,b.w);
}
return a.h==b.h&&a.w==b.w;
}
bool func(vector<plane> &);
int main(){
vector<plane> line(6);
for(int i=0;i<6;++i){
cin>>line[i].h>>line[i].w;
}
cout<<(func(line)?"yes":"no")<<endl;
return 0;
}
bool func(vector<plane> &line){
int pair=-1;
for(int i=1;i<6;++i){
if(line[i]==line[0]){
pair=i;
breka;
}
}
if(pair==-1){
return false;
}
swap(line[1],line[pair]);
for(int i=3;i<6;++i){
swap(line[i],line[3]);
if(line[2]==line[3]&&line[4]==line[5]){
return true;
}
swap(line[i],line[3]);
}
return false;
} | a.cc: In function 'bool func(std::vector<plane>&)':
a.cc:35:25: error: 'breka' was not declared in this scope
35 | breka;
| ^~~~~
|
s380126670 | p00320 | C++ | #include <stdio.h>
#include <vector>
using namespace std;
#define PB push_back
struct b{
int h;
int w;
bool operator ==(const b &a){return (h==a.h&&w==a.w)||(h==a.w&&w==a.h);}
void in(){
scanf("%d%d",&h,&w);
return ;
}
void reset(){
h=w=0;
return ;
}
bool check(){return h!=0&&w!=0;}
void operator =(const b &a){
h=a.h;
w=a.w;
return ;
}
};
void swap(const b &a,const b &r){
b temp=a;
a=r;
r=temp;
return ;
}
int main(){
vector<b> v;
b a[6];
bool f;
for(int i=0;i<6;i++)a[i].in();
for(int i=0;i<6;i++)if(a[i].check()){
f=false;
for(int j=i+1;j<6;j++)if(a[j]==a[i]){
f=true;
v.PB(a[i]);
a[i].reset();
a[j].reset();
break;
}
if(!f){
printf("no\n");
return 0;
}
}
for(int i=0;i<2;i++){
if(v[0].h==v[1].h&&v[1].w==v[2].h&&v[2].w==v[0].w){
printf("yes\n");
return 0;
}
else if(v[0].h==v[1].h&&v[1].w==v[2].w&&v[2].h==v[0].w){
printf("yes\n");
return 0;
}
else if(v[0].h==v[1].w&&v[1].h==v[2].h&&v[2].w==v[0].w){
printf("yes\n");
return 0;
}
else if(v[0].h==v[1].w&&v[1].h==v[2].w&&v[2].h==v[0].w){
printf("yes\n");
return 0;
}
swap(v[1],v[2]);
}
printf("no\n");
}
| a.cc: In function 'void swap(const b&, const b&)':
a.cc:26:7: error: passing 'const b' as 'this' argument discards qualifiers [-fpermissive]
26 | a=r;
| ^
a.cc:18:10: note: in call to 'void b::operator=(const b&)'
18 | void operator =(const b &a){
| ^~~~~~~~
a.cc:27:7: error: passing 'const b' as 'this' argument discards qualifiers [-fpermissive]
27 | r=temp;
| ^~~~
a.cc:18:10: note: in call to 'void b::operator=(const b&)'
18 | void operator =(const b &a){
| ^~~~~~~~
|
s867826081 | p00321 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
using namespace std;
class key2{
public:
string s,t;
key2(string a,string b){
if(a>b){
swap(a,b);
}
s=a;
t=b;
}
};
bool operator<(const key2 &a,const key2 &b){
return a.s<b.s||(a.s==b.s&&a.t<b.t);
}
class data{
public:
string s,t;
int num;
data(key2 a,int b){
s=a.s;
t=a.t;
num=b;
}
void out(){
cout<<s<<" "<<t<<endl;
}
};
int main(){
int N,F;
cin>>N>>F;
map<key2,int> use;
for(int i=0;i<N;++i){
int time;
cin>>time;
vector<string> buylist(time);
for(int j=0;j<time;++j){
cin>>buylist[j];
}
for(int j=0;j<time;++j){
for(int k=j+1;k<time;++k){
key2 d(buylist[j],buylist[k]);
auto itr = use.find(d);
if(itr==use.end()){
use[d]=1;
}else{
++use[d];
}
}
}
}
int ans=0;
vector<data> anslist;
for(auto itr=use.begin();itr!=use.end();++itr){
if(itr->second>=F){
anslist.push_back(data(itr->first,itr->second));
++ans;
}
}
cout<<ans<<endl;
for(int i=0;i<ans;++i){
anslist[i].out();
}
} | a.cc: In function 'int main()':
a.cc:61:16: error: template argument 1 is invalid
61 | vector<data> anslist;
| ^
a.cc:61:16: error: template argument 2 is invalid
a.cc:64:21: error: request for member 'push_back' in 'anslist', which is of non-class type 'int'
64 | anslist.push_back(data(itr->first,itr->second));
| ^~~~~~~~~
a.cc:64:31: error: reference to 'data' is ambiguous
64 | anslist.push_back(data(itr->first,itr->second));
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:23:7: note: 'class data'
23 | class data{
| ^~~~
a.cc:70:16: error: invalid types 'int[int]' for array subscript
70 | anslist[i].out();
| ^
|
s253612340 | p00321 | C++ | int
| a.cc:1:4: error: expected unqualified-id at end of input
1 | int
| ^
|
s018513983 | p00323 | C++ |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
int main() {
int n;
cin >> n;
int a[200005] = {};
rep(i, 0, n) {
int b, c;
cin >> b >> c;
a[b + c]++;
}
rep(i, 0, 200005) {
if(a[b + c] > 2) {
a[b + c + 1] += a[b + c] / 2;
a[b + c] = 1;
}
}
rep(i, 0, 200005) {
if(a[i]) cout << i << " " << 0 << endl;
}
} | a.cc: In function 'int main()':
a.cc:29:10: error: 'b' was not declared in this scope
29 | if(a[b + c] > 2) {
| ^
a.cc:29:14: error: 'c' was not declared in this scope
29 | if(a[b + c] > 2) {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.