submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s773613062 | p00423 | C++ | #include<cstdio>
using namespace std;
int main(void){
int n;
while (1){
int A = 0, B = 0;
scanf_s("%d", &n);
if (n == 0)return 0;
for (int i = 0; i < n; i++){
int a, b;
scanf_s("%d %d", &a, &b);
if (a > b){
a += b;
b = 0;
}
if (a < b){
b += a;
a = 0;
}
A += a;
B += b;
}
printf("%d %d\n", A, B);
}
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s463904800 | p00423 | C++ | #include <stdio.h>
int main(int ac, char** av) {
int n, score_a = 0, score_b = 0;
scanf("%d", &n);
int *a = (int*) malloc(sizeof(int) * n);
int *b = (int*) malloc(sizeof(int) * n);
int i;
for(i = 0; i < n; i++) {
scanf("%d %d", a+i, b+i);
}
for(i = 0; i < n; i++) {
if(a[i] > b[i]) {
score_a += a[i] + b[i];
} else if(a[i] < b[i]) {
score_b += a[i] + b[i];
} else if(a[i] == b[i]) {
score_a += a[i];
score_b += b[i];
}
}
printf("%d %d\n", score_a, score_b);
free(a);
free(b);
return 0;
} | a.cc: In function 'int main(int, char**)':
a.cc:6:19: error: 'malloc' was not declared in this scope
6 | int *a = (int*) malloc(sizeof(int) * n);
| ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
1 | #include <stdio.h>
+++ |+#include <cstdlib>
2 |
a.cc:23:3: error: 'free' was not declared in this scope
23 | free(a);
| ^~~~
a.cc:23:3: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
|
s952764911 | p00423 | C++ | #include<iostream>
using namespacee std;
int main(void){
int a,b;
a=b=0;
int n;
cin>>n;
while(n--){
int c,d;
cin>>c>>d;
if(c>d)
a += c + d;
else
b += c + d;
}
cout<< a << " " << b << endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'namespacee'
2 | using namespacee std;
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin>>n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout<< a << " " << b << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | cout<< a << " " << b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s206218216 | p00423 | C++ | #include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
std::vector<std::pair<int,int> > data;
char buf[100];
int n;
std::cin >> buf;
n = atoi(buf);
char a[100];
char b[100];
for (int i=0; i<n ; i++){
std::cin >> a;
std::cin >> b;
data.push_back(std::pair<int,int>(atoi(a),atoi(b)));
}
int you = 0;
int opp = 0;
for (std::vector<std::pair<int,int> >::iterator it = data.begin(); it != data.end(); it++){
int yv = (*it).first;
int ov = (*it).second;
if (yv > ov ){
you += yv+ov;
}else if (yv < ov){
opp += yv+ov;
}else{
you += yv;
opp += ov;
}
}
std::cout << you << " " << opp << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:8: error: 'cin' is not a member of 'std'
13 | std::cin >> buf;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include<string>
+++ |+#include <iostream>
4 | using namespace std;
a.cc:20:10: error: 'cin' is not a member of 'std'
20 | std::cin >> a;
| ^~~
a.cc:20:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:10: error: 'cin' is not a member of 'std'
21 | std::cin >> b;
| ^~~
a.cc:21:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:8: error: 'cout' is not a member of 'std'
41 | std::cout << you << " " << opp << std::endl;
| ^~~~
a.cc:41:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:42: error: 'endl' is not a member of 'std'
41 | std::cout << you << " " << opp << std::endl;
| ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
3 | #include<string>
+++ |+#include <ostream>
4 | using namespace std;
|
s560777116 | p00423 | C++ | #include<vector>
#include<algorithm>
#include<string>
int main(){
std::vector<std::pair<int,int> > data;
char buf[100];
int n;
std::cin >> buf;
n = atoi(buf);
char a[100];
char b[100];
for (int i=0; i<n ; i++){
std::cin >> a;
std::cin >> b;
data.push_back(std::pair<int,int>(atoi(a),atoi(b)));
}
int you = 0;
int opp = 0;
for (std::vector<std::pair<int,int> >::iterator it = data.begin(); it != data.end(); it++){
int yv = (*it).first;
int ov = (*it).second;
if (yv > ov ){
you += yv+ov;
}else if (yv < ov){
opp += yv+ov;
}else{
you += yv;
opp += ov;
}
}
std::cout << you << " " << opp << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:8: error: 'cin' is not a member of 'std'
12 | std::cin >> buf;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include<string>
+++ |+#include <iostream>
4 |
a.cc:19:10: error: 'cin' is not a member of 'std'
19 | std::cin >> a;
| ^~~
a.cc:19:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:10: error: 'cin' is not a member of 'std'
20 | std::cin >> b;
| ^~~
a.cc:20:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:8: error: 'cout' is not a member of 'std'
40 | std::cout << you << " " << opp << std::endl;
| ^~~~
a.cc:40:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:42: error: 'endl' is not a member of 'std'
40 | std::cout << you << " " << opp << std::endl;
| ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
3 | #include<string>
+++ |+#include <ostream>
4 |
|
s186797152 | p00423 | C++ | using System;
using System.Linq;
namespace ACTest
{
class AOJ500
{
static void Main(string[] args)
{
int num = 1;
int[] totalScore = new int[2];
int[] roundScore = new int[2];
while (num != 0)
{
totalScore = Enumerable.Repeat<int>(0, 2).ToArray();
//int[,] roundScore = new int[num, 2];
num = int.Parse(Console.ReadLine());
for (int i = 0; i < num; i++)
{
///totalScore = Enumerable.Repeat<int>(0, 2).ToArray();
string[] input = Console.ReadLine().Split(' ');
roundScore[0] = int.Parse(input[0]);
roundScore[1] = int.Parse(input[1]);
if (roundScore[0] > roundScore[1])
{
totalScore[0] += roundScore[0] + roundScore[1];
}
else if (roundScore[0] < roundScore[1])
{
totalScore[1] += roundScore[0] + roundScore[1];
}
else
{
totalScore[0] += roundScore[0];
totalScore[1] += roundScore[1];
}
}
Console.WriteLine(totalScore[0] + " " + totalScore[1]);
}
//while (true) ;
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:8:26: error: 'string' has not been declared
8 | static void Main(string[] args)
| ^~~~~~
a.cc:8:35: error: expected ',' or '...' before 'args'
8 | static void Main(string[] args)
| ^~~~
a.cc:46:6: error: expected ';' after class definition
46 | }
| ^
| ;
a.cc: In static member function 'static void ACTest::AOJ500::Main(int*)':
a.cc:11:16: error: structured binding declaration cannot have type 'int'
11 | int[] totalScore = new int[2];
| ^~
a.cc:11:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:16: error: empty structured binding declaration
a.cc:11:19: error: expected initializer before 'totalScore'
11 | int[] totalScore = new int[2];
| ^~~~~~~~~~
a.cc:12:16: error: structured binding declaration cannot have type 'int'
12 | int[] roundScore = new int[2];
| ^~
a.cc:12:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:16: error: empty structured binding declaration
a.cc:12:19: error: expected initializer before 'roundScore'
12 | int[] roundScore = new int[2];
| ^~~~~~~~~~
a.cc:15:17: error: 'totalScore' was not declared in this scope
15 | totalScore = Enumerable.Repeat<int>(0, 2).ToArray();
| ^~~~~~~~~~
a.cc:15:30: error: 'Enumerable' was not declared in this scope
15 | totalScore = Enumerable.Repeat<int>(0, 2).ToArray();
| ^~~~~~~~~~
a.cc:15:48: error: expected primary-expression before 'int'
15 | totalScore = Enumerable.Repeat<int>(0, 2).ToArray();
| ^~~
a.cc:18:23: error: expected primary-expression before 'int'
18 | num = int.Parse(Console.ReadLine());
| ^~~
a.cc:22:21: error: 'string' was not declared in this scope
22 | string[] input = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:22:28: error: expected primary-expression before ']' token
22 | string[] input = Console.ReadLine().Split(' ');
| ^
a.cc:23:21: error: 'roundScore' was not declared in this scope
23 | roundScore[0] = int.Parse(input[0]);
| ^~~~~~~~~~
a.cc:23:37: error: expected primary-expression before 'int'
23 | roundScore[0] = int.Parse(input[0]);
| ^~~
a.cc:24:37: error: expected primary-expression before 'int'
24 | roundScore[1] = int.Parse(input[1]);
| ^~~
a.cc:41:17: error: 'Console' was not declared in this scope
41 | Console.WriteLine(totalScore[0] + " " + totalScore[1]);
| ^~~~~~~
|
s913396470 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int a;
int b[];
int c[];
int uma;
int ushi;
cin >> a;
for (int i; i < a; i++){
cin >> b[i];
cin >> c[i];
}
for (int j; j < a; j++){
if (b[j]>c[j]){
uma = uma + 2;
}
if(b[j]=c[j]){
uma = uma + 1;
ushi = ushi + 1;
}
else{
ushi = ushi + 2;
}
}
cout << uma << ushi;
} | a.cc: In function 'int main()':
a.cc:6:13: error: storage size of 'b' isn't known
6 | int b[];
| ^
a.cc:7:13: error: storage size of 'c' isn't known
7 | int c[];
| ^
|
s741981082 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int a;
int uma;
int ushi;
int b;
int c;
int i;
while (true){
cin >> a;
if (a == 0){ break; }
else{
for (i < a; i++){
cin >> b;
cin >> c;
if (b>c){
uma = uma + b + c;
}
if (b == c){
uma = uma + b;
ushi = ushi + c;
}
else{
ushi = ushi + b + c;
}
}
}
cout << uma << " " << ushi << endl;
uma = 0;
ushi = 0;
i = 0;
}
} | a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before ')' token
15 | for (i < a; i++){
| ^
| ;
|
s049934981 | p00423 | C++ | #include <stdio.h>
int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n,i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb:
}
}
scand("%d",&n);
}
} | a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before '>' token
8 | for(int i=n,i>0;i--){
| ^
| ;
a.cc:8:14: error: expected primary-expression before '>' token
a.cc:16:6: error: expected ';' before ':' token
16 | b+=bb:
| ^
| ;
a.cc:19:1: error: 'scand' was not declared in this scope; did you mean 'scanf'?
19 | scand("%d",&n);
| ^~~~~
| scanf
|
s927603084 | p00423 | C++ | #include <stdio.h>
int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n;i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb:
}
}
scand("%d",&n);
}
} | a.cc: In function 'int main()':
a.cc:16:6: error: expected ';' before ':' token
16 | b+=bb:
| ^
| ;
a.cc:19:1: error: 'scand' was not declared in this scope; did you mean 'scanf'?
19 | scand("%d",&n);
| ^~~~~
| scanf
|
s945695376 | p00423 | C++ | #include <stdio.h>
int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n;i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb;
}
}
scand("%d",&n);
}
} | a.cc: In function 'int main()':
a.cc:19:1: error: 'scand' was not declared in this scope; did you mean 'scanf'?
19 | scand("%d",&n);
| ^~~~~
| scanf
|
s998172109 | p00423 | C++ | #include <stdio.h>
int main(void){
int s_num = 1;
int sum1 = 0;
int sum2 = 0;
while(1){
int i;
scanf("%d",&s_num);
if(s_num == 0) break;
for(i = 0;i < s_num; i++){
int sam1 = 0;
int sam2 = 0;
scanf("%d %d",&sam1,&sam2);
if(sam1 > sam2){
sum1 += (sam1 + sam2);
}else if(sam1 < sam 2){
sum2 += (sam1 +sam2);
}else{
sum1 += sam1;
sum2 += sam2;
}
printf("%d %d\n",sam1.sam2);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:21:19: error: 'sam' was not declared in this scope; did you mean 'sam2'?
21 | }else if(sam1 < sam 2){
| ^~~
| sam2
a.cc:21:22: error: expected ')' before numeric constant
21 | }else if(sam1 < sam 2){
| ~ ^~
| )
a.cc:28:25: error: request for member 'sam2' in 'sam1', which is of non-class type 'int'
28 | printf("%d %d\n",sam1.sam2);
| ^~~~
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s427428367 | p00423 | C++ | 3
9 1
5 4
0 8
3
9 1
5 4
1 0
3
9 1
5 5
1 8
0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s598358239 | p00423 | C++ | #include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main(void){
int n,a,b,a1,b1;
while(1){
scanf("%d",&n);
a1=0;
b1=0
if(n==0){break;}
for(int i=0;i<n;i++){
scanf("%d%d",&a,&b);
if(a>b){
a1=a+b;
}else if(b>a){
b1=a+b;
}else{
a1+=a;
b1+=b;
}
}
printf("%d %d\n",a1,b1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected ';' before 'if'
11 | b1=0
| ^
| ;
12 | if(n==0){break;}
| ~~
|
s204894600 | p00423 | C++ | #include <iostream>
int main(){
int i,n,a,b,apoint=0,bpoint=0;
cin >> n;
for(i=0;i<n;i++){
cin >> a;
cin >> b;
if(a>b){apoint+=a;apoint+=b;}
else if(b>a){bpoint+=a;bpoint+=b}
else {apoint+=a;bpoint+=b}
}
cout << apoint <<' ' << bpoint << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:10:49: error: expected ';' before '}' token
10 | else if(b>a){bpoint+=a;bpoint+=b}
| ^
| ;
a.cc:11:42: error: expected ';' before '}' token
11 | else {apoint+=a;bpoint+=b}
| ^
| ;
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
13 | cout << apoint <<' ' << bpoint << 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:13:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
13 | cout << apoint <<' ' << bpoint << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s188547540 | p00423 | C++ | #include <iostream>
int main(){
int i,n,a,b,apoint=0,bpoint=0;
cin >> n;
for(i=0;i<n;i++){
cin >> a;
cin >> b;
if(a>b){apoint+=a;apoint+=b;}
else if(b>a){bpoint+=a;bpoint+=b;}
else {apoint+=a;bpoint+=b;}
}
cout << apoint <<' ' << bpoint << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
13 | cout << apoint <<' ' << bpoint << 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:13:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
13 | cout << apoint <<' ' << bpoint << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s344129249 | p00423 | C++ | #include <stdio.h>
#include <iostream>
int main()
{
//std::ios::
int n;
int a,b;
int sa,sb;//score
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a>>b;
if(a<b){sb+=a+b;}
else if(a>b){sa+=a+b;}
else
{
sa+=a;
sb+=b;
}
}
cout<<a<<" "<<b<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
11 | cin>>n;
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:23:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
23 | cout<<a<<" "<<b<<"\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s057446121 | p00423 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;
int n,a,b,asum,bsum;
int main(){
while(TRUE){
cin>>n;
if( n == 0 ) break;
for(int i=0;i<n;i++){
cin >> a >> b ;
if( a > b ){
asum+=(a+b);
}else if( a == b ){
asum+=a;
bsum+=b;
}else{
bsum+=(a+b);
}
}
cout<<asum<<" "<<bsum<<endl;
asum=0;bsum=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:15: error: 'TRUE' was not declared in this scope
11 | while(TRUE){
| ^~~~
|
s789102858 | p00423 | C++ | #include <iostream>
using namespace std;
int main()
{
while(true){
int n,a[10000]={},b[10000]={},ascore=0,bscore=0;
cin>>n;
if(n==0) break;
for(int i=0;i<n;i++){
cin>>a[i];
cin>>b[i];
if(a[i]>b[i]){
ascore+=a[i]+b[i];
}else if(a[i]<b[i]){
bscore+=a[i]+b[i];
}else if(a[i]==b[i]){
ascore+=a[i];
bscore+=b[i];
}
}
}
cout<<ascore<<" "<<bscore<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:23:15: error: 'ascore' was not declared in this scope
23 | cout<<ascore<<" "<<bscore<<endl;
| ^~~~~~
a.cc:23:28: error: 'bscore' was not declared in this scope
23 | cout<<ascore<<" "<<bscore<<endl;
| ^~~~~~
|
s779704575 | p00423 | C++ | #include <iostream>
using namespace std;
int main()
{
while(true){
int n,a[10000]={},b[10000]={},ascore=0,bscore=0;
cin>>n;
if(n==0) break;
for(int i=0;i<n;i++){
cin>>a[i];
cin>>b[i];
if(a[i]>b[i]){
ascore+=a[i]+b[i];
}else if(a[i]<b[i]){
bscore+=a[i]+b[i];
}else if(a[i]==b[i]){
ascore+=a[i];
bscore+=b[i];
}
}
}
cout<<ascore<<" "<<bscore<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:23:15: error: 'ascore' was not declared in this scope
23 | cout<<ascore<<" "<<bscore<<endl;
| ^~~~~~
a.cc:23:28: error: 'bscore' was not declared in this scope
23 | cout<<ascore<<" "<<bscore<<endl;
| ^~~~~~
|
s053441501 | p00423 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int num;
while(1){
a_score=0;b_score=0;
scanf( "%d", &num );
if(num==0)break;
for(int i=0;i<num;i++){
int a_card,b_card;
scanf("%d %d",&a_card,&b_card);
if(a_card>b_card){a_score+=a_card+b_card;}
else if(a_card==b_card){a_score+=a_card;b_score+=b_card;}
else b_score+=a_card+b_card;
}
cout<<a_score<<" "<<b_score<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'a_score' was not declared in this scope
7 | a_score=0;b_score=0;
| ^~~~~~~
a.cc:7:19: error: 'b_score' was not declared in this scope
7 | a_score=0;b_score=0;
| ^~~~~~~
|
s127475363 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int Acard,Bcard,Apoint,Bpoint;
while(true){
cin>>n;
if(n==0){
break;
}else{
for(int i=0;i<n;i++){
cin>>Acard>>Bcard;
if(Acard>Bcard){
Apoint+=Acard+Bcard;
}else if(Acard<Bcard){
Bpoint+=Acard+Bcard;
}else{
Apoint+=Acard;
Bpoint+=Bcard;
}
}
count<<Apoint<<' '<<Bpoint<<'\n';
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:23:4: error: 'count' was not declared in this scope
23 | count<<Apoint<<' '<<Bpoint<<'\n';
| ^~~~~
|
s023211546 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int Acard,Bcard,Apoint,Bpoint;
while(true){
cin>>n;
if(n==0){
break;
}else{
for(int i=0;i<n;i++){
cin>>Acard>>Bcard;
if(Acard>Bcard){
Apoint+=Acard+Bcard;
}else if(Acard<Bcard){
Bpoint+=Acard+Bcard;
}else{
Apoint+=Acard;
Bpoint+=Bcard;
}
}
count<<Apoint<<' '<<Bpoint<<'\n';
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:23:4: error: 'count' was not declared in this scope
23 | count<<Apoint<<' '<<Bpoint<<'\n';
| ^~~~~
|
s578500563 | p00423 | C++ | # coding: utf-8
# Here your code !
def latte():
return int(input())
while True:
x=y=0
n=latte()
if n==0 :break
for i in range(n):
a,b=map(int,input().strip().split())
if a>b:
x+=a+b
elif b>a:
y+=a+b
else :
x+=a
y+=b
print(x,y)
| a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Here
2 | # Here your code !
| ^~~~
a.cc:5:1: error: 'def' does not name a type
5 | def latte():
| ^~~
|
s502675645 | p00423 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n,a,b;
long suma=0,sumb=0;
do{
cin >> n;
for(int i=0;i<n;i++){
cin >> a >> b;
if(a>b) suma+=a+b;
else if(a<b) sumb+=a+b;
else{suma+=a;sumb+=b;}
printf("%ld %ld\n",suma,sumb);
while(n!=0);
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:8:11: note: to match this '{'
8 | do{
| ^
a.cc:17:2: error: expected 'while' at end of input
17 | }
| ^
a.cc:17:2: error: expected '(' at end of input
17 | }
| ^
| (
a.cc:17:2: error: expected primary-expression at end of input
a.cc:17:2: error: expected ')' at end of input
17 | }
| ^
| )
a.cc:17:2: error: expected ';' at end of input
17 | }
| ^
| ;
a.cc:17:2: error: expected '}' at end of input
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s284559661 | p00423 | C++ | #include <stdio.h>
void main()
{
int n;
int A, B;
int playerA = 0, playerB = 0;
int i = 0;
while (1){
scanf("%d", &n);
if (n == 0){
break;
}
while (i < n){
scanf("%d %d", &A, &B);
if (A == B){
playerA += A;
playerB += B;
}
else if (A > B){
playerA += A + B;
}
else {
playerB += A + B;
}
i++;
}
}
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s484054095 | p00423 | C++ | #include <stdio.h>
void main()
{
int n;
int A, B;
int playerA = 0, playerB = 0;
int i = 0;
while (1){
scanf("%d", &n);
if (n == 0){
break;
}
while (i < n){
scanf("%d %d", &A, &B);
if (A == B){
playerA += A;
playerB += B;
}
else if (A > B){
playerA += A + B;
}
else {
playerB += A + B;
}
i++;
}
printf("%d %d\n", playerA, playerB);
i = 0;
playerA = 0;
playerB = 0;
}
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s653580704 | p00423 | C++ | #include<iostream>
using namespace std;
int n[10000000],s1,s2;
int main(){
int p,a,b;
cin>>p;
for(int i=0;i<p;i++){
cin>>a>>b;
if(a>b){s1+=a+b;}
else if(b>a){s2+=a+b;}
else{s1+=a;s2+=b;
}
cout<<s1<<' '<<s2<<endl
} | a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before '}' token
13 | cout<<s1<<' '<<s2<<endl
| ^
| ;
14 | }
| ~
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s884345999 | p00423 | C++ | #include<iostream>
using namespace std;
int n[10000000],s1,s2;
int main(){
int p,a,b;
cin>>p;
for(int i=0;i<p;i++){
cin>>a>>b;
if(a>b){s1+=a+b;}
else if(b>a){s2+=a+b;}
else{s1+=a;s2+=b;
}
cout<<s1<<' '<<s2<<endl;
} | a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s159704899 | p00423 | C++ | #include<iostream>
#include<string>
#include<sstream>
#include<cstdlib>
using namespace std;
int main(){
while(1){
string str;
getline(cin,str);
int n = atoi(str.c_str());
if(n==0)break;
int scoreA = 0, scoreB = 0;
while(n--){
getline(cin,str)
stringstream ss(str);
string tmp;
getline(ss,tmp,' ');
int a = atoi(tmp.c_str());
getline(ss,tmp);
int b = atoi(tmp.c_str());
if(a>b)scoreA+=(a+b);
else scoreB+=(a+b);
}
cout<<scoreA<<" "<<scoreB<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:41: error: expected ';' before 'stringstream'
16 | getline(cin,str)
| ^
| ;
17 | stringstream ss(str);
| ~~~~~~~~~~~~
a.cc:19:33: error: 'ss' was not declared in this scope
19 | getline(ss,tmp,' ');
| ^~
|
s386499136 | p00423 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int card[100],i,j,a=0,b=0,c=1,n;
cin>>n;
while(n!=0){
for(i=0;i<2*n;i++){
cin>>card[i];
}
for(i=0;i<2*n;i=i+2){
if(card[i]>card[c]){
a=a+card[i]+card[c];
}
else if (card[i]==card[c]){
a=a+card[i];
b=b+card[c];
}
else{
b=b+card[i]+card[c];
}
c=c+2;
}
cout<<a<<" "<<b<<endl;
}
cin>>n;
}
return 0;
} | a.cc:28:1: error: expected unqualified-id before 'return'
28 | return 0;
| ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
s214981038 | p00423 | C++ | #include "stdafx.h"
#include <iostream>
int A[10000], B[10000];
int main()
{
int n, a, b;
std::cin >> n;
while (n != 0)
{
a = 0;
b = 0;
for (int i = 0; i < n; i++)
{
std::cin >> A[i] >> B[i];
if (A[i] > B[i])
{
a += A[i] + B[i];
}
if (A[i] == B[i])
{
a += A[i];
b += B[i];
}
if (A[i] < B[i])
{
b += B[i];
}
}
std::cout << a << " " << b << std::endl;
std::cin >> n;
}
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s065810921 | p00423 | C++ | int main() {
int num = 0;
int a[10000] = { 0 };
int b[10000] = { 0 };
cin >> num;
while (num != 0) {
int ap = 0;
int bp = 0;
for (int i = 0; i < num; i++) {
cin >> a[i] >> b[i];
if (a[i] > b[i]) ap += a[i] + b[i];
else if (a[i] < b[i]) bp += a[i] + b[i];
else {
ap += a[i];
bp += b[i];
}
}
cout << ap << " " << bp << endl;
cin >> num;
}
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
5 | cin >> num;
| ^~~
a.cc:18:17: error: 'cout' was not declared in this scope
18 | cout << ap << " " << bp << endl;
| ^~~~
a.cc:18:44: error: 'endl' was not declared in this scope
18 | cout << ap << " " << bp << endl;
| ^~~~
|
s264519289 | p00423 | C++ | #include<stdio.h>
int main()
{
int a,aa;
int cou,n,i;
while(1){
scanf("%d",&n);
if(n==0){
break;
}
a=i/2;
aa=n/i;
cou=0;
for(i=2;i<=n/2;i++){
if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
continue;
}
if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
continue;
}
if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
cou++;
}
if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
cou++;
}
}
printf("%d",cou);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
15 | if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
| ~~~~~~~~~^~~~~~~~~
| | |
| double double
a.cc:15:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
15 | if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double
a.cc:18:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
18 | if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
| ~~~~~~~~~^~~~~~~~~
| | |
| double double
a.cc:18:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
18 | if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double
a.cc:21:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
21 | if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
| ~~~~~~~~~^~~~~~~~~
| | |
| double double
a.cc:21:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
21 | if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double
a.cc:24:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
24 | if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
| ~~~~~~~~~^~~~~~~~~
| | |
| double double
a.cc:24:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
24 | if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double
|
s283312166 | p00423 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int pointA=0,pointB=0;
for(int i=0;i<n;i++){
int a,b;
cin >> a >> b;
if(a<b){
pointB += a+b;
}
if(a>b){
pointA += a+b;
}
else{
pointA += a;
pointB += b;
}
}
cout << a << b << endl;
} | a.cc: In function 'int main()':
a.cc:23:13: error: 'a' was not declared in this scope
23 | cout << a << b << endl;
| ^
a.cc:23:18: error: 'b' was not declared in this scope
23 | cout << a << b << endl;
| ^
|
s561885878 | p00423 | C++ | #include <iostream>
using namespace std;
int main
while(0==0){
int n;
cin >> n;
if(n==0) break;
int pointA=0,pointB=0;
for(int i=0;i<n;i++){
int a,b;
cin >> a >> b;
if(a<b){
pointB += a+b;
}
if(a>b){
pointA += a+b;
}
else{
pointA += a;
pointB += a;
}
}
cout << pointA << " " << pointB << endl;
}
} | a.cc:6:5: error: expected initializer before 'while'
6 | while(0==0){
| ^~~~~
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s289927128 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a,b;
int res_a=0,res=b=0;
for(int i=0;i<n;i++){
cin >> a >> b;
if(a>b)res_a+=(a+b);
else if(a<b)res_b+=(a+b);
else{res_a+=a;res_b+=b;}
}
cout << res_a << res_b << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:17: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
13 | else if(a<b)res_b+=(a+b);
| ^~~~~
| res_a
a.cc:14:19: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
14 | else{res_a+=a;res_b+=b;}
| ^~~~~
| res_a
a.cc:16:20: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
16 | cout << res_a << res_b << endl;
| ^~~~~
| res_a
|
s890147341 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a,b;a
int res_a=0,res_b=0;
for(int i=0;i<n;i++){
cin >> a >> b;
if(a>b) res_a+=(a+b);
else if(a<b) res_b+=(a+b);
else{res_a+=a;res_b+=b;}
}
cout << res_a << res_b << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'int'
8 | int a,b;a
| ^
| ;
9 | int res_a=0,res_b=0;
| ~~~
a.cc:12:13: error: 'res_a' was not declared in this scope
12 | if(a>b) res_a+=(a+b);
| ^~~~~
a.cc:13:18: error: 'res_b' was not declared in this scope
13 | else if(a<b) res_b+=(a+b);
| ^~~~~
a.cc:14:10: error: 'res_a' was not declared in this scope
14 | else{res_a+=a;res_b+=b;}
| ^~~~~
a.cc:14:19: error: 'res_b' was not declared in this scope
14 | else{res_a+=a;res_b+=b;}
| ^~~~~
a.cc:16:11: error: 'res_a' was not declared in this scope
16 | cout << res_a << res_b << endl;
| ^~~~~
a.cc:16:20: error: 'res_b' was not declared in this scope
16 | cout << res_a << res_b << endl;
| ^~~~~
|
s062726592 | p00423 | C++ | aaaa | a.cc:1:1: error: 'aaaa' does not name a type
1 | aaaa
| ^~~~
|
s823827172 | p00423 | C++ | eeee | a.cc:1:1: error: 'eeee' does not name a type
1 | eeee
| ^~~~
|
s087230512 | p00423 | C++ | int main(void)
{
int i,a,b,c,d,e;
scanf("%d",&a);
d=0; e=0;
for(i=0;i<a;i++){
scanf("%d %d",&b,&c);
if(b==c){
d+=b;
e+=c;
}
else if(b>c){
d+=b+c;
}
else if(b<c){
e+=b+c;
}
}
printf("%d %d\n",d,e);
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
4 | scanf("%d",&a);
| ^~~~~
a.cc:19:9: error: 'printf' was not declared in this scope
19 | printf("%d %d\n",d,e);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(void)
|
s379171879 | p00423 | C++ | #include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
int main(void)
{
int i;
int num, x, y;
int p1 = 0;
int p2 = 0;
for (;;) {
scnaf("%d", &num);
if (num == 0) {
break;
}
for (i = 0; i < num; i++) {
scanf("%d %d", &x, &y);
if (x > y) {
p1 += (x+y);
}
else if (x < y) {
p2 += (x+y);
}
else {
p1 += x;
p2 += y;
}
}
printf("%d %d\n", p1, p2);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
14 | scnaf("%d", &num);
| ^~~~~
| scanf
|
s939158942 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n,s1=0,s2=0,a,b;
cin>>n;
if(n==0)break;
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b)s1+=a+b;
else if(a<b)s2+=a+b;
else{
s1+=a;
s2+=b;
}
}
cout<<s1<<" "<<s2<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:17: error: break statement not within loop or switch
6 | if(n==0)break;
| ^~~~~
|
s258820767 | p00423 | C++ | #include<stdio.h>
int main()
{
int i1, i2, b, k, n, m[2], **c, max[2], min[2];
scanf("%d", &n);
m[0] = n;
m[1] = n;
c = new int * [2];
c[0] = new int [n];
c[1] = new int [n];
for (i1 = 0; i1 < n; i1++)
scanf("%d", &c[0][i1]);
qsort(c[0], n, sizeof(int), compare);
min[0] = 0;
max[0] = n - 1;
k = 0;
for (i1 = 1; i1 < c[0][0]; i1++) {
c[1][k] = i1;
k++;
}
for (i1 = 0; i1 < n-1; i1++) {
for (i2 = c[0][i1]+1; i2 < c[0][i1+1]; i2++) {
c[1][k] = i2;
k++;
}
}
min[1] = 0;
max[1] = n - 1;
k = 1;
b = c[0][0];
min[0] = 1;
c[0][0] = 0;
m[0]--;
while (m[0] > 0 && m[1] > 0) {
if (b > c[k][max[k]])
b = -1;
else {
for (i1 = min[k]; i1 <= max[k]; i1++) {
if (c[k][i1] > b) {
b = c[k][i1];
c[k][i1] = 0;
m[k]--;
if (i1 == min[k]) {
for (i2 = min[k]+1; i2 <= max[k]; i2++) {
if (c[k][i2] > 0) {
min[k] = i2;
break;
}
}
}
else if (i1 == max[k]) {
for (i2 = max[k]-1; i2 >= min[k]; i2--) {
if (c[k][i2] > 0) {
max[k] = i2;
break;
}
}
}
break;
}
}
}
k = (k + 1) % 2;
}
printf("%d\n%d\n", m[1], m[0]);
return 0;
} | a.cc: In function 'int main()':
a.cc:13:37: error: 'compare' was not declared in this scope
13 | qsort(c[0], n, sizeof(int), compare);
| ^~~~~~~
a.cc:13:9: error: 'qsort' was not declared in this scope
13 | qsort(c[0], n, sizeof(int), compare);
| ^~~~~
|
s983649523 | p00423 | C++ | #include<iostream>
void main(){
int n;
int a=0, b=0;
int x, y;
std::cin >> n;
if (n == 0)
goto flag;
for(int i=0;i<n;i++){
std::cin >> x >> y;
if (x > y)
a += x + y;
if (x < y)
b += x + y;
if (x == y)
a += x, b += y;
}
flag:
std::cout << a << b << std::endl;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s581747758 | p00423 | C++ | #include<iostream>
void main(){
int n;
int a=0, b=0;
int x, y;
f:
std::cin >> n;
if (n == 0)
goto flag;
for(int i=0;i<n;i++){
std::cin >> x >> y;
if (x > y)
a += x + y;
if (x < y)
b += x + y;
if (x == y)
a += x, b += y;
}
goto f;
flag:
std::cout << a << b << std::endl;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s915125180 | p00423 | C++ | #include<iostream>
int main() {
int vec=0;
int n;
int a=0;
int b=0;
int game_a, game_b;
while (1) {
std::cin >> n;
if (n == 0)break;
else {
for (int i = 0; i < n; ++i) {
std::cin >> game_a>>game_b;
if (game_a == game_b) { a += game_a; b += game_b; }
else if (game_a > game_b)a += game_a + game_b;
else b += game_a + game_b;
}
std::cout << a << " " << b << std::endl; a = ; b = 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:70: error: expected primary-expression before ';' token
18 | std::cout << a << " " << b << std::endl; a = ; b = 0;
| ^
|
s550840322 | p00423 | C++ | #include <iostream>
using namespace std;
int main() {
int q[10000 - 1], w[10000 - 1];
int n;
int a = 0;
int b = 0;
int x = 1;
while (x== 10000) {
cin >> n;
if (n == 0) {
break;
}
for (int i = 1; i <= n; ++i) {
int c, d;
cin >> c >> d;
if (c == d) {
a = a + c;
b = b + d;
}
else if (c > d) {
a = a + c + d;
}
else {
b = b + c + d;
}
}
q[x] = a;
w[x] = b;
x++;
}
for (int j = 1; j <= x; ++j) {
cout << q[j] << " " << w[j] << endl;
} | a.cc: In function 'int main()':
a.cc:36:2: error: expected '}' at end of input
36 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s331725845 | p00423 | C++ | #include <stdio.h>
#define loop(num) for(int a = 0; a < num; a++)
int main(){
int num;
__int64 A = 0, B = 0;
int a_card, b_card;
scanf("%d", &num);
loop(num){
scanf("%d%d", &a_card, &b_card);
if (a_card < b_card) B += (a_card + b_card);
if (b_card < a_card) A += (a_card + b_card);
if (a_card == b_card){
A += a_card;
B += b_card;
}
}
printf("%lld %lld\n", A, B);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
6 | __int64 A = 0, B = 0;
| ^~~~~~~
| __int64_t
a.cc:11:38: error: 'B' was not declared in this scope
11 | if (a_card < b_card) B += (a_card + b_card);
| ^
a.cc:12:38: error: 'A' was not declared in this scope
12 | if (b_card < a_card) A += (a_card + b_card);
| ^
a.cc:14:25: error: 'A' was not declared in this scope
14 | A += a_card;
| ^
a.cc:15:25: error: 'B' was not declared in this scope
15 | B += b_card;
| ^
a.cc:18:31: error: 'A' was not declared in this scope
18 | printf("%lld %lld\n", A, B);
| ^
a.cc:18:34: error: 'B' was not declared in this scope
18 | printf("%lld %lld\n", A, B);
| ^
|
s642009031 | p00423 | C++ | <?php
$sc = new Scanner();
while(true){
$turn = $sc->nextInt();
if($turn==0) {
break;
}
$a_point=0;
$b_point=0;
for($i=0;$i<$turn;$i++){
$a=$sc->nextInt();
$b=$sc->nextInt();
if($a>$b){
$a_point += $a+$b;
}else if ($a<$b) {
$b_point += $a+$b;
}else {
$a_point+=$a;
$b_point+=$b;
}
}
echo $a_point,' ',$b_point,'\n';
}
class Scanner {
private $arr = [];
private $count = 0;
private $pointer = 0;
public function next() {
if($this->pointer >= $this->count) {
$str = trim(fgets(STDIN));
$this->arr = explode(' ', $str);
$this->count = count($this->arr);
$this->pointer = 0;
}
$result = $this->arr[$this->pointer];
$this->pointer++;
return $result;
}
public function hasNext() {
return $this->pointer < $this->count;
}
public function nextInt() {
return (int)$this->next();
}
public function nextDouble() {
return (double)$this->next();
}
}
class out {
public static function println($str) {
echo $str . PHP_EOL;
}
}
?> | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:3:5: error: expected unqualified-id before 'while'
3 | while(true){
| ^~~~~
a.cc:25:16: error: expected ':' before '$arr'
25 | private $arr = [];
| ^~~~~
| :
a.cc:25:17: error: '$arr' does not name a type
25 | private $arr = [];
| ^~~~
a.cc:26:16: error: expected ':' before '$count'
26 | private $count = 0;
| ^~~~~~~
| :
a.cc:26:17: error: '$count' does not name a type
26 | private $count = 0;
| ^~~~~~
a.cc:27:16: error: expected ':' before '$pointer'
27 | private $pointer = 0;
| ^~~~~~~~~
| :
a.cc:27:17: error: '$pointer' does not name a type
27 | private $pointer = 0;
| ^~~~~~~~
a.cc:28:15: error: expected ':' before 'function'
28 | public function next() {
| ^~~~~~~~~
| :
a.cc:28:16: error: 'function' does not name a type; did you mean 'union'?
28 | public function next() {
| ^~~~~~~~
| union
a.cc:39:15: error: expected ':' before 'function'
39 | public function hasNext() {
| ^~~~~~~~~
| :
a.cc:39:16: error: 'function' does not name a type; did you mean 'union'?
39 | public function hasNext() {
| ^~~~~~~~
| union
a.cc:42:15: error: expected ':' before 'function'
42 | public function nextInt() {
| ^~~~~~~~~
| :
a.cc:42:16: error: 'function' does not name a type; did you mean 'union'?
42 | public function nextInt() {
| ^~~~~~~~
| union
a.cc:45:15: error: expected ':' before 'function'
45 | public function nextDouble() {
| ^~~~~~~~~
| :
a.cc:45:16: error: 'function' does not name a type; did you mean 'union'?
45 | public function nextDouble() {
| ^~~~~~~~
| union
a.cc:48:6: error: expected ';' after class definition
48 | }
| ^
| ;
a.cc:50:15: error: expected ':' before 'static'
50 | public static function println($str) {
| ^~~~~~~
| :
a.cc:50:23: error: 'function' does not name a type; did you mean 'union'?
50 | public static function println($str) {
| ^~~~~~~~
| union
a.cc:53:6: error: expected ';' after class definition
53 | }
| ^
| ;
a.cc:54:2: error: expected unqualified-id before '?' token
54 | ?>
| ^
|
s760265498 | p00423 | C++ | include<iostream>
#include<string>
using namespace std;
int main(){
int a[10000],b[10000],n,A=0,B=0;
for(int i=0;i<=n;i++){
cin>>a[i]>>b[i];
if(a[i]>b[i]){
A=A+a[i]+b[i];
}else if(a[i]==b[i]){
A=A+a[i];
B=B+b[i];
}else{
B=B+a[i]+b[i];
}
}
cout<<A<<" "<<B<<endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
| __n
/usr/include/c++/14/bits/char_traits.h: At global scope:
/usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type
198 | _GLIBCXX14_CONSTEXPR std::size_t
| |
s974865662 | p00423 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int scA=0;
int scB=0;
while(1){
cin>>n;
if(n==0)break;
for(int i=0;i<n;i++){
int a,b;
cin>>a>>b;
if(a>b)scA+=a+b;
if(a<b)scB+=a+b;
if(a==b){
scA+=a;
acB+=b;
}
}
cout<<scA<<' '<<scB<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:7: error: 'acB' was not declared in this scope; did you mean 'scB'?
17 | acB+=b;
| ^~~
| scB
|
s453293690 | p00423 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int scA=0;
int scB=0;
while(1){
cin>>n;
if(n==0)break;
for(int i=0;i<n;i++){
int a,b;
cin>>a>>b;
if(a>b)scA+=a+b;
if(a<b)scB+=a+b;
if(a==b){
scA+=a;
acB+=b;
}
}
cout<<scA<<' '<<scB<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:7: error: 'acB' was not declared in this scope; did you mean 'scB'?
17 | acB+=b;
| ^~~
| scB
|
s364697171 | p00423 | C++ | hoge | a.cc:1:1: error: 'hoge' does not name a type
1 | hoge
| ^~~~
|
s688441215 | p00423 | C++ | #include <stdio.h>
void main() {
int n, a, b;
int suma = 0;
int sumb = 0;
bool endflg = false;
while (1) {
scanf_s("%d", &n);
if (n == 0) {
return;
}
int i;
for (i = n; i > 0; i--) {
scanf_s("%d %d", &a, &b);
if (a > b) {
suma = suma + a + b;
}
else if (b > a) {
sumb = sumb + a + b;
}
else {
suma = suma + a;
sumb = sumb + b;
}
}
printf("%d %d\n", suma, sumb);
suma = 0;
sumb = 0;
}
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
a.cc:11:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
11 | return;
| ^~~~~~
|
s014093866 | p00423 | C++ | #include <stdio.h>
void main() {
int n, a, b;
int suma = 0;
int sumb = 0;
bool endflg = false;
while (1) {
scanf_s("%d", &n);
if (n == 0) {
return 0;
}
int i;
for (i = n; i > 0; i--) {
scanf_s("%d %d", &a, &b);
if (a > b) {
suma = suma + a + b;
}
else if (b > a) {
sumb = sumb + a + b;
}
else {
suma = suma + a;
sumb = sumb + b;
}
}
printf("%d %d\n", suma, sumb);
suma = 0;
sumb = 0;
}
return 0;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s019872072 | p00423 | C++ | #include <stdio.h>
int n,i,j,k;
long int A[1],B[1];
int main(){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %d %d",&j,&k);
if(j>k){
A[0]+=(j+k);
} else if(j<k){
B[0]+=(j+k)
} else if(j==k){
A[0]+=j;
B[0]+=k;
}
}
printf("%ld %ld\n",A[0],B[0]);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | B[0]+=(j+k)
| ^
| ;
12 | } else if(j==k){
| ~
|
s738848296 | p00423 | C++ | #include <stdio.h>
int n,i,j,k;
int A[1],B[1];
int main(){
for(;;){
scanf("%d",&n);
if(n==0){
return 0;
}
for(i=0;i<n;i++){
scanf(" %d %d",&j,&k);
A[0]=0,B[0]=o;
if(j>k){
A[0]+=(j+k);
} else if(j<k){
B[0]+=(j+k);
} else if(j==k){
A[0]+=j;
B[0]+=k;
}
printf("%d %d\n",A[0],B[0]);
}
}
} | a.cc: In function 'int main()':
a.cc:12:19: error: 'o' was not declared in this scope
12 | A[0]=0,B[0]=o;
| ^
|
s730431156 | p00423 | C++ | #include <stdio.h>
int n,i,j,k;
int A[1]=0,B[1]=0;
int main(){
for(;;){
scanf("%d",&n);
if(n==0){
return 0;
}
for(i=0;i<n;i++){
scanf(" %d %d",&j,&k);
if(j>k){
A[0]+=(j+k);
} else if(j<k){
B[0]+=(j+k);
} else if(j==k){
A[0]+=j;
B[0]+=k;
}
printf("%d %d\n",A[0],B[0]);
A[0]=0,B[0]=0;
}
}
} | a.cc:3:10: error: array must be initialized with a brace-enclosed initializer
3 | int A[1]=0,B[1]=0;
| ^
a.cc:3:17: error: array must be initialized with a brace-enclosed initializer
3 | int A[1]=0,B[1]=0;
| ^
|
s917432254 | p00423 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(void){
int n,asum,bsum,a,b,i;
while(1){
cin>>n;
if(n==0)break;
asum=0; bsum=0;
for(i=0;i<n;i++){
cin>>a>>b;
if(a==b)asum+=a,bsum+=b;
if(a>b)asum+=a+b;
if(b>a)bsum+=a+b;
}
cout<<asum<<' '<<bsum;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s348225314 | p00423 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(void){
int n,asum,bsum,a,b,i;
while(1){
cin>>n;
if(n==0)break;
asum=0; bsum=0;
for(i=0;i<n;i++){
cin>>a>>b;
if(a==b)asum+=a,bsum+=b;
if(a>b)asum+=a+b;
if(b>a)bsum+=a+b;
}
cout<<asum<<' '<<bsum;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s301352718 | p00423 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(void){
int n,asum,bsum,a,b,i;
while(1){
cin>>n;
if(n==0)break;
asum=0; bsum=0;
for(i=0;i<n;i++){
cin>>a>>b;
if(a==b)asum+=a,bsum+=b;
if(a>b)asum+=a+b;
if(b>a)bsum+=a+b;
}
cout<<asum<<' '<<bsum<<endl;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s437757820 | p00423 | C++ | #include <iostream>
using namespace std;
int main() {
int n, a, b, pointA, pointB;
cin >> n;
while(n != 0) {
pointA = 0;
pointB = 0;
for(int i = 0; i < n; i++) {
cin >> a >> b;
if(a > b) {
pointA += (a + b);
} else if(a > b) {
pointB += (a + b);
} else {
pointA += a;
pointB += b;
}
cout << a << ' ' << b << ' ' << endl;
cin >> n;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
31 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s165801967 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int N,suma=0,sumb=0;
while(N--){
cin >> x >> y;
if(x>y) suma=suma+x+y;
else sumb=sumb+x+y;
}
cout << suma << " " << sumb << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'x' was not declared in this scope
6 | cin >> x >> y;
| ^
a.cc:6:21: error: 'y' was not declared in this scope
6 | cin >> x >> y;
| ^
|
s931357181 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int N,suma=0,sumb=0;
cin >> N;
while(N--){
cin >> x >> y;
if(x>y) suma=suma+x+y;
else sumb=sumb+x+y;
}
cout << suma << " " << sumb << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: 'x' was not declared in this scope
7 | cin >> x >> y;
| ^
a.cc:7:21: error: 'y' was not declared in this scope
7 | cin >> x >> y;
| ^
|
s328134709 | p00423 | C++ | #include<iostream>
#include<string>
using namespase std;
int N, S, i, cnt, R, num;
string str, s;
string ring[101];
int main(){
cin >> str >> N;
S = str.size();
for (i=0; i<N; i++){
cin >> s;
ring[i] = s + s;
}
cnt = 0;
for (i=0; i<N; i++){
R = ring[i].size();
for (num = 0; num < R-S+1; num++){
if( ring[i].substr(num,S) == str ){
cnt++; break;
}
}
}
cout << cnt << endl;
return 0;
} | a.cc:3:7: error: expected nested-name-specifier before 'namespase'
3 | using namespase std;
| ^~~~~~~~~
a.cc:5:1: error: 'string' does not name a type; did you mean 'stdin'?
5 | string str, s;
| ^~~~~~
| stdin
a.cc:6:1: error: 'string' does not name a type; did you mean 'stdin'?
6 | string ring[101];
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> str >> N;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:12: error: 'str' was not declared in this scope; did you mean 'std'?
8 | cin >> str >> N;
| ^~~
| std
a.cc:11:16: error: 's' was not declared in this scope
11 | cin >> s;
| ^
a.cc:12:9: error: 'ring' was not declared in this scope
12 | ring[i] = s + s;
| ^~~~
a.cc:16:13: error: 'ring' was not declared in this scope
16 | R = ring[i].size();
| ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
23 | cout << cnt << 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:23:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
23 | cout << cnt << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s231782928 | p00423 | C++ | #include<iostream>
using namespace std;
int i, n, pA, pB, tA = 0, tB = 0;
int main () {
whole(cin >> n) {
if(n == 0) { break; }
for (i=1; i<=n; i++) {
cin >> pA >>pB;
if (pA >pB) {
tA += pA + pB;
} else {
if (pA <pB) {
tB += pA + pB;
} else {
tA += pA;
tB +- pB;
}
}
}
cout << tA << " " << tB << endl;
tA = 0; tB = 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'whole' was not declared in this scope
5 | whole(cin >> n) {
| ^~~~~
|
s422901885 | p00423 | C++ | #include<iostream>
using namespace std;
int i, n, pA, pB, tA = 0, tB = 0;
int main () {
whole(cin >> n) {
if(n == 0) { break; }
for (i=1; i<=n; i++) {
cin >> pA >>pB;
if (pA >pB) {
tA += pA + pB;
} else {
if (pA <pB) {
tB += pA + pB;
} else {
tA += pA;
tB +- pB;
}
}
}
cout << tA << " " << tB << endl;
tA = 0; tB = 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'whole' was not declared in this scope
5 | whole(cin >> n) {
| ^~~~~
|
s974520294 | p00423 | C++ | #include<iostream>
using namespace std;
int i, n, pA, pB, tA = 0, tB = 0;
int main () {
whole(cin >> n) {
if(n == 0) { break; }
for (i=1; i<=n; i++) {
cin >> pA >>pB;
if (pA >pB) {
tA += pA + pB;
} else {
if (pA <pB) {
tB += pA + pB;
} else {
tA += pA;
tB +- pB;
}
}
}
cout << tA << " " << tB << endl;
tA = 0; tB = 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'whole' was not declared in this scope
5 | whole(cin >> n) {
| ^~~~~
|
s676420156 | p00423 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
int a[3]={0};
int b[3]={0};
int A,B;
for(int i=0;i<5;i++){
cin>>n;
if(n==0){break;}
for(int j=0;j<n;j++){
if(a[j]>b[j]){
A+=a[j]+b[j];
}
else(a[j]<b[j]){
B+=a[j]+b[j];
}
}
cout<<A<<" "<<B<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before '{' token
15 | else(a[j]<b[j]){
| ^
| ;
|
s676751483 | p00423 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
int a[3]={0};
int b[3]={0};
int A,B;
for(int i=0;i<5;i++){
cin>>n;
if(n==0){break;}
for(int j=0;j<n;j++){
if(a[j]>b[j]){
A+=a[j]+b[j];
}
else if(a[j]<b[j]){
B+=a[j]+b[j];
}
else if(a[j]==b[j]){
A+=a;
B+=b;
}
}
cout<<A<<" "<<B<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
19 | A+=a;
| ~^~~
| |
| int*
a.cc:20:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
20 | B+=b;
| ~^~~
| |
| int*
|
s189822450 | p00423 | C++ | #include "../bits/stdc++.h"
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (unsigned i = (a); i <= (b); ++i)
#define per(i, a, b) for (unsigned i = (a); i >= (b); --i)
using namespace std;
using I = int;
using L = long;
using F = float;
using S = string;
using LL = long long;
using VI = vector<int>;
using VL = vector<long>;
using VF = vector<float>;
using VS = vector<string>;
using PLL = pair<long, long>;
using PLF = pair<long, float>;
using PLS = pair<long, string>;
using PSL = pair<string, long>;
using PSF = pair<string, float>;
using PSS = pair<string, string>;
using MLL = map<long, long>;
using MLF = map<long, float>;
using MLS = map<long, string>;
using MSL = map<string, long>;
using MSF = map<string, float>;
using MSS = map<string, string>;
const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;
int main(int argc, char const *argv[]) {
while (1) {
L n;
L ans1 = 0;
L ans2 = 0;
scanf("%ld", &n);
if (n == 0) { break; }
for (unsigned i = 0; i < n; i++) {
L a, b;
cin >> a >> b;
if (a > b) {
ans1 += a + b;
} else if (a < b) {
ans2 += a + b;
} else {
ans1 += a;
ans2 += b;
}
}
printf("%ld %ld\n", ans1, ans2);
}
return 0;
} | a.cc:1:10: fatal error: ../bits/stdc++.h: No such file or directory
1 | #include "../bits/stdc++.h"
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
|
s408160713 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int a,b;
int A,B;
cin>>n;
if(n=0){break;}
for(int j=0;j<5;j++){
for(int i=0;i<10000;i++){
cin>>a>>b;
if(a>b){
A+=a+b;
}
else if(a<b){
B+=a+b;
}
else {
A+=a;
B+=b;
}
}
}
cout<<A<<" "<<B<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:17: error: break statement not within loop or switch
8 | if(n=0){break;}
| ^~~~~
|
s264484145 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int a,b;
int A,B;
cin>>n;
if(n=0){break;}
for(int j=0;j<5;j++){
for(int i=0;i<10000;i++){
cin>>a>>b;
if(a>b){
A+=a+b;
}
else if(a<b){
B+=a+b;
}
else {
A+=a;
B+=b;
}
}
}
cout<<A<<" "<<B<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:17: error: break statement not within loop or switch
8 | if(n=0){break;}
| ^~~~~
|
s256829068 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int a,b;
int A,B;
cin>>n;
if(n==0){break;}
while(true){
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
A+=a+b;
}
else if(a<b){
B+=a+b;
}
else {
A+=a;
B+=b;
}
}
}
cout<<A<<" "<<B<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: break statement not within loop or switch
8 | if(n==0){break;}
| ^~~~~
|
s263047836 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int a,b;
int A,B;
cin>>n;
if(n==0){break;}
while(true){
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
A+=a+b;
}
else if(a<b){
B+=a+b;
}
else {
A+=a;
B+=b;
}
}
}
cout<<A<<" "<<B<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: break statement not within loop or switch
8 | if(n==0){break;}
| ^~~~~
|
s376948358 | p00423 | C++ | #include<stdio.h>
#include<stdlib.h>
void judge(int n, int a[], int b[], int *result1, int *result2) {
while (--n >= 0) {
if (a[n] > b[n]) {
*result1 += a[n] + b[n];
}
else if (a[n] < b[n]) {
*result2 += a[n] + b[n];
}
else if (a[n] == b[n]) {
*result1 += a[n];
* result2 += b[n];
}
}
}
int main() {
int a[10];
int b[10];
int n, t = 0;
int result1 = 0, result2 = 0;
int result[10][2];
do {
scanf_s("%d", &n);
for (int i = 0; i < n; i++) {
scanf_s("%d %d", &a[i], &b[i]);
}
judge(n, a, b, &result1, &result2);
result[t][0] = result1;
result[t][1] = result2;
result1 = 0;
result2 = 0;
t++;
} while (n != 0);
for (int i = 0; i < t-1;i++) {
printf("%d %d\n", result[i][0], result[i][1]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:24:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s403124776 | p00423 | C++ | #include<stdio.h>
void judge(int n, int a[], int b[], int *result1, int *result2) {
while (--n >= 0) {
if (a[n] > b[n]) {
*result1 += a[n] + b[n];
}
else if (a[n] < b[n]) {
*result2 += a[n] + b[n];
}
else if (a[n] == b[n]) {
*result1 += a[n];
* result2 += b[n];
}
}
}
int main() {
int a[10];
int b[10];
int n, t = 0;
int i;
int result1 = 0, result2 = 0;
int result[10][2];
do {
scanf_s("%d", &n);
for (i = 0; i < n; i++) {
scanf_s("%d %d", &a[i], &b[i]);
}
judge(n, a, b, &result1, &result2);
result[t][0] = result1;
result[t][1] = result2;
result1 = 0;
result2 = 0;
t++;
} while (n != 0);
for (i = 0; i < t-1;i++) {
printf("%d %d\n", result[i][0], result[i][1]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:24:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s378691525 | p00423 | C++ | #include<stdio.h>
int main(void){
while(1){
int n;
int p1,p2;
scanf("%d",&n);
if(n==0){
break;
}
p1=p2=0;
for(int i=0;i<n;i++){
int a,b;
scanf("%d%d",&a,&b);
if(a>b){
p1+=a+b;
}else if(a<b){
p2+=a+b;
}else{
p1+=a;
p2+=b;
}
}
printf("%d %d\n",a,b);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:25:34: error: 'a' was not declared in this scope
25 | printf("%d %d\n",a,b);
| ^
a.cc:25:36: error: 'b' was not declared in this scope
25 | printf("%d %d\n",a,b);
| ^
|
s908288590 | p00423 | C++ | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:35: error: 'scanf' was not declared in this scope
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~
a.cc:1:52: error: 'printf' was not declared in this scope
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
|
s071095750 | p00423 | C++ | #include<stdio.h>
int main{
int n;
int A=0;
int B=0;
int i=0;
scanf("%d", &n);
int x[n];
int y[n];
while(i<n){
scanf("%d", &x[i]);
scanf("%d", &y[i]);
++i;
}
i=0;
while(i<n){
if(x[i]>y[i]){
A=A+x[i]+y[i];
}else {
if(x[i]<y[i]){
B=B+x[i]+y[i];
}else{
A=A+x[i];
B=B+y[i];
}
}
++i
}
printf("%d %d\n", A, B);
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:9: error: expected primary-expression before 'int'
4 | int n;
| ^~~
a.cc:4:9: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:8:14: error: expected constructor, destructor, or type conversion before '(' token
8 | scanf("%d", &n);
| ^
a.cc:9:15: error: 'n' was not declared in this scope
9 | int x[n];
| ^
a.cc:10:15: error: 'n' was not declared in this scope
10 | int y[n];
| ^
a.cc:11:9: error: expected unqualified-id before 'while'
11 | while(i<n){
| ^~~~~
a.cc:16:9: error: 'i' does not name a type
16 | i=0;
| ^
a.cc:17:9: error: expected unqualified-id before 'while'
17 | while(i<n){
| ^~~~~
a.cc:30:15: error: expected constructor, destructor, or type conversion before '(' token
30 | printf("%d %d\n", A, B);
| ^
a.cc:31:1: error: expected declaration before '}' token
31 | }
| ^
|
s874329145 | p00423 | C++ | main(n,a,b,A,B){for(;A=B=0,scanf("%d", &n),n;printf("%d %d\n",A,B))for(;n--;)scanf("%d%d",&a,&b),(a>b)?A+=a+b:(a<b)?B+=a+b:(A+=a,B+=b);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n,a,b,A,B){for(;A=B=0,scanf("%d", &n),n;printf("%d %d\n",A,B))for(;n--;)scanf("%d%d",&a,&b),(a>b)?A+=a+b:(a<b)?B+=a+b:(A+=a,B+=b);}
| ^
|
s590922025 | p00423 | C++ | a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);} | a.cc:1:1: error: 'a' does not name a type
1 | a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);}
| ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
1 | a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);}
| ^
|
s027121081 | p00423 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
using namespace std;
void main()
{
int n,ca,cb,A,B;
cin>>n;
while(n>0){
ca=cb=A=B=0;
for(int i=0;i<n;i++){
cin>>ca>>cb;
if(ca>cb) A+=ca+cb;
else if(cb>ca) B+=ca+cb;
else{A+=ca;B+=cb;}
}
cout<<A<<" "<<B<<endl;
cin>>n;
}
} | a.cc:10:1: error: '::main' must return 'int'
10 | void main()
| ^~~~
|
s779105524 | p00423 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
while(1)
{
int num;
cin>>num;
if(num == 0)
{
break;
}
vector< int > cardA(num);
vector< int > cardB(num);
for(int i=0;i<num;++i)
{
int pA, pB;
cin>>pA>>pB;
cardA[i] = pA;
cardB[i] = pB;
}
int pointA = 0;
int pointB = 0;
for(int i=0;i<um;++i)
{
if(cardA[i] ==cardB[i])
{
pointA += cardA[i];
pointB += cardA[i];
}
else if(cardA[i] > cardB[i])
{
pointA += cardA[i] + cardB[i];
}
else
{
pointB += cardA[i] + cardB[i];
}
}
cout<<pointA<<" "<<pointB<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:31:23: error: 'um' was not declared in this scope; did you mean 'num'?
31 | for(int i=0;i<um;++i)
| ^~
| num
|
s667815888 | p00423 | C++ | #include<stdio.h>
void main(){
int n, i;
int card[2];
int result[2];
result[0] = result[1] = 0;
scanf("%d",&n);
for(i=0;i < n;i++){
card[0] = card[1] = 0;
scanf("%d %d", &card[0], &card[1]);
if(card[0] < card[1]) result[1] += card[0] + card[1];
else if(card[0] > card[1]) result[0] += card[0] + card[1];
else{
result[0] += card[0];
result[1] += card[1];
}
}
printf("%d %d\n", result[0], result[1]);
return 0;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s224165210 | p00423 | C++ | a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);} | a.cc:1:1: error: 'a' does not name a type
1 | a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);}
| ^
a.cc:1:13: error: expected constructor, destructor, or type conversion before '(' token
1 | a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);}
| ^
|
s494352909 | p00423 | C++ | #include<iostream>
int main(){
int n,a,b,pa,pb;
pa=0;pb=0
cin>>n;
for(;;){
for(int i=0;i<n;i++){
cin>>a;
cin>>b;
if(a==b){pa+=a; pb+=a}
if(a>b){pa+=a+b;}
if(a<b){pb+=a+b;}
}
if(n==0){break;}
cout<<pa<<" "<<pb<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected ';' before 'cin'
5 | pa=0;pb=0
| ^
| ;
6 | cin>>n;
| ~~~
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin>>a;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:11:22: error: expected ';' before '}' token
11 | if(a==b){pa+=a; pb+=a}
| ^
| ;
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout<<pa<<" "<<pb<<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:16:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout<<pa<<" "<<pb<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s213833933 | p00423 | C++ | #include<iostream>
using namespace std
int main(){
int n,a,b,pa,pb;
pa=0;pb=0
cin>>n;
for(;;){
for(int i=0;i<n;i++){
cin>>a;
cin>>b;
if(a==b){pa+=a; pb+=a}
if(a>b){pa+=a+b;}
if(a<b){pb+=a+b;}
}
if(n==0){break;}
cout<<pa<<" "<<pb<<endl;
}
return 0;
} | a.cc:2:20: error: expected ';' before 'int'
2 | using namespace std
| ^
| ;
3 | int main(){
| ~~~
a.cc: In function 'int main()':
a.cc:5:10: error: expected ';' before 'cin'
5 | pa=0;pb=0
| ^
| ;
6 | cin>>n;
| ~~~
a.cc:11:22: error: expected ';' before '}' token
11 | if(a==b){pa+=a; pb+=a}
| ^
| ;
|
s560808412 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n=1;
int a,b,pa,pb;
for(;n!=0;){
cin>>n;
if(n==0){break;}
pa=0;pb=0;
for(int i=0;i<n;i++){
a=0;b=0;
cin>>a;
cin>>b;
if(a>b){pa+=a+b;}
if(a==b){pa+=a;pb+=b}
if(a<b){pb+=a+b;}
}
cout<<pa<<" "<<pb<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
15 | if(a==b){pa+=a;pb+=b}
| ^
| ;
|
s919305400 | p00423 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int n;
int a=0,=0;
int ac,bc;
cin >> n;
while(n > 0){
n--;
cin >> ac >> bc;
if(ac > bc)
a += ac + bc;
else if(ac < bc)
b += ac + bc;
else
a += ac, b = bc;
}
printf("%d %d\n", a,b);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected unqualified-id before '=' token
9 | int a=0,=0;
| ^
a.cc:20:25: error: 'b' was not declared in this scope; did you mean 'bc'?
20 | b += ac + bc;
| ^
| bc
a.cc:22:34: error: 'b' was not declared in this scope; did you mean 'bc'?
22 | a += ac, b = bc;
| ^
| bc
a.cc:24:29: error: 'b' was not declared in this scope; did you mean 'bc'?
24 | printf("%d %d\n", a,b);
| ^
| bc
|
s759040860 | p00423 | C++ | #include <iostream>
int score_a, score_b;
void main(void)
{
using namespace std;
int n, data_a, data_b;
while(1)
{
cin >> n;
if(!n) break;
score_a = 0;
score_b = 0;
for(; n > 0 ; n--) {
cin >> data_a;
cin >> data_b;
if (data_a > data_b) {
score_a += (data_a + data_b);
} else if(data_a < data_b) {
score_b += (data_a + data_b);
} else {
score_a += data_a;
score_b += data_b;
}
}
cout << score_a << " " << score_b << endl;
}
} | a.cc:5:1: error: '::main' must return 'int'
5 | void main(void)
| ^~~~
|
s675830469 | p00423 | C++ | #include<iostream>
intscore_a,score_b;
intmain(void)
{
usingnamespacestd;
intn,data_a,data_b;
while(1)
{
cin>>n;
if(!n)break;
score_a=0;
score_b=0;
for(;n>0;n--){
cin>>data_a;
cin>>data_b;
if(data_a>data_b){
score_a+=(data_a+data_b);
}elseif(data_a<data_b){
score_b+=(data_a+data_b);
}else{
score_a+=data_a;
score_b+=data_b;
}
}
cout<<score_a<<""<<score_b<<endl;
}
return0;
} | a.cc:2:1: error: 'intscore_a' does not name a type
2 | intscore_a,score_b;
| ^~~~~~~~~~
a.cc:3:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
3 | intmain(void)
| ^~~~~~~
a.cc: In function 'int intmain()':
a.cc:5:1: error: 'usingnamespacestd' was not declared in this scope
5 | usingnamespacestd;
| ^~~~~~~~~~~~~~~~~
a.cc:6:1: error: 'intn' was not declared in this scope; did you mean 'int'?
6 | intn,data_a,data_b;
| ^~~~
| int
a.cc:6:6: error: 'data_a' was not declared in this scope
6 | intn,data_a,data_b;
| ^~~~~~
a.cc:6:13: error: 'data_b' was not declared in this scope
6 | intn,data_a,data_b;
| ^~~~~~
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin>>n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:6: error: 'n' was not declared in this scope
9 | cin>>n;
| ^
a.cc:11:1: error: 'score_a' was not declared in this scope
11 | score_a=0;
| ^~~~~~~
a.cc:12:1: error: 'score_b' was not declared in this scope
12 | score_b=0;
| ^~~~~~~
a.cc:18:2: error: 'elseif' was not declared in this scope
18 | }elseif(data_a<data_b){
| ^~~~~~
a.cc:20:2: error: 'else' without a previous 'if'
20 | }else{
| ^~~~
a.cc:25:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
25 | cout<<score_a<<""<<score_b<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:25:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
25 | cout<<score_a<<""<<score_b<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:27:1: error: 'return0' was not declared in this scope
27 | return0;
| ^~~~~~~
a.cc:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
28 | }
| ^
|
s206905143 | p00423 | C++ | #include<iostream>
int score_a,score_b;
void main(void)
{
using namespace std;
int n,data_a,data_b;
while(1)
{
cin>>n;
if(!n)break;
score_a=0;
score_b=0;
for(;n>0;n--){
cin>>data_a;
cin>>data_b;
if(data_a>data_b){
score_a+=(data_a+data_b);
}else if(data_a<data_b){
score_b+=(data_a+data_b);
}else{
score_a+=data_a;
score_b+=data_b;
}
}
cout<<score_a<<" "<<score_b<<endl;
}
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(void)
| ^~~~
|
s258367830 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n,a,b;
int sumA=0,sumB=0;
while(cin>>n){
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
sumA+=a;
sumA+=b;
}
if(a==b){
sumA+=a;
sumB+=b;
}
if(a<b){
sumB+=a;
sumB+=b;
}}} | a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
21 | }}}
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s800404452 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n,a,b;
int sumA=0,sumB=0;
while(cin>>n){
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
sumA+=a;
sumA+=b;
}
if(a==b){
sumA+=a;
sumB+=b;
}
if(a<b){
sumB+=a;
sumB+=b;
}}} | a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
21 | }}}
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s353219079 | p00423 | C++ | #include <stdio.h>
int N ;
int a ;
int b ;
int point[2] ;
void init ( ) ;
int main ( )
{
while ( scanf ( "%d" , &N ) == 1 && n ) {
init ( ) ;
for ( int i = 0 ; i < N ; i++ ) {
scanf ( "%d %d" , &a , &b ) ;
if ( a > b ) {
point[0] += ( a + b ) ;
}
else if ( a == b ) {
point[0] += a ;
point[1] += b ;
}
else {
point[1] += ( a + b ) ;
}
}
printf ( "%d %d\n" , point[0] , point[1] ) ;
}
return 0 ;
}
void init ( )
{
point[0] = point[1] = 0 ;
} | a.cc: In function 'int main()':
a.cc:12:45: error: 'n' was not declared in this scope
12 | while ( scanf ( "%d" , &N ) == 1 && n ) {
| ^
|
s116519780 | p00423 | C++ | #include <stdio.h>
int main(void)
{
int ans_a, ans_b;
int n;
int a, b;
while (1){
scanf("%d", &n);
if (n == 0){
break;
}
ans_a = ans_b = 0;
while (n){
scanf("%d %d", &a, &b);
if (a > b){
ans_a += (a + b);
}
else if (a < b){
ans_b += (a + b);
}
else {
ans_a += a;
ans_b += b;
}
n--;
}
printf("%d %d\n", ans_a, ans_b);
return (0);
} | a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
35 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s872328333 | p00423 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int a;
int b;
int c;
int d;
int e;
while(cin >>n){
c=0;
d=0;
e=0;
while(e<n){
cin >>a;
cin >>b;
if(a>b){c=c+a+b;}
if(a==b){c=c+a; d=d+b;}
if(a<b){d=d+a+b;}
e=e+1;}
cout << c <<" "<<d<<endl
}
} | a.cc: In function 'int main()':
a.cc:22:25: error: expected ';' before '}' token
22 | cout << c <<" "<<d<<endl
| ^
| ;
23 | }
| ~
|
s082026754 | p00423 | C++ | #include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
while(true){
int pa = 0, pb = 0
int a, b
scanf("%d", &n);
if(!n) break;
for(i = 0; i < n; i++){
scanf("%d%d", &a, &b);
if(a > b)
pa += a + b;
else if(b > a)
pb += a + b;
else if(a == b){
pa += a;
pb += b;
}
}
printf("%d %d\n", pa, pb);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: expected ',' or ';' before 'int'
10 | int a, b
| ^~~
a.cc:12:21: error: 'n' was not declared in this scope; did you mean 'yn'?
12 | if(!n) break;
| ^
| yn
a.cc:13:21: error: 'i' was not declared in this scope
13 | for(i = 0; i < n; i++){
| ^
a.cc:13:32: error: 'n' was not declared in this scope; did you mean 'yn'?
13 | for(i = 0; i < n; i++){
| ^
| yn
a.cc:14:40: error: 'a' was not declared in this scope; did you mean 'pa'?
14 | scanf("%d%d", &a, &b);
| ^
| pa
a.cc:14:44: error: 'b' was not declared in this scope; did you mean 'pb'?
14 | scanf("%d%d", &a, &b);
| ^
| pb
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.