submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s143090045 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int *students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(i)<<endl;
}
}
return 0;
} | a.cc: In function 'char hyakuten(int* (*)[3], int)':
a.cc:6:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
6 | if(students[n][i]==100)return 'A';
| ~~~~~~~~~~~~~~^~~~~
a.cc:8:21: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
8 | if((students[n][0]+students[n][1])/2>=90)return 'A';
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| | |
| int* int*
a.cc:9:21: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
9 | if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| | |
| int* int*
a.cc:10:21: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
10 | if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| | |
| int* int*
a.cc:11:7: error: 'studnets' was not declared in this scope; did you mean 'students'?
11 | if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
| ^~~~~~~~
| students
a.cc:11:74: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
| ~~~~~~~~~~~~~~^~~~
a.cc:11:94: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
| ~~~~~~~~~~~~~~^~~~
a.cc: In function 'int main()':
a.cc:26:22: error: invalid conversion from 'int' to 'int* (*)[3]' [-fpermissive]
26 | cout<<hyakuten(i)<<endl;
| ^
| |
| int
a.cc:26:21: error: too few arguments to function 'char hyakuten(int* (*)[3], int)'
26 | cout<<hyakuten(i)<<endl;
| ~~~~~~~~^~~
a.cc:4:6: note: declared here
4 | char hyakuten(int *students[][3],int n){
| ^~~~~~~~
|
s319399102 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(i)<<endl;
}
}
return 0;
} | a.cc: In function 'char hyakuten(int (*)[3], int)':
a.cc:11:7: error: 'studnets' was not declared in this scope; did you mean 'students'?
11 | if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
| ^~~~~~~~
| students
a.cc: In function 'int main()':
a.cc:26:22: error: invalid conversion from 'int' to 'int (*)[3]' [-fpermissive]
26 | cout<<hyakuten(i)<<endl;
| ^
| |
| int
a.cc:26:21: error: too few arguments to function 'char hyakuten(int (*)[3], int)'
26 | cout<<hyakuten(i)<<endl;
| ~~~~~~~~^~~
a.cc:4:6: note: declared here
4 | char hyakuten(int students[][3],int n){
| ^~~~~~~~
|
s445172150 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((students[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(i)<<endl;
}
}
return 0;
} | a.cc: In function 'char hyakuten(int (*)[3], int)':
a.cc:11:22: error: 'studnets' was not declared in this scope; did you mean 'students'?
11 | if((students[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
| ^~~~~~~~
| students
a.cc: In function 'int main()':
a.cc:26:22: error: invalid conversion from 'int' to 'int (*)[3]' [-fpermissive]
26 | cout<<hyakuten(i)<<endl;
| ^
| |
| int
a.cc:26:21: error: too few arguments to function 'char hyakuten(int (*)[3], int)'
26 | cout<<hyakuten(i)<<endl;
| ~~~~~~~~^~~
a.cc:4:6: note: declared here
4 | char hyakuten(int students[][3],int n){
| ^~~~~~~~
|
s322770267 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((students[n][0]+students[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(i)<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:22: error: invalid conversion from 'int' to 'int (*)[3]' [-fpermissive]
26 | cout<<hyakuten(i)<<endl;
| ^
| |
| int
a.cc:26:21: error: too few arguments to function 'char hyakuten(int (*)[3], int)'
26 | cout<<hyakuten(i)<<endl;
| ~~~~~~~~^~~
a.cc:4:6: note: declared here
4 | char hyakuten(int students[][3],int n){
| ^~~~~~~~
|
s245608764 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((students[n][0]+students[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(students[i],i)<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:32: error: cannot convert 'int*' to 'int (*)[3]'
26 | cout<<hyakuten(students[i],i)<<endl;
| ~~~~~~~~~~^
| |
| int*
a.cc:4:19: note: initializing argument 1 of 'char hyakuten(int (*)[3], int)'
4 | char hyakuten(int students[][3],int n){
| ~~~~^~~~~~~~~~~~~
|
s737257033 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((students[n][0]+students[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(students[i][],i)<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:34: error: expected primary-expression before ']' token
26 | cout<<hyakuten(students[i][],i)<<endl;
| ^
|
s165665571 | p00218 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
char hyakuten(int students[][3],int n){
for(int i=0;i<3;i++){
if(students[n][i]==100)return 'A';
}
if((students[n][0]+students[n][1])/2>=90)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A';
if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B';
if((students[n][0]+students[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B';
return 'C';
}
int main(){
int n;
while(cin>>n&&n){
int students[10000][3];
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
cin>>students[i][j];
}
}
for(int i=0;i<n;i++){
cout<<hyakuten(students[i][0],i)<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:35: error: invalid conversion from 'int' to 'int (*)[3]' [-fpermissive]
26 | cout<<hyakuten(students[i][0],i)<<endl;
| ~~~~~~~~~~~~~^
| |
| int
a.cc:4:19: note: initializing argument 1 of 'char hyakuten(int (*)[3], int)'
4 | char hyakuten(int students[][3],int n){
| ~~~~^~~~~~~~~~~~~
|
s787004049 | p00218 | C++ | #include<iostream>
using namespace std;
int main(){
while(true){
int n;
cin >> n;
if(n == 0)break;
for(int i = 0; i < n; i++){
int pm, pe, pj;
cin >> pm >> pe >> pj;
if(pm,pe,pj == 100 || (pm + pe) / 2 >= 90 || (pm + pe + pj) / 3 >= 80){
cout << "A" << endl;
}
else if((pm + pe + pj) / 3 >= 70){
cout << "B" << endl;
}
else if((pm + pe + pj) / 3 >= 50 && pm,pe >= 80){
cout << "B" << endl;
}
else{
cout << "C" << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s981285106 | p00218 | C++ | #include<stdio.h>
int main(void)
{
int i,a,b[10001],c[10001],d[10001];
while(1){
scanf("%d",&a);
if(a==0) break;
for(i=0;i<a;i++){
scanf("%d %d %d",&b[i],&c[i],&d[i]);
}
for(i=0;i<a;i++){
if(b==100||c==100||d==100){
printf("A\n");
}
else if((b+c)/2>=90){
printf("A\n");
}
else if((b+c+d)/3>=80){
printf("A\n");
}
else if((b+c+d)/3>=70){
printf("B\n");
}
else if((b+c+d)/3>=50){
if(b>=80||c>=80){
printf("B\n");
}
}
else{
printf("C\n");
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(b==100||c==100||d==100){
| ~^~~~~
a.cc:12:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(b==100||c==100||d==100){
| ~^~~~~
a.cc:12:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(b==100||c==100||d==100){
| ~^~~~~
a.cc:15:19: error: invalid operands of types 'int [10001]' and 'int [10001]' to binary 'operator+'
15 | else if((b+c)/2>=90){
| ~^~
| | |
| | int [10001]
| int [10001]
a.cc:18:19: error: invalid operands of types 'int [10001]' and 'int [10001]' to binary 'operator+'
18 | else if((b+c+d)/3>=80){
| ~^~
| | |
| | int [10001]
| int [10001]
a.cc:21:19: error: invalid operands of types 'int [10001]' and 'int [10001]' to binary 'operator+'
21 | else if((b+c+d)/3>=70){
| ~^~
| | |
| | int [10001]
| int [10001]
a.cc:24:19: error: invalid operands of types 'int [10001]' and 'int [10001]' to binary 'operator+'
24 | else if((b+c+d)/3>=50){
| ~^~
| | |
| | int [10001]
| int [10001]
a.cc:25:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
25 | if(b>=80||c>=80){
| ~^~~~
a.cc:25:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
25 | if(b>=80||c>=80){
| ~^~~~
|
s733856827 | p00218 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <list>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,b,n) for(int i=b;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())
const float PI = 3.1415926;
static const int INFTY = (1<<30);
using namespace std;
typedef long long ll;
typedef long double ld;
int n;
int main() {
while(cin >> n, n) {
rep(i, n) {
int pm, pe, pj;
cin >> pm >> pe >> pj;
float tmp1 = (pm + pe) / 2.0;
float tmp2 = (pm + pe + pj) / 3.0;
if(tmp1 => 90 || tmp2 => 80 || pm == 100 || pe == 100 || pj == 100) {
cout << 'A' << endl;
} else if (tmp2 => 70 || (tmp2 => 50 && (pm => 80 || pe => 80))) {
cout << 'B' << endl;
} else {
cout << 'C' << endl;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:34:16: error: expected primary-expression before '>' token
34 | if(tmp1 => 90 || tmp2 => 80 || pm == 100 || pe == 100 || pj == 100) {
| ^
a.cc:34:30: error: expected primary-expression before '>' token
34 | if(tmp1 => 90 || tmp2 => 80 || pm == 100 || pe == 100 || pj == 100) {
| ^
a.cc:36:24: error: expected primary-expression before '>' token
36 | } else if (tmp2 => 70 || (tmp2 => 50 && (pm => 80 || pe => 80))) {
| ^
a.cc:36:39: error: expected primary-expression before '>' token
36 | } else if (tmp2 => 70 || (tmp2 => 50 && (pm => 80 || pe => 80))) {
| ^
a.cc:36:52: error: expected primary-expression before '>' token
36 | } else if (tmp2 => 70 || (tmp2 => 50 && (pm => 80 || pe => 80))) {
| ^
a.cc:36:64: error: expected primary-expression before '>' token
36 | } else if (tmp2 => 70 || (tmp2 => 50 && (pm => 80 || pe => 80))) {
| ^
|
s800241857 | p00218 | C++ | #include<stdio.h>
int main(void)
{
int n,a,b,c,i;
scanf("%d",&n);
while(n!=0){
for(i=0;i<n;i++){
scanf("%d %d %d",&a,&b,&c);
if(a==100 || b==100 || c==100 || (a+b)/2>89 || (a+b+c)/3>79) printf("A\n");
else if((a+b+c)/3>69 && (a+b+c)/3>49 && (a>79 || b>79)) printf("A\n");
else if((a+b+c)/3>69 || (a+b+c)/3>49 && (a>79 || b>79)) printf("B\n");
else printf("C\n");
}
scanf("%d",&n);
}
return 0; | a.cc: In function 'int main()':
a.cc:16:18: error: expected '}' at end of input
16 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s718014332 | p00218 | C++ | #include<iostream>
int n,pm,pe,pj;
char solve(int m, int e, int j){
char ans='C';
if(m==100 || e==100 || j==100 || m+e>=180 || m+e+j>=240)
ans = 'A';
else if(m+e+j>=210 || (m+e+j>=50 && (m>=80 || e>=80)))
ans = 'B';
return ans;
}
int main(){
while(true){
std::cin >> n;
if(!n)
return 0;
for(int i=0; i<n; i++){
std::cin >> pm >> pe >> pj;
std::cout << solve(pm, pe, pj);
}
delete[] c;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:23:26: error: 'c' was not declared in this scope
23 | delete[] c;
| ^
|
s636523328 | p00218 | C++ | #include<iostream>
char *c;
int n,pm,pe,pj;
char solve(int m, int e, int j){
char ans='C';
if(m==100 || e==100 || j==100 || m+e>=180 || m+e+j>=240)
ans = 'A';
else if(m+e+j>=210 || (m+e+j>=150 && (m>=80 || e>=80)))
ans = 'B';
return ans;
}
int main(){
while(true){
std::cin >> n;
if(!n)
return 0;
c = new char[n];
for(int i=0; i<n; i++){
std::cin >> pm >> pe >> pj;
c[i] = solve(pm, pe, pj);
}
for(int i=0; i<n; i++)
std::cout << c[i] << endl;
delete[] c;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:46: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
26 | std::cout << c[i] << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s622743576 | p00218 | C++ | g#include <iostream>
using namespace std;
char divide(int m, int e, int j) {
if (m == 100 || e == 100 || j == 100) return 'A';
if ( (m+e)/2 >= 90 ) return 'A';
if ( (m+e+j)/3 >= 80 ) return 'A';
if ( (m+e+j)/3 >= 70 ) return 'B';
if ( (m+e+j)/3 >= 50 && (m >= 80 || e >= 80) ) return 'B';
return 'C';
}
int main() {
int n;
while (cin >> n, n) {
while (n--) {
int pm, pe, pj;
cin >> pm >> pe >> pj;
cout << divide(pm, pe, pj) << endl;
}
}
return 0;
} | a.cc:1:2: error: stray '#' in program
1 | g#include <iostream>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:16:12: error: 'cin' was not declared in this scope
16 | while (cin >> n, n) {
| ^~~
a.cc:20:13: error: 'cout' was not declared in this scope
20 | cout << divide(pm, pe, pj) << endl;
| ^~~~
a.cc:20:43: error: 'endl' was not declared in this scope
20 | cout << divide(pm, pe, pj) << endl;
| ^~~~
|
s317100454 | p00218 | C++ | #include <iostream>
using namespace std;
 
char judge(int pm, int pe, int pj)
{
    if(pm == 100 || pe == 100 || pj == 100 || pm + pe >= 180 || pm + pe + pj >= 240) return 'A';
    else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
    return 'C';
}
 
int main()
{
    int n, pm, pe, pj;
    while(cin >> n, n){
        for(int i = 0; i < n; ++i){
            cin >> pm >> pe >> pj;
            cout << judge(pm,pe,pj) << endl;
        }
    }
}
  | a.cc:3:2: error: stray '#' in program
3 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |     if(pm == 100 || pe == 100 || pj == 100 || pm + pe >= 180 || pm + pe + pj >= 240) return 'A';
| ^
a.cc:6:9: error: stray '#' in program
6 |     if(pm == 100 || pe == 100 || pj == 100 || pm + pe >= 180 || pm + pe + pj >= 240) return 'A';
| ^
a.cc:7:2: error: stray '#' in program
7 |     else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
| ^
a.cc:7:9: error: stray '#' in program
7 |     else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
| ^
a.cc:8:2: error: stray '#' in program
8 |     return 'C';
| ^
a.cc:8:9: error: stray '#' in program
8 |     return 'C';
| ^
a.cc:10:2: error: stray '#' in program
10 |  
| ^
a.cc:13:2: error: stray '#' in program
13 |     int n, pm, pe, pj;
| ^
a.cc:13:9: error: stray '#' in program
13 |     int n, pm, pe, pj;
| ^
a.cc:14:2: error: stray '#' in program
14 |     while(cin >> n, n){
| ^
a.cc:14:9: error: stray '#' in program
14 |     while(cin >> n, n){
| ^
a.cc:15:2: error: stray '#' in program
15 |         for(int i = 0; i < n; ++i){
| ^
a.cc:15:9: error: stray '#' in program
15 |         for(int i = 0; i < n; ++i){
| ^
a.cc:15:16: error: stray '#' in program
15 |         for(int i = 0; i < n; ++i){
| ^
a.cc:15:23: error: stray '#' in program
15 |         for(int i = 0; i < n; ++i){
| ^
a.cc:16:2: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:16:9: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:16:16: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:16:23: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:16:30: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:16:37: error: stray '#' in program
16 |             cin >> pm >> pe >> pj;
| ^
a.cc:17:2: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:17:9: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:17:16: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:17:23: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:17:30: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:17:37: error: stray '#' in program
17 |             cout << judge(pm,pe,pj) << endl;
| ^
a.cc:18:2: error: stray '#' in program
18 |         }
| ^
a.cc:18:9: error: stray '#' in program
18 |         }
| ^
a.cc:18:16: error: stray '#' in program
18 |         }
| ^
a.cc:18:23: error: stray '#' in program
18 |         }
| ^
a.cc:19:2: error: stray '#' in program
19 |     }
| ^
a.cc:19:9: error: stray '#' in program
19 |     }
| ^
a.cc:21:2: error: stray '#' in program
21 |  
| ^
a.cc:3:3: error: expected unqualified-id before numeric constant
3 |  
| ^~~
a.cc: In function 'char judge(int, int, int)':
a.cc:6:3: error: lvalue required as unary '&' operand
6 |     if(pm == 100 || pe == 100 || pj == 100 || pm + pe >= 180 || pm + pe + pj >= 240) return 'A';
| ^~~
a.cc:6:10: error: lvalue required as unary '&' operand
6 |     if(pm == 100 || pe == 100 || pj == 100 || pm + pe >= 180 || pm + pe + pj >= 240) return 'A';
| ^~~
a.cc:7:3: error: lvalue required as unary '&' operand
7 |     else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
| ^~~
a.cc:7:10: error: lvalue required as unary '&' operand
7 |     else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
| ^~~
a.cc:7:15: error: 'else' without a previous 'if'
7 |     else if(pm + pe + pj >= 210 || pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) return 'B';
| ^~~~
a.cc:8:3: error: lvalue required as unary '&' operand
8 |     return 'C';
| ^~~
a.cc:8:10: error: lvalue required as unary '&' operand
8 |     return 'C';
| ^~~
a.cc: At global scope:
a.cc:10:3: error: expected unqualified-id before numeric constant
10 |  
| ^~~
a.cc: In function 'int main()':
a.cc:13:3: error: lvalue required as unary '&' operand
13 |     int n, pm, pe, pj;
| ^~~
a.cc:13:10: error: lvalue required as unary '&' operand
13 |     int n, pm, pe, pj;
| ^~~
a.cc:14:3: error: lvalue required as unary '&' operand
14 |     while(cin >> n, n){
| ^~~
a.cc:14:10: error: lvalue required as unary '&' operand
14 |     while(cin >> n, n){
| ^~~
a.cc:15:3: error: lvalue required as unary '&' operand
15 |         for(int i = 0; i < n; ++i){
| ^~~
a.cc:15:10: error: lvalue required as unary '&' operand
15 |         for(int i = 0; i < n; ++i){
| ^~~
a.cc:15:17: error: lvalue required as unary '&' operand
15 |         for(int i = 0; i < n; ++i){
| ^~~
a.cc:15:24: error: lvalue required as unary '&' operand
15 |         for(int i = 0; i < n; ++i){
| ^~~
a.cc:16:3: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:16:10: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:16:17: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:16:24: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:16:31: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:16:38: error: lvalue required as unary '&' operand
16 |             cin >> pm >> pe >> pj;
| ^~~
a.cc:17:3: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:17:10: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:17:17: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:17:24: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:17:31: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:17:38: error: lvalue required as unary '&' operand
17 |             cout << judge(pm,pe,pj) << endl;
| ^~~
a.cc:18:3: error: lvalue required as unary '&' operand
18 |         }
| ^~~
a.cc:18:10: error: lvalue required as unary '&' operand
18 |         }
| ^~~
a.cc:18:17: error: lvalue required as unary '&' operand
18 |         }
| ^~~
a.cc:18:24: error: lvalue required as unary '&' operand
18 |         }
| ^~~
a.cc:19:3: error: lvalue required as unary '&' operand
19 |     }
| ^~~
a.cc:19:10: error: lvalue required as unary '&' operand
19 |     }
| ^~~
a.cc: At global scope:
a.cc:21:3: error: expected unqualified-id before numeric constant
21 |  
| ^~~
|
s714102804 | p00218 | C++ | #include<cstdio>
using namespace std;
int main(){
int n, a, b, c, i , ans[10000];
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = 0; i < n; i++){
ans[i] = 0;
scanf("%d %d %d", &a, &b, &c);
if((a == 100 || b == 100 || c == 100) || (a + b) / 2 >= 90 || (a + b + c) / 3 >= 80) ans[i] = 2;
else{
if((a + b + c) / 3 >= 70) ans[i]++;
if((a + b + c) / 3 >= 50 && a >= 80) ans[i]++;
if((a + b + c) / 3 >= 50 && b >= 80) ans[i]++;
}
}
for(i = 0; i < n; i++){
if(ans > 1) printf("%s\n", 'A');
if(ans == 1) printf("%s\n", 'B');
if(ans == 0) printf("%s\n", 'C');
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
20 | if(ans > 1) printf("%s\n", 'A');
| ~~~~^~~
a.cc:21:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | if(ans == 1) printf("%s\n", 'B');
| ~~~~^~~~
|
s422222699 | p00218 | C++ | #include<cstdio>
using namespace std;
int main(){
int n, a, b, c, i , ans[10000];
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = 0; i < n; i++){
ans[i] = 0;
scanf("%d %d %d", &a, &b, &c);
if((a == 100 || b == 100 || c == 100) || (a + b) / 2 >= 90 || (a + b + c) / 3 >= 80) ans[i] = 2;
else{
if((a + b + c) / 3 >= 70 || ((a + b + c) / 3 >= 50 && a >= 80) || ((a + b + c) / 3 >= 50 && b >= 80)) ans[i]++;
}
}
for(i = 0; i < n; i++){
if(ans > 1) printf("A\n");
if(ans == 1) printf("B\n");
if(ans == 0) printf("C\n");
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
18 | if(ans > 1) printf("A\n");
| ~~~~^~~
a.cc:19:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | if(ans == 1) printf("B\n");
| ~~~~^~~~
|
s951882312 | p00218 | C++ | #include<cstdio>
using namespace std;
int main(){
int n, a, b, c, i , ans[10000];
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = 0; i < n; i++){
ans[i] = 0;
scanf("%d %d %d", &a, &b, &c);
if((a == 100 || b == 100 || c == 100) || (a + b) / 2 >= 90 || (a + b + c) / 3 >= 80) ans[i] = 2;
else{
if((a + b + c) / 3 >= 70 || ((a + b + c) / 3 >= 50 && a >= 80) || ((a + b + c) / 3 >= 50 && b >= 80) ans[i]++;
}
}
for(i = 0; i < n; i++){
if(ans > 1) printf("A\n");
if(ans == 1) printf("B\n");
if(ans == 0) printf("C\n");
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:117: error: expected ';' before 'ans'
14 | if((a + b + c) / 3 >= 70 || ((a + b + c) / 3 >= 50 && a >= 80) || ((a + b + c) / 3 >= 50 && b >= 80) ans[i]++;
| ^~~~
| ;
a.cc:15:13: error: expected primary-expression before '}' token
15 | }
| ^
a.cc:14:127: error: expected ')' before '}' token
14 | if((a + b + c) / 3 >= 70 || ((a + b + c) / 3 >= 50 && a >= 80) || ((a + b + c) / 3 >= 50 && b >= 80) ans[i]++;
| ~ ^
| )
15 | }
| ~
a.cc:15:13: error: expected primary-expression before '}' token
15 | }
| ^
a.cc:18:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
18 | if(ans > 1) printf("A\n");
| ~~~~^~~
a.cc:19:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | if(ans == 1) printf("B\n");
| ~~~~^~~~
|
s329304511 | p00218 | C++ | #include<cstdio>
using namespace std;
int main(){
int n, a, b, c, i , ans[10000];
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = 0; i < n; i++){
ans[i] = 0;
scanf("%d %d %d", &a, &b, &c);
if((a == 100 || b == 100 || c == 100) || (a + b) / 2 >= 90 || (a + b + c) / 3 >= 80) ans[i] = 2;
else{
if((a + b + c) / 3 >= 70 || ((a + b + c) / 3 >= 50 && a >= 80) || ((a + b + c) / 3 >= 50 && b >= 80)) ans[i]++;
}
}
for(i = 0; i < n; i++){
if(ans > 1) printf("A\n");
if(ans == 1) printf("B\n");
if(ans == 0) printf("C\n");
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
18 | if(ans > 1) printf("A\n");
| ~~~~^~~
a.cc:19:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | if(ans == 1) printf("B\n");
| ~~~~^~~~
|
s907661651 | p00218 | C++ | #include<stdio.h>
int main(void){
int i,k;
int h1,m1,s1,h2,m2,s2;
int sum1,sum2;
while(scanf("%d",&k)==0){
for(i=0;i<k;i++){
scanf("%d %d %d",&h1,&m1,&s1);
sum1=h1+m1;
sum2=h1+m1+s1;
if((h1==100||m1==100||s1==100)||sum1=>180||sum2==270) printf("A\n");
else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
else printf("C\n");
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:45: error: expected primary-expression before '>' token
13 | if((h1==100||m1==100||s1==100)||sum1=>180||sum2==270) printf("A\n");
| ^
a.cc:14:21: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
| ^
a.cc:14:33: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
| ^
a.cc:14:43: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
| ^
a.cc:14:51: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
| ^
a.cc:15:8: error: expected primary-expression before 'else'
15 | else printf("C\n");
| ^~~~
a.cc:14:71: error: expected ')' before 'else'
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80)) printf("B\n");
| ~ ^
| )
15 | else printf("C\n");
| ~~~~
|
s249219403 | p00218 | C++ | #include<stdio.h>
int main(void){
int i,k;
int h1,m1,s1,h2,m2,s2;
int sum1,sum2;
while(scanf("%d",&k)==0){
for(i=0;i<k;i++){
scanf("%d %d %d",&h1,&m1,&s1);
sum1=h1+m1;
sum2=h1+m1+s1;
if((h1==100||m1==100||s1==100)||sum1=>180||sum2==270) printf("A\n");
else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80))) printf("B\n");
else printf("C\n");
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:45: error: expected primary-expression before '>' token
13 | if((h1==100||m1==100||s1==100)||sum1=>180||sum2==270) printf("A\n");
| ^
a.cc:14:21: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80))) printf("B\n");
| ^
a.cc:14:33: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80))) printf("B\n");
| ^
a.cc:14:43: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80))) printf("B\n");
| ^
a.cc:14:51: error: expected primary-expression before '>' token
14 | else if(sum1=>210||(sum1=>150&&(h1=>80||m1=>80))) printf("B\n");
| ^
|
s985332071 | p00218 | C++ | #include<stdio.h>
int main(void){
int i,n,t1,t2,j,m,e;
while(0==0)
{
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++){
scanf("%d %d %d",&m,&e,&j);
t1=m+e; t2=m+e+j;
if((m==100 || e==100 || j==100) || (t1>=180) || (t2>=240))
printf("A\n");
else if((t2>=210) || (t2>=150 && ( m>=80 || e>=80)))
printf("B\n");
else printf("C\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s047690924 | p00219 | Java | #include <stdio.h>
int main(void) {
int n,i,j,k[10],buy;
while (1) {
scanf("%d",&n);
if (n==0) break;
for (i=0;i<10;i++) k[i] = 0;
for (i=0;i<n;i++) {
scanf("%d",&buy);
k[buy]++;
}
for (i=0;i<10;i++) {
if (k[i]==0) puts("-");
else {
for (j=0;j<k[i];j++) {
putchar('*');
}
putchar('\n');
}
}
}
return 0;
} | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:5: error: class, interface, enum, or record expected
while (1) {
^
Main.java:7: error: class, interface, enum, or record expected
if (n==0) break;
^
Main.java:9: error: class, interface, enum, or record expected
for (i=0;i<10;i++) k[i] = 0;
^
Main.java:9: error: class, interface, enum, or record expected
for (i=0;i<10;i++) k[i] = 0;
^
Main.java:9: error: class, interface, enum, or record expected
for (i=0;i<10;i++) k[i] = 0;
^
Main.java:10: error: class, interface, enum, or record expected
for (i=0;i<n;i++) {
^
Main.java:10: error: class, interface, enum, or record expected
for (i=0;i<n;i++) {
^
Main.java:10: error: class, interface, enum, or record expected
for (i=0;i<n;i++) {
^
Main.java:12: error: class, interface, enum, or record expected
k[buy]++;
^
Main.java:13: error: class, interface, enum, or record expected
}
^
Main.java:14: error: class, interface, enum, or record expected
for (i=0;i<10;i++) {
^
Main.java:14: error: class, interface, enum, or record expected
for (i=0;i<10;i++) {
^
Main.java:16: error: class, interface, enum, or record expected
else {
^
Main.java:17: error: class, interface, enum, or record expected
for (j=0;j<k[i];j++) {
^
Main.java:17: error: class, interface, enum, or record expected
for (j=0;j<k[i];j++) {
^
Main.java:19: error: class, interface, enum, or record expected
}
^
Main.java:21: error: class, interface, enum, or record expected
}
^
Main.java:26: error: class, interface, enum, or record expected
}
^
20 errors
|
s561910804 | p00219 | Java | import java.io.*;
class Main {
public static void main(String[] args)throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] iceCount = new int[10];
int total;
while (total != 0) {
total = Integer.parseInt(br.readLine());
for (int i = 0; i < total; i++) {
int readValue = Integer.parseInt(br.readLine());
iceCount[readValue]++;
}
for (int i = 0; i < iceCount.length; i++) {
if (iceCount[i] <= 0) {
System.out.println("-");
} else {
for (int j = 0; j < iceCount[i]; j++) {
System.out.print("*");
}
System.out.print("\n");
}
}
iceCount = new int[10];
}
}
} | Main.java:9: error: variable total might not have been initialized
while (total != 0) {
^
1 error
|
s883692227 | p00219 | C | include<stdio.h>
int main(void)
{
int n,i,j,temp;
int ice[10];
while(scanf("%d",&n)!=0)
{
if(n==0)
{
printf("\n");
break;
}
else
{
for(i=0;i<10;i++)
{
ice[i]=0;
}
for(i=0;i<n;i++)
{
scanf("%d",&temp);
ice[temp]++;
}
for(i=0;i<10;i++)
{
if(ice[i]==0)
printf("-\n");
else
{
for(j=0;j<ice[i];j++) printf("*");
printf("\n");
}
}
}
}
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s355949439 | p00219 | C | \include<stdio.h>
#define NUM 10
void hist(int);
int main()
{
int ice[NUM];
int i;
for(i=0;i<NUM;i++) ice[i]=0;
scanf("%d",&n);
for(;n>0;n--)
{
scanf("%d",&i);
ice[i]++;
}
for(i=0;i<NUM;i++) hist(ice[i]);
return 0;
}
void hist(int x)
{
if(x)
{
for(;x>0;x--) printf("*");
}
else printf("-");
printf("\n");
} | main.c:1:1: error: stray '\' in program
1 | \include<stdio.h>
| ^
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | \include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | \include<stdio.h>
main.c:9:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
9 | scanf("%d",&n);
| ^~~~~
main.c:9:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:13: error: 'n' undeclared (first use in this function)
9 | scanf("%d",&n);
| ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:20: error: implicit declaration of function 'hist' [-Wimplicit-function-declaration]
15 | for(i=0;i<NUM;i++) hist(ice[i]);
| ^~~~
main.c: At top level:
main.c:18:6: warning: conflicting types for 'hist'; have 'void(int)'
18 | void hist(int x)
| ^~~~
main.c:15:20: note: previous implicit declaration of 'hist' with type 'void(int)'
15 | for(i=0;i<NUM;i++) hist(ice[i]);
| ^~~~
main.c: In function 'hist':
main.c:22:15: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
22 | for(;x>0;x--) printf("*");
| ^~~~~~
main.c:22:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:15: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
24 | else printf("-");
| ^~~~~~
main.c:24:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
25 | printf("\n");
| ^~~~~~
main.c:25:1: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s179848607 | p00219 | C | \include<stdio.h>
#define NUM 10
void hist(int);
int main()
{
int ice[NUM];
int i,n;
for(i=0;i<NUM;i++) ice[i]=0;
scanf("%d",&n);
for(;n>0;n--)
{
scanf("%d",&i);
ice[i]++;
}
for(i=0;i<NUM;i++) hist(ice[i]);
return 0;
}
void hist(int x)
{
if(x)
{
for(;x>0;x--) printf("*");
}
else printf("-");
printf("\n");
} | main.c:1:1: error: stray '\' in program
1 | \include<stdio.h>
| ^
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | \include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | \include<stdio.h>
main.c:9:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
9 | scanf("%d",&n);
| ^~~~~
main.c:9:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:20: error: implicit declaration of function 'hist' [-Wimplicit-function-declaration]
15 | for(i=0;i<NUM;i++) hist(ice[i]);
| ^~~~
main.c: At top level:
main.c:18:6: warning: conflicting types for 'hist'; have 'void(int)'
18 | void hist(int x)
| ^~~~
main.c:15:20: note: previous implicit declaration of 'hist' with type 'void(int)'
15 | for(i=0;i<NUM;i++) hist(ice[i]);
| ^~~~
main.c: In function 'hist':
main.c:22:15: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
22 | for(;x>0;x--) printf("*");
| ^~~~~~
main.c:22:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:15: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
24 | else printf("-");
| ^~~~~~
main.c:24:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
25 | printf("\n");
| ^~~~~~
main.c:25:1: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s998473111 | p00219 | C | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}} | main.c:1:1: warning: data definition has no type or storage class
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:1:13: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^
main.c:1:15: error: return type defaults to 'int' [-Wimplicit-int]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~
main.c: In function 'main':
main.c:1:15: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~~
main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:56: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcat'
+++ |+#include <string.h>
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
main.c:1:56: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~~~
main.c:1:56: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:1:64: error: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ~^~~
| |
| int *
main.c:1:64: note: expected 'char *' but argument is of type 'int *'
main.c:1:104: error: assignment to expression with array type
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^
main.c:1:107: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~
main.c:1:107: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:122: error: pointer type mismatch in conditional expression [-Wincompatible-pointer-types]
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^
main.c:1:118: note: first expression has type 'int *'
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~~
main.c:1:123: note: second expression has type 'char *'
1 | b[10][2500],t;main(n){for(;scanf("%d",&n)*n;){for(;n--;strcat(b[t],"*"))scanf("%d",&t);for(;++n<10;b[n]=0)puts(*b[n]?b[n]:"-");}}
| ^~~
|
s039810783 | p00219 | C++ | #include<iostream>
using namespace std;
int main() {
while(cin>>n){
int x,m,n;
int a[10000];
for(int i =0;i<n;i++){
cin >> m;
a[m] += 1;
}
for(int j =0;j<10;j++){
if(a[j]==0){
cout << "-";
}else{
for(int k =0;k<a[j];k++){
cout << "*";
}
}
cout << endl;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:14: error: 'n' was not declared in this scope
6 | while(cin>>n){
| ^
|
s269516691 | p00219 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
string t[]{0};
for (int i=0;i<n;++i){
cin >> t[i]
}
for (int i=0;i<1000000000;++i){
for (int j=0;j<t.find(i);++j){
cout << '*';
}
cout << endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '}' token
8 | cin >> t[i]
| ^
| ;
9 | }
| ~
a.cc:11:26: error: request for member 'find' in 't', which is of non-class type 'std::string [1]' {aka 'std::__cxx11::basic_string<char> [1]'}
11 | for (int j=0;j<t.find(i);++j){
| ^~~~
|
s801411614 | p00219 | C++ | case 0:
n[0]++;break;
#include<stdio.h>
int main(){
int n[11]={};
int N,x;
while(1){
scanf("%d",&N);
for(int i=0;i<N;i++)
{
scanf("%d",&x);
n[x]++;
}
for(int i=0;i<10;i++)
{
if(n[i]>0){
for(int j=0;j<n[i];j++)
printf("*");}
else if(n[i]==0)printf("-");
}
printf("\n");
}
return 0;
} | a.cc:1:1: error: expected unqualified-id before 'case'
1 | case 0:
| ^~~~
a.cc:2:8: error: expected unqualified-id before 'break'
2 | n[0]++;break;
| ^~~~~
|
s943176828 | p00219 | C++ | q | a.cc:1:1: error: 'q' does not name a type
1 | q
| ^
|
s920760544 | p00219 | C++ | #include <iostream>
#include <string>
int ice[10];
int main(){
int n;
whlie(std::cin>>n,n){
for(int i=0;i<10;++i)ice[i]=0;
for(int i=0;i<n;++i){
int a;
std::cin>>a;
ice[a]++;
}
for(int i=0;i<10;i++){
if(ice[i]==0)std::cout<<'-'<<std::endl;
else {
std::string s(ice[i],'*');
std::cout<<s<<std::endl;
}
}
}
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'whlie' was not declared in this scope
6 | whlie(std::cin>>n,n){
| ^~~~~
|
s636879679 | p00219 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int n, a[10], x, n;
int main() {
while (true) {
cin >> n;
if (n == 0) { break; }
memset(a, 0, sizeof(a));
for (int i = 0; i < n; i++) {
cin >> x;
a[x]++;
}
for (int i = 0; i < 10; i++) {
if (a[i] == 0) { cout << '-' << endl; }
else {
for (int j = 0; j < a[i]; j++) { cout << '*'; }
cout << endl;
}
}
}
} | a.cc:4:18: error: redefinition of 'int n'
4 | int n, a[10], x, n;
| ^
a.cc:4:5: note: 'int n' previously declared here
4 | int n, a[10], x, n;
| ^
|
s710262431 | p00219 | C++ | import java.util.Scanner
import scala.collection.Searching._
import scala.annotation.tailrec
import scala.collection.immutable.{NumericRange, Queue}
import scala.collection.mutable
import scala.io.StdIn.readLine
class IUnionFind(val size: Int) {
private case class Node(var parent: Option[Int], var treeSize: Int)
private val nodes = Array.fill[Node](size)(new Node(None, 1))
def union(t1: Int, t2: Int): IUnionFind = {
if (t1 == t2) return this
val root1 = root(t1)
val root2 = root(t2)
if (root1 == root2) return this
val node1 = nodes(root1)
val node2 = nodes(root2)
if (node1.treeSize < node2.treeSize) {
node1.parent = Some(t2)
node2.treeSize += node1.treeSize
} else {
node2.parent = Some(t1)
node1.treeSize += node2.treeSize
}
this
}
def connected(t1: Int, t2: Int): Boolean = t1 == t2 || root(t1) == root(t2)
@tailrec
private def root(t: Int): Int = nodes(t).parent match {
case None => t
case Some(p) => root(p)
}
}
object Main {
def solve(sc: => Scanner): Unit = {
val N = sc.nextInt
if (N != 0) {
val A = Array.fill(N)(sc.nextInt).groupBy(x => x).map(x => (x._1, "*" * x._2.length))
for (i <- Range(0, 10)) {
println(A.getOrElse(i, "-"))
}
solve(sc)
}
}
def gcd(i: Long, j: Long): Long = {
if (i < j) (gcd(j, i)) else (if (j == 0) (i) else (gcd(j, i % j)))
}
def main(args: Array[String]): Unit = {
val sc: Scanner = new Scanner(System.in)
solve(sc)
}
}
| a.cc:37:3: error: stray '@' in program
37 | @tailrec
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import scala.collection.mutable
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:45:1: error: 'object' does not name a type
45 | object Main {
| ^~~~~~
|
s231414978 | p00219 | C++ | /* 1 行目に一日に販売されるアイスクリームの総数 n (1 ≤ n ≤ 10000) が与えられます。
* 続く n 行に第 i のアイスクリームの種類 ci (0 ≤ ci≤ 9) が与えられます。
* データセットの数は 20 を超えません。*/
#include<iostream>
using namespace std;
int main(){
while(true){
int n;
cin>>n;
if(n==0)break;
int sum[10]={};
for(int i=0;i<n;i++){
int b;
cin>>b;
sum[b]+=1;
}
for(int i=0;i<10;i++){
if(sum[j]==0){
cout<<"-"<<endl;
for(int j=0;j<sum[i];j++){
cout<<"*"<<endl;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:18:19: error: 'j' was not declared in this scope
18 | if(sum[j]==0){
| ^
a.cc:25:8: error: expected '}' at end of input
25 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s367346527 | p00219 | C++ | #include<cstdio>
#include<algoritm>
#include<iostream>
using namespace std;
int main()
{
int n,c[10]={0},m;
while(1)
{
for(int i=0;i<10;i++)
{
c[i]=0;
}
cin>>n;
if(n==0)
{
break;
}
for(int i=1;i<=n;i++)
{
cin>>m;
c[m]+=1;
}
for(int i=0;i<10;i++)
{
if(c[i]==0)
{
cout<<"_"<<end;
}
else
{
for(int j=0;j<c[i];i++)
{
cout<<"*";
}
cout<<endl;
}
}
}
retutn 0;
}
| a.cc:2:9: fatal error: algoritm: No such file or directory
2 | #include<algoritm>
| ^~~~~~~~~~
compilation terminated.
|
s518872640 | p00219 | C++ | #include<cstdio>
#include<cstring>
int main(){
int a,j,b[10];
while(1){
scanf("%d",&a);
if(a==0) return 0;
memset(b,0,sizeof(int)*10);
for(int i=0;i<a;i++){
scanf("%d",&j);
b[j]++;
}
for(int i=0;i<10;i++){
if(s==0){
printf("-\n");
continue;
}
for(int s=0;s<b[j];s++){
printf("*");
}
printf("\n");
}
}
} | a.cc: In function 'int main()':
a.cc:14:6: error: 's' was not declared in this scope
14 | if(s==0){
| ^
|
s994925041 | p00219 | C++ | #include <iostream>
using namespace std;
int main()
{
int n, t;
while(cin >> n && n) {
int hist[10];
memset(hist, 0, sizeof(hist));
for(int i = 0; i < n; i++) {
cin >> t;
hist[t]++;
}
for(int i = 0; i < 10; i++) {
if(hist[i] == 0) {
cout << "-" << endl;
} else {
for(int j = 0; j < hist[i]; j++)
cout << "*";
cout << endl;
}
}
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
9 | memset(hist, 0, sizeof(hist));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s289147939 | p00219 | C++ | #include<cstdio>
int main(){
int i,j;
for(int n;scanf("%d",&n),n;){
int p[10]={};
for(i=n;i;--i){
scanf("%d",&j),++p[j];
for(i=0;i<10;++i,puts("")){
for(j=0;j<p[i];++j)
printf("*");
if(!p[i])printf("-");
}
}
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s793523066 | p00220 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (;;) {
double n = sc.nextDouble()*16;
if (n < 0)
break;
if (n >= 4096 || n != (int) n)
System.out.println("NA");
else
for (int i = 11; i >= 0; i--)
System.out.print((((int) n & 1 << i) > 0 ? 1 : 0) + (i == 4 ? "." : i == 0 ? "\n" : ""));
}
}
}
| Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s042552669 | p00220 | C | #include<stdio.h>
#define limit ( 1 << 8 ) - 1
void seisuu( int over_zero )
{
int len = 0 ;
char out[] = { "00000000" } ;
while( over_zero > 1 )
{
out[ len ] = ( over_zero % 2 ) + '0' ;
over_zero /= 2 ;
++len ;
}
out[ len++ ] = over_zero + '0' ;
while( len-- )
{
printf( "%c" ,out[ len ] ) ;
}
return ;
}
bool shousuu( char *out ,double under_zero )
{
int p = 0 ;
while( p < 4 )
{
under_zero *= 2 ;
out[ p++ ] = ( int )under_zero + '0' ;
under_zero -= ( ( int )under_zero / 1 ) ;
if( under_zero == 0 )
{
return true ;
}
}
return false ;
}
int main()
{
double num ;
while( true )
{
char out[] = { "0000\n" } ;
scanf( "%lf" ,&num ) ;
if( num > limit || shousuu( out ,num - ( int )num ) == false )
{
puts( "NA" ) ;
continue ;
}
if( num < 0 )
{
return 0 ;
}
seisuu( ( int )num ) ;
printf( "." ) ;
printf( out ) ;
}
} | main.c:42:1: error: unknown type name 'bool'
42 | bool shousuu( char *out ,double under_zero )
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'shousuu':
main.c:59:32: error: 'true' undeclared (first use in this function)
59 | return true ;
| ^~~~
main.c:59:32: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:59:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:64:16: error: 'false' undeclared (first use in this function)
64 | return false ;
| ^~~~~
main.c:64:16: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:75:16: error: 'true' undeclared (first use in this function)
75 | while( true )
| ^~~~
main.c:75:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:83:72: error: 'false' undeclared (first use in this function)
83 | if( num > limit || shousuu( out ,num - ( int )num ) == false )
| ^~~~~
main.c:83:72: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s292902495 | p00220 | C | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;} | main.c:1:1: warning: data definition has no type or storage class
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:14: error: return type defaults to 'int' [-Wimplicit-int]
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^~~~
main.c: In function 'main':
main.c:1:41: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
main.c:1:41: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^~~~~
main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:61: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^~~~
main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:93: error: 'i' undeclared (first use in this function)
1 | n;char s[14];main(float d){for(s[8]=46;~scanf("%f",&d);d<0||puts(d-n/16.?"NA":s))for(n=d*16,i=12;i--;n/=2)s[i+i/8]=48+n%2;}
| ^
main.c:1:93: note: each undeclared identifier is reported only once for each function it appears in
|
s478348746 | p00220 | C | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:78: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
main.c:1:78: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~~
main.c:1:78: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:192: error: lvalue required as left operand of assignment
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^
main.c:1:215: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~
main.c:1:215: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:248: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~~~
main.c:1:248: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:248: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:248: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:268: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~~~
main.c:1:268: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:288: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~~~
main.c:1:288: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:365: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
main.c:1:365: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | b,i,j;main(n){float a,x;char t[9],l[9];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0 && j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(b=0;b++<8-i;)printf("0");for(;i;)printf("%c",t[--i]);printf(".");for(;j>i;)printf("%c",l[i++]);for(;4>i++;)printf("0");puts("");}}exit(0);}
| ^~~~
main.c:1:365: note: include '<stdlib.h>' or provide a declaration of 'e |
s624258548 | p00220 | C | /*PCK2010-5 m̤µ½ñi 2011.8.6*/
#include <stdio.h>
#include <string.h>
float Seisuu(float m); /*®ª²«oµÖÌÖvg^Cvé¾*/
int main(void) /*mainÖ*/
{
/*Ïé¾*/
float num; /*üÍ·é\i*/
float seisuu; /*SeisuuÖ̼øãüpÏ(numÌ®i[Ï)*/
float syousuu; /*num̬i[Ï*/
char bin[9]; /*oÍ·éñiÌ®*/
char bind[5]; /*oÍ·éñi̬*/
int i,j; /*[vpÏ*/
scanf("%f", &num);
while(num >= 0){
for(i = 0; i < 9; i++){
bin[i] = '0';
if(i < 5){
bind[i] = '0';
}
}
seisuu = Seisuu(num);
syousuu = num - seisuu;
i = 0;
while((int)seisuu != 0){
bin[i] = (int)seisuu % 2 + '0';
seisuu /= 2;
i++;
if(i >= 9){
break;
}
}
j = 0;
while(syousuu != 0){
syousuu *= 2;
bind[j] = Seisuu(syousuu) + '0';
syousuu -= Seisuu(syousuu);
j++;
if(j >= 5) {
break;
}
}
if (i < 9 && j < 5){
printf("%s.%s\n",strrev(bin),bind);
}
else{
printf("NA\n");
}
scanf("%f", &num);
}
return (0);
}
float Seisuu(float m) {
float i;
i = m;
while(!(0<= m && m < 1)){
m--;
}
return(i - m);
} | main.c: In function 'main':
main.c:51:42: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
51 | printf("%s.%s\n",strrev(bin),bind);
| ^~~~~~
| strsep
|
s752081902 | p00220 | C | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
main.c:1:7: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:86: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
main.c:1:86: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~~
main.c:1:86: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:198: error: lvalue required as left operand of assignment
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
main.c:1:221: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~
main.c:1:221: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:346: error: expected ';' before 'g'
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^
| ;
main.c:1:366: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
main.c:1:366: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | b,i,j,q;main(n){float a,x;char t[9],l[9],g[20];for(;;){for(i=0;i<9;i++)t[i]=l[i]='0';scanf("%f",&a);if(a<0)break;b=a;for(i=0;b;)t[i++]='0'+b%2,b/=2;b=a;a-=b;x=0.5;for(j=0;a>0&&j<5;j++){a-x>=0&&l[j]='1',a-=x;x/=2;}if(j>4)puts("NA");else{for(q=b=0;b++<8-i;)g[q++]='0';for(;i;)g[q++]=t[--i];g[q++]='.';for(;j>i;)g[q++]=l[i++];for(;4>i++;)g[q++]='0'g[q]='\0';puts(g);}}exit(0);}
| ^~~~
main.c:1:366: note: include '<stdlib.h>' or provide a declaration of 'exit'
|
s547448133 | p00220 | C++ | #include<iostream>
#include<vector>
int de[8] = {128,62,32,16,8,4,2,1};
double dou[4] = {0.5,0.25,0.125,0.0625};
int main(void){
while(cin>>in,in){
vector<int> ans(12,0);
bool used = false;
for(int i = 0 ; i < 8 ; i ++){
if(in>de[i]){
ans[i] = 1;
in -= de[i];
used = true;
}
}
for(int i = 0 ; i < 4 ; i ++){
if(in>dou[i]){
if(in>dou[i]){
ans[i+8] = 1;
in -= dou[i];
used = true;
}
}
}
if(used && in == 0){
for(int i = 0 ; i < 8 ; i ++)
cout<<ans[i];
cout<<".";
for(int i = 8 ; i < 12 ; i ++)
cout<<ans[i];
cout<<endl;
}else
cout<<"NA"<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | while(cin>>in,in){
| ^~~
| 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:7:14: error: 'in' was not declared in this scope; did you mean 'int'?
7 | while(cin>>in,in){
| ^~
| int
a.cc:8:5: error: 'vector' was not declared in this scope
8 | vector<int> ans(12,0);
| ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/14/vector:93:13: note: 'std::pmr::vector'
93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
8 | vector<int> ans(12,0);
| ^~~
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans[i] = 1;
| ^~~
| abs
a.cc:20:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
20 | ans[i+8] = 1;
| ^~~
| abs
a.cc:28:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
28 | cout<<ans[i];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:28:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | cout<<ans[i];
| ^~~
| abs
a.cc:29:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
29 | cout<<".";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:31:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
31 | cout<<ans[i];
| ^~~
| abs
a.cc:32:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
32 | cout<<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:34:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
34 | cout<<"NA"<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:34:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
34 | cout<<"NA"<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s910072461 | p00220 | C++ | // AOJ 0220
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
double n;
while (cin >> n, n >= 0){
string ret;
int a = (int)n;
while (a != 0){
if (a == 1){
ret += '1';
break;
}
if (a % 2 == 0){
a /= 2;
ret += '0';
}
else {
a /= 2;
ret += '1';
}
}
// cout << ret.length() << endl;
for (int i = ret.length(); i < 8; i++) ret += '0';
// cout << ret.length() << endl;
reverse(ret.begin(), ret.end());
ret += '.';
string ret2;
map <double, bool> memo;
bool f = true;
n -= (int)n;
while (n != 0){
if (memo[n]){
f = false;
break;
}
n *= 2.0;
if (n >= 1.0){
ret2 += '1';
n -= 1.0;
}
else {
ret2 += '0';
}
// cout << n << endl;
memo[n] = true;
}
for (int i = ret2.length(); i < 4; i++) ret2 += '0';
// reverse(ret2.begin(), ret2.end());
if (!f){
cout << "NA" << endl;
}
else {
cout << ret << ret2 << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:31:17: error: 'reverse' was not declared in this scope
31 | reverse(ret.begin(), ret.end());
| ^~~~~~~
|
s874660073 | p00220 | C++ | while(cin>>n,n>=0){
vector<bool>ans(0);
queue< vector<bool> >bfs;
bfs.push(ans);
while(!bfs.empty()){
vector<bool>tmp=bfs.front();
bfs.pop();
if(tmp.size()>12){
cout<<"NA"<<endl;
break;
}
double sum=0;
for(int i=0;i<min(8,(int)tmp.size());i++)if(tmp[i])sum+=pow(2,7-i);
for(int i=0;i<min(4,(int)tmp.size()-5);i++)if(tmp[8+i])sum+=pow(2,-1*(i+1));
if(sum==n){
int cnt=0;
for(int i=0;i<tmp.size();i++){
cout<<tmp[i];
if(cnt==7)cout<<'.';
cnt++;
}
for(int i=0;i<12-tmp.size();i++){
cout<<'0';
if(cnt==7)cout<<'.';
cnt++;
}
cout<<endl;
break;
}
tmp.push_back(0);
bfs.push(tmp);
tmp.erase(tmp.begin()+(tmp.size()-1));
tmp.push_back(1);
bfs.push(tmp);
}
}
} | a.cc:1:9: error: expected unqualified-id before 'while'
1 | while(cin>>n,n>=0){
| ^~~~~
a.cc:37:1: error: expected declaration before '}' token
37 | }
| ^
|
s689615646 | p00220 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
using namespace std;
int main(){
double n;
ios::sync_with_stdio(false);
//for(int i=0;i<ans.size();i++)cout<<ans[i]<<" ";cout<<endl;
while(cin>>n){
if(n<0)break;
vector<bool>ans(0);
queue< vector<bool> >bfs;
bfs.push(ans);
while(!bfs.empty()){
vector<bool>tmp=bfs.front();
bfs.pop();
if(tmp.size()>12){
cout<<"NA"<<endl;
break;
}
double sum=0;
for(int i=0;i<min(8,(int)tmp.size());i++)if(tmp[i])sum+=pow(2,7-i);
for(int i=0;i<min(4,(int)tmp.size()-5);i++)if(tmp[8+i])sum+=pow(2,-1*(i+1));
if(sum==n){
int cnt=0;
for(int i=0;i<tmp.size();i++){
cout<<tmp[i];
if(cnt==7)cout<<'.';
cnt++;
}
for(int i=0;i<12-tmp.size();i++){
cout<<'0';
if(cnt==7)cout<<'.';
cnt++;
}
cout<<endl;
break;
}
tmp.push_back(0);
bfs.push(tmp);
tmp.erase(tmp.begin()+(tmp.size()-1));
tmp.push_back(1);
bfs.push(tmp);
}
} | a.cc: In function 'int main()':
a.cc:47:10: error: expected '}' at end of input
47 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s654212852 | p00220 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
using namespace std;
ios::sync_with_stdio(false);
int main(){
double n;
//for(int i=0;i<ans.size();i++)cout<<ans[i]<<" ";cout<<endl;
while(cin>>n){
if(n<0)break;
vector<bool>ans(0);
queue< vector<bool> >bfs;
bfs.push(ans);
while(!bfs.empty()){
vector<bool>tmp=bfs.front();
bfs.pop();
if(tmp.size()>12){
cout<<"NA"<<endl;
break;
}
double sum=0;
for(int i=0;i<min(8,(int)tmp.size());i++)if(tmp[i])sum+=pow(2,7-i);
for(int i=0;i<min(4,(int)tmp.size()-5);i++)if(tmp[8+i])sum+=pow(2,-1*(i+1));
if(sum==n){
int cnt=0;
for(int i=0;i<tmp.size();i++){
cout<<tmp[i];
if(cnt==7)cout<<'.';
cnt++;
}
for(int i=0;i<12-tmp.size();i++){
cout<<'0';
if(cnt==7)cout<<'.';
cnt++;
}
cout<<endl;
break;
}
tmp.push_back(0);
bfs.push(tmp);
tmp.erase(tmp.begin()+(tmp.size()-1));
tmp.push_back(1);
bfs.push(tmp);
}
}
} | a.cc:7:9: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
7 | ios::sync_with_stdio(false);
| ^~~
|
s868124327 | p00220 | C++ | #include <iostream>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;
const double EPS = 1e-10;
int main(){
double d;
while(cin >> d) {
if(d == -1) break;
int ret[13] = {};
for(int i = 7; i >= -4; --i) {
if(d>=pow(2,i)) {
d-=pow(2,i);
ret[7-i] = 1;
}
if(d<EPS) break;
}
if(d>=EPS) cout << "NA" << endl;
else {
rep(i,8) cout << ret[i];
cout << ".";
rep2(i,8,12) cout << ret[i];
cout << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:12:31: error: 'pow' was not declared in this scope
12 | if(d>=pow(2,i)) {
| ^~~
|
s693161350 | p00220 | C++ | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;
const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
int main(){
while(1){
double n;
scanf("%lf",&n);
if(n<0)break;
int a = (int)(n * 16);
if(a>=(1<<12) || a=<(n*16)){
cout << "NA" << endl;
}else{
for(int i=11;i>=0;i--){
if(i==3) cout << ".";
cout << ((a>>i)&1);
}
cout << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:29:28: error: expected primary-expression before '<' token
29 | if(a>=(1<<12) || a=<(n*16)){
| ^
|
s492990984 | p00220 | C++ | #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
int i;
int n;
string s,t,u;
while(cin>>s&&s[0]!='-'){
n=atoi(s.substr(0,s.find(".")).c_str());
if(n>255){
cout<<"NA"<<endl;
continue;
}
t=u="0000";
for(i=1;i<(int)(s.length()-s.find("."));i++)
t[i-1]=s[s.find(".")+i];
if(t[0]>'4'){
t[0]-=5;
u[0]++;
}
if(t[0]>'1'&&t[1]>'4'){
t[0]-=2;
t[1]-=5;
u[1]++;
}else if(t[0]>'2'){
t[0]-=3;
t[1]+=5;
u[1x]++;
}
if(t[0]>'0'&&t[1]>'1'&&t[2]>'4'){
t[0]-=1;
t[1]-=2;
t[2]-=5;
u[2]++;
}
if(t[1]>'5'&&t[2]>'1'&&t[3]>'4'){
t[1]-=6;
t[2]-=2;
t[3]-=5;
u[3]++;
}
if(t!="0000"){
cout<<"NA"<<endl;
continue;
}
for(i=0;i<8;i++){
cout<<n/(int)pow(2,7-i);
n%=(int)pow(2,7-i);
}
cout<<"."<<u<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:35:9: error: unable to find numeric literal operator 'operator""x'
35 | u[1x]++;
| ^~
|
s704075353 | p00220 | C++ | import java.util.*;
class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
while (true) {
double n = sc.nextDouble();
if (n == -1) break;
int left = (int)n;
String lhs = Integer.toString(left, 2);
if (lhs.length() > 8) {
System.out.println("NA");
continue;
}
double right = n % 1;
String rhs = "";
//int rem = 4;
HashSet<Double> hs = new HashSet<Double>();
hs.add(right);
while (true) {
right *= 2;
if (hs.contains(right)) break;
hs.add(right);
rhs += (int)right;
right %= 1;
}
if (rhs.length() > 4) {
System.out.println("NA");
continue;
}
/*
while (rem-- > 0 && right != 0) {
right *= 2;
rhs += (int)right;
right %= 1;
}
if (right != 0) {
System.out.println("NA");
continue;
}*/
while (lhs.length() != 8) lhs = "0" + lhs;
while (rhs.length() != 4) rhs += "0";
System.out.println(lhs + "." + rhs);
}
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:9: error: expected ':' before 'static'
4 | public static void main(String args[]) {
| ^~~~~~~
| :
a.cc:4:27: error: 'String' has not been declared
4 | public static void main(String args[]) {
| ^~~~~~
a.cc:55:2: error: expected ';' after class definition
55 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:5: error: 'Scanner' was not declared in this scope
5 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:8:18: error: 'sc' was not declared in this scope
8 | double n = sc.nextDouble();
| ^~
a.cc:12:7: error: 'String' was not declared in this scope
12 | String lhs = Integer.toString(left, 2);
| ^~~~~~
a.cc:14:11: error: 'lhs' was not declared in this scope
14 | if (lhs.length() > 8) {
| ^~~
a.cc:15:9: error: 'System' was not declared in this scope
15 | System.out.println("NA");
| ^~~~~~
a.cc:19:24: error: invalid operands of types 'double' and 'int' to binary 'operator%'
19 | double right = n % 1;
| ~ ^ ~
| | |
| | int
| double
a.cc:20:14: error: expected ';' before 'rhs'
20 | String rhs = "";
| ^~~
a.cc:23:7: error: 'HashSet' was not declared in this scope
23 | HashSet<Double> hs = new HashSet<Double>();
| ^~~~~~~
a.cc:23:15: error: 'Double' was not declared in this scope; did you mean 'double'?
23 | HashSet<Double> hs = new HashSet<Double>();
| ^~~~~~
| double
a.cc:23:23: error: 'hs' was not declared in this scope
23 | HashSet<Double> hs = new HashSet<Double>();
| ^~
a.cc:23:32: error: 'HashSet' does not name a type
23 | HashSet<Double> hs = new HashSet<Double>();
| ^~~~~~~
a.cc:23:48: error: expected primary-expression before ')' token
23 | HashSet<Double> hs = new HashSet<Double>();
| ^
a.cc:30:9: error: 'rhs' was not declared in this scope
30 | rhs += (int)right;
| ^~~
a.cc:31:15: error: invalid operands of types 'double' and 'int' to binary 'operator%'
31 | right %= 1;
| ~~~~~~^~~~
a.cc:31:15: note: in evaluation of 'operator%=(double, int)'
a.cc:33:11: error: 'rhs' was not declared in this scope
33 | if (rhs.length() > 4) {
| ^~~
a.cc:34:9: error: 'System' was not declared in this scope
34 | System.out.println("NA");
| ^~~~~~
a.cc:49:14: error: 'lhs' was not declared in this scope
49 | while (lhs.length() != 8) lhs = "0" + lhs;
| ^~~
a.cc:50:14: error: 'rhs' was not declared in this scope
50 | while (rhs.length() != 4) rhs += "0";
| ^~~
a.cc:52:7: error: 'System' was not declared in this scope
52 | System.out.println(lhs + "." + rhs);
| ^~~~~~
a.cc:52:26: error: 'lhs' was not declared in this scope
52 | System.out.println(lhs + "." + rhs);
| ^~~
a.cc:52:38: error: 'rhs' was not declared in this scope
52 | System.out.println(lhs + "." + rhs);
| ^~~
|
s866549677 | p00220 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define EPS (1e-10)
#define EQ(a,b) (abs((-(b))+((a)))<EPS)
int main(){
double d;
while(cin>>d&&!EQ(d,-1)){
int r = (int)d;
double im=d-r;
if(r>=256){
cout<<"NA"<<endl;
continue;
}
else{
vector<int> v;
while(r>0){
v.push_back(r%2);
r/=2;
}
// ÀÌZ
bool match=false;
int s;
for(int i = 0; i < 16; i++){
double d=0;
for(int j = 0; j < 4; j++){
if((i>>j)&1){
d+=pow(0.5,j+1);
}
}
if(EQ(d,im)){
match=true;
s=i;
break;
}
}
if(match){
for(int i = 0; i < 8-v.size(); i++){
cout<<0;
}
for(int i = 0; i < v.size(); i++){
cout<<v[v.size()-1-i];
}
cout<<'.';
// ¬_Ì\¦
for(int i = 0; i < 4; i++){
if((s>>i)&1)
cout<<1;
else
cout<<0;
}
cout<<endl;
}
else
cout<<"NA"<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:33:52: error: 'pow' was not declared in this scope
33 | d+=pow(0.5,j+1);
| ^~~
|
s115524442 | p00220 | C++ | #include <iostream>
using namespace std;
void solve()
{
double a[16];
for(int i = 0; i < 16; ++i)
{
a[i] = i / 16.0;
}
double n;
while(cin >> n, n >= 0)
{
char c[13];
bool flag =true;
for(int i = 0; i < 16; ++i)
{
if(n - (int)n == a[i])
{
flag = false;
for(int j = 12; j >= 9; --j)
{
c[j] = i % 2 + '0';
i /= 2;
}
break;
}
}
if(flag)
{
cout << "NA" << endl;
goto NEXT;
}
c[8] = '.';
int num = (int)n;
for(int i = 7; i >= 0; --i)
{
c[i] = num % 2 + '0';
num /= 2;
}
for(int i = 0; i < 13; ++i)
{
cout << c[i];
}
cout << endl;
NEXT:
;
}
}
int main()
{
solve();
return(0);
} | a.cc: In function 'void solve()':
a.cc:48:1: error: jump to label 'NEXT'
48 | NEXT:
| ^~~~
a.cc:34:30: note: from here
34 | goto NEXT;
| ^~~~
a.cc:37:21: note: crosses initialization of 'int num'
37 | int num = (int)n;
| ^~~
|
s460995730 | p00220 | C++ | #include <cstdio>
#include <cmath>
using namespace std;
int main()
{
for(char buf[80];gets(buf),buf[0]!='-';){
double x; sscanf(buf,"%lf",&x);
if(x>=256){
puts("NA");
continue;
}
if(fmod(x*16,1)>0){
puts("NA");
continue;
}
int a=x,b=fmod(x,1)*16;
for(int i=0;i<8;i++)
putchar('0'+(a>>7-i&1));
putchar('.');
for(int i=0;i<4;i++)
putchar('0'+(b>>3-i&1));
putchar('\n');
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | for(char buf[80];gets(buf),buf[0]!='-';){
| ^~~~
| getw
|
s666917864 | p00221 | C | import java.util.*;
class Main{
public static void main(String[] args){
Scanner scn = new Scanner(System.in);
int m,n;
boolean[] players = new boolean[1000];
for(m=scn.nextInt(), n=scn.nextInt(); n!=0 || m != 0; m=scn.nextInt(), n=scn.nextInt()){
int num = m;
for(int i=0; i<m; i++)
players[i] = true;
for(int i=1,id=0; i<=n; i++){
String word = scn.next();
String correct;
if(i%15 == 0){
correct = "FizzBuzz";
}else if(i%3 == 0){
correct = "Fizz";
}else if(i%5 == 0){
correct = "Buzz";
}else{
correct = Integer.toString(i);
}
if(!word.equals(correct)){
players[id] = false;
if(--num==1)
break;
}
while(true){
id = (id+1)%m;
if(players[id])
break;
}
}
for(int i=0; i<m; i++)
if(players[i])
System.out.print(""+(i+1)+" ");
System.out.println();
}
}
} | main.c:1:1: error: unknown type name 'import'
1 | import java.util.*;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.*;
| ^
main.c:3:1: error: unknown type name 'class'
3 | class Main{
| ^~~~~
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
3 | class Main{
| ^
|
s335946045 | p00221 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void)
{
int m,n;
int i,j=0,k,ans = 1,num,c = 0;
bool player[1001] = { 0 },flag = 0,fl2 = 0;
char str[10],coll[10];
for(;;){
scanf("%d %d", &m, &n);
if(m==0)break;
for(i=0;i<m;i++){
player[i]=1;
}
for(i=0;i<n;i++){
scanf("%s",str);
if(fl2==0){
if(ans%3==0 && ans%5==0){
strcpy(coll,"FizzBuzz");
if(strcmp(coll,str)){
flag=1;
}
}
else if(ans%3==0){
strcpy(coll,"Fizz");
if(strcmp(coll,str)){
flag=1;
}
}
else if(ans%5==0){
strcpy(coll,"Buzz");
if(strcmp(coll,str)){
flag=1;
}
}
else {
num=atoi(str);
if(num!=ans){
flag=1;
}
}
for(;j<m;j++){
if(player[j]==1){
if(flag==1){
player[j]=0;
flag=0;
}
break;
}
}
}
for(k=0;k<m;k++){
if(player[k]==1){
c++;
}
}
if(c==1)fl2=1;
c=0;
j++;
if(j==m)j=0;
ans++;
}
flag=0;
for(i=0;i<m;i++){
if(player[i]==1){
if(flag==1)printf(" ");
printf("%d",i+1);
flag=1;
}
}
printf("\n");
j=0;
ans=1;
flag=0;
fl2=0;
}
return 0;
} | main.c: In function 'main':
main.c:9:9: error: unknown type name 'bool'
9 | bool player[1001] = { 0 },flag = 0,fl2 = 0;
| ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
3 | #include<stdlib.h>
+++ |+#include <stdbool.h>
4 |
|
s376741839 | p00221 | C | n,m,b,q[1024];char s[9],c[9];
main(i,t){for(;scanf("%d%d",&m,&n)*m;){
p=m;
for(t=i=1;i<=n;i++){
scanf("%s",s,*c=0);
i%3||strcat(c,"Fizz");
i%5||strcat(c,"Buzz");
*c||sprintf(c,"%d",i);
for(strcmp(s,c)&&p>1&&(q[t]=p--);q[t=t%m+1];);
}
for(t=i=1;i<=m;i++)q[i]||(q[i]=t=!printf(" %d"+t,i));
puts("");
}
} | main.c:1:1: warning: data definition has no type or storage class
1 | n,m,b,q[1024];char s[9],c[9];
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
1 | n,m,b,q[1024];char s[9],c[9];
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | n,m,b,q[1024];char s[9],c[9];
| ^
main.c:1:7: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int]
1 | n,m,b,q[1024];char s[9],c[9];
| ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(i,t){for(;scanf("%d%d",&m,&n)*m;){
| ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 't' defaults to 'int' [-Wimplicit-int]
main.c:2:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
2 | main(i,t){for(;scanf("%d%d",&m,&n)*m;){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | n,m,b,q[1024];char s[9],c[9];
main.c:2:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
2 | main(i,t){for(;scanf("%d%d",&m,&n)*m;){
| ^~~~~
main.c:2:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:17: error: 'p' undeclared (first use in this function)
3 | p=m;
| ^
main.c:3:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:30: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
6 | i%3||strcat(c,"Fizz");
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcat'
+++ |+#include <string.h>
1 | n,m,b,q[1024];char s[9],c[9];
main.c:6:30: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch]
6 | i%3||strcat(c,"Fizz");
| ^~~~~~
main.c:6:30: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:8:29: error: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
8 | *c||sprintf(c,"%d",i);
| ^~~~~~~
main.c:8:29: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:8:29: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
main.c:8:29: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:9:29: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
9 | for(strcmp(s,c)&&p>1&&(q[t]=p--);q[t=t%m+1];);
| ^~~~~~
main.c:9:29: note: include '<string.h>' or provide a declaration of 'strcmp'
main.c:11:51: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
11 | for(t=i=1;i<=m;i++)q[i]||(q[i]=t=!printf(" %d"+t,i));
| ^~~~~~
main.c:11:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:51: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:17: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
12 | puts("");
| ^~~~
main.c:12:17: note: include '<stdio.h>' or provide a declaration of 'puts'
|
s379531608 | p00221 | C | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}} | main.c:1:1: warning: data definition has no type or storage class
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:6: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
main.c:1:11: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
main.c:1:13: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
main.c:1:15: error: return type defaults to 'int' [-Wimplicit-int]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~
main.c: In function 'main':
main.c:1:15: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
main.c:1:32: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~~
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:54: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~
main.c:1:54: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:124: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcat'
+++ |+#include <string.h>
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
main.c:1:124: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~~~
main.c:1:124: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:1:131: error: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
| |
| int *
main.c:1:131: note: expected 'char *' but argument is of type 'int *'
main.c:1:153: error: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
| |
| int *
main.c:1:153: note: expected 'char *' but argument is of type 'int *'
main.c:1:171: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~
main.c:1:181: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^~~~~~
main.c:1:181: note: include '<string.h>' or provide a declaration of 'strcmp'
main.c:1:188: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| ^
| |
| int *
main.c:1:188: note: expected 'const char *' but argument is of type 'int *'
main.c:1:190: error: passing argument 2 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
1 | s[9],c[9],i,t;main(n,m,b){for(;scanf("%d%d",&m,&n)*m;puts("")){for(t=i=1;i<=n;i++){int q[1024],p=m;scanf("%s",s,*c=0);i%3||strcat(c,"Fizz");i%5||strcat(c,"Buzz");for(!*c?atoi(s)-i:strcmp(s,c)&p>1&&(q[t]=p--);q[t=t%m+1];);}for(t=i=1;i<=m;i++)q[i]||(t=!printf(" %d"+t,i));}}
| |
s461265603 | p00221 | C++ | #include <stdio.h>
int main()
{
int n, m;
char str[16];
int x;
int i, j;
scanf("%d %d", &m, &n);
while (n != 0 && m != 0) {
int p = 1, q = m;
int players[1005] = {};
int print[1005];
int size = 0;
for (i = 1; i <= n; i++) {
scanf("%s", str);
if ( q > 1) {
if ( i % 3 == 0 && i % 5 == 0) {
if (strcmp(str, "FizzBuzz") != 0) {
players[p] = 1;
}
} else if (i % 3 == 0) {
if (strcmp(str, "Fizz") != 0) {
players[p] = 1;
}
} else if (i % 5 == 0) {
if (strcmp(str, "Buzz") != 0) {
players[p] = 1;
}
} else {
x = 0;
for (j = 0; j < strlen(str); j++) {
x *= 10;
x += str[j] - '0';
}
}
}
if (players[p] == 1) q--;
if (p == m) p = 0;
do {
p++;
} while(players[p] == 1);
}
for (i = 1; i <= m; i++) {
if (players[i] == 0) {
print[size] = i;
size++;
}
}
for (i = 0; i < size; i++) {
if (i) printf(" ");
printf("%d", print[i]);
}
putchar('\n');
scanf("%d %d", &m, &n);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:24:25: error: 'strcmp' was not declared in this scope
24 | if (strcmp(str, "FizzBuzz") != 0) {
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 |
a.cc:28:25: error: 'strcmp' was not declared in this scope
28 | if (strcmp(str, "Fizz") != 0) {
| ^~~~~~
a.cc:28:25: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:32:25: error: 'strcmp' was not declared in this scope
32 | if (strcmp(str, "Buzz") != 0) {
| ^~~~~~
a.cc:32:25: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:37:37: error: 'strlen' was not declared in this scope
37 | for (j = 0; j < strlen(str); j++) {
| ^~~~~~
a.cc:37:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s951550083 | p00221 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cctype>
using namespace std;
inline int prev(int idx, int size) { idx--; if(idx < 0) idx = size-1; return idx; }
inline void advance(int& idx, int size) { idx++; if(idx == size) idx = 0; }
inline bool isNumber(const string& s, int& ret) {
ret = -1;
int tmp = 0;
int const size=s.size();
for(int i=0; i<size; i++) {
if(!isdigit(s[i])) return false;
(tmp *= 10) += s[i]-'0';
}
ret = tmp;
return true;
}
void remove(vector<int>& player, int& idx) {
advance(idx, player.size());
player.erase(player.begin()+prev(idx, player.size()));
if(idx!=0) idx--;
}
int main() {
int M, N;
while(cin >> M >> N && (M|N)) {
int idx = 0;
vector<int> player(M);
for(int i=0; i<N; i++) player[i] = i+1;
for(int fcnt=1; fcnt<=N; fcnt++) {
string s; cin >> s;
if(player.size() == 1) continue;
int num;
if(s == "Fizz" && fcnt % 3 != 0) remove(player, idx);
else if(s == "Buzz" && fcnt % 5 != 0) remove(player, idx);
else if(s == "FizzBuzz" && fcnt % 15 != 0) remove(player, idx);
else if(isNumber(s, num)) {
if(num != fcnt) remove(player, idx);
else if(num % 3 == 0) remove(player, idx);
else if(num % 5 == 0) remove(player, idx);
else if(num % 15 == 0) remove(player, idx);
else advance(idx, player.size());
}
else advance(idx, player.size());
}
for(int i=0; i<player.size(); i++) {
if(i) cout << " ";
cout << player[i];
}
cout << endl;
}
return 0;
} | In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h: In instantiation of 'constexpr void std::advance(_InputIterator&, _Distance) [with _InputIterator = int; _Distance = long unsigned int]':
a.cc:25:10: required from here
25 | advance(idx, player.size());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:223:65: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
223 | typename iterator_traits<_InputIterator>::difference_type __d = __n;
| ^~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:224:56: error: no matching function for call to '__iterator_category(int&)'
224 | std::__advance(__i, __d, std::__iterator_category(__i));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: candidate: 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&)'
239 | __iterator_category(const _Iter&)
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&) [with _Iter = int]':
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:224:56: required from 'constexpr void std::advance(_InputIterator&, _Distance) [with _InputIterator = int; _Distance = long unsigned int]'
224 | std::__advance(__i, __d, std::__iterator_category(__i));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:25:10: required from here
25 | advance(idx, player.size());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
239 | __iterator_category(const _Iter&)
| ^~~~~~~~~~~~~~~~~~~
|
s125386545 | p00221 | C++ | #include <bits/stc++.h>
using namespace std;
inline int prev(int idx, int size) { idx--; if(idx < 0) idx = size-1; return idx; }
inline void advance(int& idx, int size) { idx++; if(idx == size) idx = 0; }
inline bool isNumber(const string& s, int& ret) {
ret = -1;
int tmp = 0;
int const size=s.size();
for(int i=0; i<size; i++) {
if(!isdigit(s[i])) return false;
(tmp *= 10) += s[i]-'0';
}
ret = tmp;
return true;
}
void remove(vector<int>& player, int& idx) {
advance(idx, player.size());
player.erase(player.begin()+prev(idx, player.size()));
if(idx!=0) idx--;
}
int main() {
int M, N;
while(cin >> M >> N && (M|N)) {
int idx = 0;
vector<int> player(M);
for(int i=0; i<N; i++) player[i] = i+1;
for(int fcnt=1; fcnt<=N; fcnt++) {
string s; cin >> s;
if(player.size() == 1) continue;
int num;
if(s == "Fizz" && fcnt % 3 != 0) remove(player, idx);
else if(s == "Buzz" && fcnt % 5 != 0) remove(player, idx);
else if(s == "FizzBuzz" && fcnt % 15 != 0) remove(player, idx);
else if(isNumber(s, num)) {
if(num != fcnt) remove(player, idx);
else if(num % 3 == 0) remove(player, idx);
else if(num % 5 == 0) remove(player, idx);
else if(num % 15 == 0) remove(player, idx);
else advance(idx, player.size());
}
else advance(idx, player.size());
}
for(int i=0; i<player.size(); i++) {
if(i) cout << " ";
cout << player[i];
}
cout << endl;
}
return 0;
} | a.cc:1:10: fatal error: bits/stc++.h: No such file or directory
1 | #include <bits/stc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s700386942 | p00221 | C++ | #include <bits/stdc++.h>
using namespace std;
inline int prev(int idx, int size) { idx--; if(idx < 0) idx = size-1; return idx; }
inline void advance(int& idx, int size) { idx++; if(idx == size) idx = 0; }
inline bool isNumber(const string& s, int& ret) {
ret = -1;
int tmp = 0;
int const size=s.size();
for(int i=0; i<size; i++) {
if(!isdigit(s[i])) return false;
(tmp *= 10) += s[i]-'0';
}
ret = tmp;
return true;
}
void remove(vector<int>& player, int& idx) {
advance(idx, player.size());
player.erase(player.begin()+prev(idx, player.size()));
if(idx!=0) idx--;
}
int main() {
int M, N;
while(cin >> M >> N && (M|N)) {
int idx = 0;
vector<int> player(M);
for(int i=0; i<N; i++) player[i] = i+1;
for(int fcnt=1; fcnt<=N; fcnt++) {
string s; cin >> s;
if(player.size() == 1) continue;
int num;
if(s == "Fizz" && fcnt % 3 != 0) remove(player, idx);
else if(s == "Buzz" && fcnt % 5 != 0) remove(player, idx);
else if(s == "FizzBuzz" && fcnt % 15 != 0) remove(player, idx);
else if(isNumber(s, num)) {
if(num != fcnt) remove(player, idx);
else if(num % 3 == 0) remove(player, idx);
else if(num % 5 == 0) remove(player, idx);
else if(num % 15 == 0) remove(player, idx);
else advance(idx, player.size());
}
else advance(idx, player.size());
}
for(int i=0; i<player.size(); i++) {
if(i) cout << " ";
cout << player[i];
}
cout << endl;
}
return 0;
} | 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: In instantiation of 'constexpr void std::advance(_InputIterator&, _Distance) [with _InputIterator = int; _Distance = long unsigned int]':
a.cc:22:10: required from here
22 | advance(idx, player.size());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:223:65: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
223 | typename iterator_traits<_InputIterator>::difference_type __d = __n;
| ^~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:224:56: error: no matching function for call to '__iterator_category(int&)'
224 | std::__advance(__i, __d, std::__iterator_category(__i));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: candidate: 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&)'
239 | __iterator_category(const _Iter&)
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&) [with _Iter = int]':
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:224:56: required from 'constexpr void std::advance(_InputIterator&, _Distance) [with _InputIterator = int; _Distance = long unsigned int]'
224 | std::__advance(__i, __d, std::__iterator_category(__i));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:22:10: required from here
22 | advance(idx, player.size());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
239 | __iterator_category(const _Iter&)
| ^~~~~~~~~~~~~~~~~~~
|
s516118450 | p00221 | C++ | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
var mn=(Arr.shift()).split(" ").map(Number);
if(mn[0]==0 && mn[1]==0)break;
var player=[];
for(var i=0;i<mn[0];i++)player[i]=i+1;
var arr=[];
for(var i=0;i<mn[1];i++){
var v=Arr.shift();
arr.push(v);
}
var i=1;
var k=0;
var len=mn[0];
for(var I=0;I<arr.length;I++){
var v=arr[I];
var str="";
if(i%3==0)str+="Fizz";
if(i%5==0)str+="Buzz";
if(str=="")str=i;
if(v!=str){
player[k]=false;
len++;
if(len==1)break;
}
i++;
do{
k++;
if(k>=player.length){
player=player.filter(function(v){return v!=false;});
k=0;
}
}while(player[k]==false);
}
player=player.filter(function(v){return v!=false;});
console.log(player.join(" "));
} | a.cc:1:21: warning: multi-character character constant [-Wmultichar]
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~
a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~~~~~~~~~
a.cc:1:54: warning: multi-character character constant [-Wmultichar]
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~~~
a.cc:1:1: error: 'var' does not name a type
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~
a.cc:2:1: error: 'var' does not name a type
2 | var Arr=(input.trim()).split("\n");
| ^~~
a.cc:3:1: error: expected unqualified-id before 'while'
3 | while(true){
| ^~~~~
|
s133718634 | p00221 | C++ | #include<iostream>
#include<string>
#include<sstream>
#include<vector>
#define INF (1 << 18);
using namespace std;
void rist_hen(int hu);
vector<int> batu;
int rist[1111];
int n;
int main(){
string str[3] = {"Fizz" , "Buzz" , "FizzBuzz" };
int m;
string s;
while(cin >> n >> m && n && m){
for(int i=0;i<n;i++){
rist[i] = i+1;
}
rist[n-1] = 0;
batu.clear();
int now = 0;
for(int i=1;i<=m;i++){
cin >> s;
if(i%3 == 0 && i%5 == 0){
if(s != str[2]) rist_hen(now);
}
else if(i%3 == 0){
if(s != str[0]) rist_hen(now);
}
else if(i%5 == 0){
if(s != str[1]) rist_hen(now);
}
else {
/*
string tmp;
tmp = to_string(i);
*/
stringstream ss;
ss << i;
string tmp = ss.str();
if(s != tmp) rist_hen(now);
}
now = rist[now];
}
int ans[111111];
int cou = 0;
for(int i=1;i<=n;i++){
vector<int>::iterator it;
it = find(batu.begin(),batu.end(),i);
if(it != batu.end());
else{
ans[cou] = i;
cou++;
}
}
for(int i=0;i<cou;i++){
cout << ans[i];
if(cou-1 == i) cout << endl;
else cout << " ";
}
}
}
void rist_hen(int hu){
//cout << "HU = " << hu << endl;
if(hu == 0){
rist[n-1] = rist[hu];
}
else{
rist[hu-1] = rist[hu];
}
batu.push_back(hu+1);
return;
} | a.cc: In function 'int main()':
a.cc:51:16: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
51 | it = find(batu.begin(),batu.end(),i);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:51:16: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
51 | it = find(batu.begin(),batu.end(),i);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s056123763 | p00221 | C++ | #include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<algorithm>
using namespace std;
void rist_hen(int hu);
vector<int> batu;
int rist[1111];
int n,flag;
int main(){
string str[3] = {"Fizz" , "Buzz" , "FizzBuzz" };
int m;
string s;
while(cin >> n >> m && n && m){
flag = n;
for(int i=0;i<n;i++){
rist[i] = i+1;
}
rist[n-1] = 0;
batu.clear();
int now = 0;
for(int i=1;i<=m;i++){
cin >> s;
if(flag == 1) continue;
if(i%3 == 0 && i%5 == 0){
if(s != str[2]) rist_hen(now);
}
else if(i%3 == 0){
if(s != str[0]) rist_hen(now);
}
else if(i%5 == 0){
if(s != str[1]) rist_hen(now);
}
else {
stringstream ss;
ss << i;
string tmp = ss.str();
if(s != tmp) rist_hen(now);
}
now = rist[now];
}
int ans[111111];
int cou = 0;
for(int i=1;i<=n;i++){
vector<int>::iterator it;
it = find(batu.begin(),batu.end(),i);
if(it != batu.end());
else{
ans[cou] = i;
cou++;
}
}
for(int i=0;i<cou;i++){
cout << ans[i];
if(cou-1 == i) cout << endl;
else cout << " ";
}
}
} | /usr/bin/ld: /tmp/cck51WqP.o: in function `main':
a.cc:(.text+0x1d1): undefined reference to `rist_hen(int)'
/usr/bin/ld: a.cc:(.text+0x22a): undefined reference to `rist_hen(int)'
/usr/bin/ld: a.cc:(.text+0x289): undefined reference to `rist_hen(int)'
/usr/bin/ld: a.cc:(.text+0x2f5): undefined reference to `rist_hen(int)'
collect2: error: ld returned 1 exit status
|
s870723006 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
int m,n;
void solve(){
int x=m;
int cur=0;
bool no[10000]={0};
for(int i=1;i<=n;i++){
while(no[cur])cur=(cur+1)%m;
string s;
cin>>s;
if(x<=1)continue;
bool ok=true;
if(i%3==0&&i%5==0){
if(s!="FizzBuzz")ok=false;
}
else if(i%3==0){
if(s!="Fizz")ok=false;
}
else if(i%5==0){
if(s!="Buzz")ok=false;
}
else{
stringstream ss;
string d;
ss<<i;
ss>>d;
if(s!=d)ok=false;
}
if(!ok){
no[cur]=true;
x--;
}
cur=(cur+1)%m;
}
bool flag=false;
for(int i=0;i<m;i++)if(!no[i]){
if(flag)cout<<" ";
else flag=true;
cout<<i+1;
}
cout<<endl;
}
int main(){
while(cin>>m>>n,m||n)solve();
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int m,n;
void solve(){
int x=m;
int cur=0;
bool no[10000]={0};
for(int i=1;i<=n;i++){
while(no[cur])cur=(cur+1)%m;
string s;
cin>>s;
if(x<=1)continue;
bool ok=true;
if(i%3==0&&i%5==0){
if(s!="FizzBuzz")ok=false;
}
else if(i%3==0){
if(s!="Fizz")ok=false;
}
else if(i%5==0){
if(s!="Buzz")ok=false;
}
else{
stringstream ss;
string d;
ss<<i;
ss>>d;
if(s!=d)ok=false;
}
if(!ok){
no[cur]=true;
x--;
}
cur=(cur+1)%m;
}
bool flag=false;
for(int i=0;i<m;i++)if(!no[i]){
if(flag)cout<<" ";
else flag=true;
cout<<i+1;
}
cout<<endl;
}
int main(){
while(cin>>m>>n,m||n)solve();
return 0;
} | a.cc:55:5: error: redefinition of 'int m'
55 | int m,n;
| ^
a.cc:3:5: note: 'int m' previously declared here
3 | int m,n;
| ^
a.cc:55:7: error: redefinition of 'int n'
55 | int m,n;
| ^
a.cc:3:7: note: 'int n' previously declared here
3 | int m,n;
| ^
a.cc:57:6: error: redefinition of 'void solve()'
57 | void solve(){
| ^~~~~
a.cc:5:6: note: 'void solve()' previously defined here
5 | void solve(){
| ^~~~~
a.cc:101:5: error: redefinition of 'int main()'
101 | int main(){
| ^~~~
a.cc:49:5: note: 'int main()' previously defined here
49 | int main(){
| ^~~~
|
s107999379 | p00221 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;
int main(){
int m, n;
char s[9];
while(scanf("%d%d", &m, &n) && m && n){
vector<bool>mem(m);
rep(i, m) mem[i] = false;
int p = 0, c = 1;
FOR(i, 1, n+1){
scanf("%s", s);
if(c < m){
int f = 0;
if(i % 15 == 0){
if(strcmp(s, "FizzBuzz")) f = 1;
}else if(i % 5 == 0){
if(strcmp(s, "Buzz")) f = 1;
}else if(i % 3 == 0){
if(strcmp(s, "Fizz")) f = 1;
}else{
if(i != atoi(s)) f = 1;
}
if(f) mem[p] = 1, ++c;
do{
p = (p+1)%m;
}while(mem[p]);
}
}
int f = 0;
rep(i, m){
if(!mem[i]){
printf(f ? " %d":"%d", i + 1);
f = 1;
}
}
puts("");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:11: error: 'i' was not declared in this scope
14 | rep(i, m) mem[i] = false;
| ^
a.cc:14:7: error: 'rep' was not declared in this scope
14 | rep(i, m) mem[i] = false;
| ^~~
|
s753620505 | p00221 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;
int main(){
int m, n;
char s[9];
while(scanf("%d%d", &m, &n) && m && n){
vector<bool>mem(m);
rep(i, m) mem[i] = false;
int p = 0, c = 1;
FOR(i, 1, n+1){
scanf("%s", s);
if(c < m){
int f = 0;
if(i % 15 == 0){
if(strcmp(s, "FizzBuzz")) f = 1;
}else if(i % 5 == 0){
if(strcmp(s, "Buzz")) f = 1;
}else if(i % 3 == 0){
if(strcmp(s, "Fizz")) f = 1;
}else{
if(i != atoi(s)) f = 1;
}
if(f) mem[p] = 1, ++c;
do{
p = (p+1)%m;
}while(mem[p]);
}
}
int f = 0;
rep(i, m){
if(!mem[i]){
printf(f ? " %d":"%d", i + 1);
f = 1;
}
}
puts("");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:11: error: 'i' was not declared in this scope
14 | rep(i, m) mem[i] = false;
| ^
a.cc:14:7: error: 'rep' was not declared in this scope
14 | rep(i, m) mem[i] = false;
| ^~~
|
s237148713 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
bool isCorrect(int n, string s)
{
string solution;
if (n % 3 == 0 && n % 5 == 0) solution = "FizzBuzz";
else if (n % 3 == 0) solution = "Fizz";
else if (n % 5 == 0) solution = "Buzz";
else solution = to_stirng(n);
return solution == s;
}
int main()
{
int M, N;
while (cin >> M >> N, N || M)
{
bool isExist[1000] = {};
fill_n(isExist, M, true);
int cnt = M, p = 0;
for (int i = 1; i <= N; i++, p = (p + 1) % M)
{
while (!isExist[p]) p = (p + 1) % M;
string s;
cin >> s;
if (!isCorrect(i, s))
{
isExist[p] = false;
if (--cnt == 1) break;
}
}
vector<int> ans;
for (int i = 0; i < M; i++)
{
if (isExist[i]) ans.push_back(i);
}
printf("%d", ans[0] + 1);
for (int i = 1; i < ans.size(); i++)
{
printf(" %d", ans[i] + 1);
}
puts("");
}
return 0;
} | a.cc: In function 'bool isCorrect(int, std::string)':
a.cc:11:21: error: 'to_stirng' was not declared in this scope
11 | else solution = to_stirng(n);
| ^~~~~~~~~
|
s044790491 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
string to_string(int N){
stringstream ss;
ss<<N;
string ret;
ss>>ret;
return ret;
}
bool isCorrect(int n, string s)
{
string solution;
if (n % 3 == 0 && n % 5 == 0) solution = "FizzBuzz";
else if (n % 3 == 0) solution = "Fizz";
else if (n % 5 == 0) solution = "Buzz";
else solution = to_string(n);
return solution == s;
}
int main()
{
int M, N;
while (cin >> M >> N, N || M)
{
bool isExist[1000] = {};
fill_n(isExist, M, true);
int cnt = M, p = 0;
for (int i = 1; i <= N; i++, p = (p + 1) % M)
{
while (!isExist[p]) p = (p + 1) % M;
string s;
cin >> s;
if (!isCorrect(i, s))
{
isExist[p] = false;
if (--cnt == 1) break;
}
}
vector<int> ans;
for (int i = 0; i < M; i++)
{
if (isExist[i]) ans.push_back(i);
}
if (ans.size() == 0) for (int i = 0; i < 1e10; i++) ;
printf("%d", ans[0] + 1);
for (int i = 1; i < ans.size(); i++)
{
printf(" %d", ans[i] + 1);
}
puts("");
}
return 0;
} | a.cc: In function 'bool isCorrect(int, std::string)':
a.cc:19:30: error: call of overloaded 'to_string(int&)' is ambiguous
19 | else solution = to_string(n);
| ~~~~~~~~~^~~
a.cc:5:8: note: candidate: 'std::string to_string(int)'
5 | string to_string(int N){
| ^~~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4240:3: note: candidate: 'std::string std::__cxx11::to_string(int)'
4240 | to_string(int __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4259:3: note: candidate: 'std::string std::__cxx11::to_string(unsigned int)'
4259 | to_string(unsigned __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4275:3: note: candidate: 'std::string std::__cxx11::to_string(long int)'
4275 | to_string(long __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4294:3: note: candidate: 'std::string std::__cxx11::to_string(long unsigned int)'
4294 | to_string(unsigned long __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4310:3: note: candidate: 'std::string std::__cxx11::to_string(long long int)'
4310 | to_string(long long __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4327:3: note: candidate: 'std::string std::__cxx11::to_string(long long unsigned int)'
4327 | to_string(unsigned long long __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4401:3: note: candidate: 'std::string std::__cxx11::to_string(float)'
4401 | to_string(float __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4411:3: note: candidate: 'std::string std::__cxx11::to_string(double)'
4411 | to_string(double __val)
| ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4421:3: note: candidate: 'std::string std::__cxx11::to_string(long double)'
4421 | to_string(long double __val)
| ^~~~~~~~~
|
s532703530 | p00221 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cstring>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i++)
#define loop(i,a,b) for(int i = a ; i < b ; i++)
void move(){
cout<<"move"<<endl;
}
int stoi(string s){
int r = 0;
rep(i,s.size())r = r * 10 + s[i] - '0';
return r;
}
int main(void){
int m,n;
while(cin>>m>>n,m+n){
vector<vector<int> > s(m,vector<int>(3));
s[0][0] = m-1; // prev
s[0][1] = 1; // alive
s[0][2] = 1; // nex
loop(i,1,m-1){
s[i][0] = i-1;
s[i][1] = 1;
s[i][2] = i+1;
}
s[m-1][0] = m-2; // prev
s[m-1][1] = 1; // alive
s[m-1][2] = 0; // nex
int now = 0;
//rep(i,m)rep(j,3)cout<<s[i][j]<<(j==2?'\n':' ');
rep(i,n){
string ss;
cin>>ss;
//cout<<i+1<<" "<<ss<<endl;
//rep(j,m)if(s[j][0]==1)cout<<j<<" ";cout<<endl;
if((i+1)%15 == 0 && ss != "FizzBuzz"){
//cout<<"FB "<<now<<endl;
s[now][1] = 0; // dead
int prev = s[now][0];
int nex = s[now][2];
s[prev][2] = nex; // prev-now-nex -> prev-nex
s[nex][0] = prev; // nex-now-prev -> nex-prev
n = new;
continue;
}else if((i+1)%3 == 0 && ss != "Fizz"){
s[now][1] = 0; // dead
//cout<<"F "<<now<<endl;
int prev = s[now][0];
int nex = s[now][2];
s[prev][2] = nex; // prev-now-nex -> prev-nex
s[nex][0] = prev; // nex-now-prev -> nex-prev
n = new;
continue;
}else if((i+1)%5 == 0 && ss != "Buzz"){
s[now][1] = 0; // dead
//cout<<"B "<<now<<endl;
int prev = s[now][0];
int nex = s[now][2];
s[prev][2] = nex; // prev-now-nex -> prev-nex
s[nex][0] = prev; // nex-now-prev -> nex-prev
n = new;
continue;
}else if((i+1)%3==0 || (i+1)%5==0){
now = s[now][2];
continue;
}else if(ss == "FizzBuzz" || ss == "Fizz" || ss == "Buzz"
|| i + 1 != stoi(ss)){// out
s[now][1] = 0; // dead
//cout<<"out "<<now<<endl;
int prev = s[now][0];
int nex = s[now][2];
s[prev][2] = nex; // prev-now-nex -> prev-nex
s[nex][0] = prev; // nex-now-prev -> nex-prev
n = new;
continue;
}
now = s[now][2];
}
//cout<<"ans"<<endl;
rep(i,m){
if(s[i][1]==1)cout<<i+1<<" ";
}
cout<<endl;
}
} | a.cc: In function 'int main()':
a.cc:47:16: error: expected type-specifier before ';' token
47 | n = new;
| ^
a.cc:56:16: error: expected type-specifier before ';' token
56 | n = new;
| ^
a.cc:65:16: error: expected type-specifier before ';' token
65 | n = new;
| ^
a.cc:71:32: error: call of overloaded 'stoi(std::string&)' is ambiguous
71 | || i + 1 != stoi(ss)){// out
| ~~~~^~~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
11 | int stoi(string s){
| ^~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10)
| ^~~~
a.cc:78:16: error: expected type-specifier before ';' token
78 | n = new;
| ^
|
s610529873 | p00221 | C++ | #include<iostream>
#include<queue>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int m, n, s, i;
while(cin >> m >> n, m != 0 || n != 0) {
queue<int> q;
for(int j = 0; j < m; j++) q.push(j+1);
i = 1;
while(n--) {
if(q.size() != 1) {
string no;
cin >> no;
int p = q.front(); q.pop();
if(p%3 == 0 && p% 5 == 0) {
if(no == "FizzBuzz") q.push(p);
}
else if(i % 3 == 0 && no == "Fizz") q.push(p);
else if(i % 5 == 0 && no == "Buzz") q.push(p);
else if(i % 3 != 0 && i % 5 != 0 && '0' <= no[0] && no[0] <= '9') q.push(p);
i++;
}
else cin >> no;
}
vector<int> v(1050);
while(q.size()) {
v.push_back(q.front());
q.pop();
}
sort(v.begin(), v.end());
while(v.size()) {
if(v[0]) {
cout << v[0];
if(v.size() - 1) cout << ' ';
}
v.erase(v.begin());
}
cout << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:19: error: 'no' was not declared in this scope; did you mean 'n'?
28 | else cin >> no;
| ^~
| n
|
s710664685 | p00221 | C++ | #include <iostream>
#include <sstream>
#include<string>
using namespace std;
string IntToString(int number)
{
stringstream ss;
ss << number;
return ss.str();
}
int main(){
int NumPlayer,NumRepeats;
while(cin >> NumPlayer >> NumRepeats && (NumPlayer|NumRepeats) ){
int alive = NumPlayer;
char *player;
player = new char[NumPlayer];
for(int i=0;i<NumPlayer;i++){
player[i] = '1';
}
int point=0;
for(int i=0;i<NumRepeats;i++){
string str;
cin >> str;
string correct;
if((i+1)%15==0){
correct = "FizzBuzz"
}else if((i+1)%3==0){
correct = "Fizz";
}else if((i+1)%15==0){
correct = "Buzz";
}else{
correct = IntToString(i+1);
}
if(str != correct){
player[point] = '0';
alive--;
}
if(alive==1){
for(int j=i;j<NumRepeats;j++){
cin >>str;
}
break;
}
if(point==NumPlayer-1){
point=0;
}else{
point++;
}
while(player[point]=='0'){
if(point==NumPlayer-1){
point=0;
}else{
point++;
}
}
}
int isfirst=0;
for(int i=0;i<NumPlayer;i++){
if(player[i]=='1'){
if(isfirst!=0){
cout << ' ' << (i+1);
}else{
cout << (i+1);
isfirst = 1;
}
}
}
cout << endl;
delete player;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:27:37: error: expected ';' before '}' token
27 | correct = "FizzBuzz"
| ^
| ;
28 | }else if((i+1)%3==0){
| ~
|
s668167033 | p00221 | C++ | #include<iostream>
#include<string>
using namespace std;
bool l[1000];
int main(){
??int n,m;
??string s;
??while(true){
??cin>>m>>n;
??if(n+m==0)
??break;
??for(int i=0;i<m;i++)
??l[i]=true;
??int h=0;
??int ans=m,keep=0;
??for(int i=1;i<=n;i++){
??????????cin>>s;
??????????while(true){
????????????if(l[h]==true){
??????????????????if(i%15==0&&s!="FizzBuzz"){
??????????????????l[h]=false;
??????????????????ans--;
??????????????????}
??????????????????if((i%15!=0&&i%5==0&&s!="Buzz")||(i%15!=0&&i%3==0&&s!="Fizz")){
??????????????????l[h]=false;
??????????????????ans--;
??????????????????}
if(i%3!=0&&i%5!=0){
int a=1,b=0;
for(int j=0;j<s.size();j++){
b+=a*s[s.size()-1-j];
a*=10;
}
if(b!=i){
l[h]=false;
ans--;
}
}
??????????????????break;
????????????}
????????????h++;
????????????h%=m;
??????????}
??????????if(ans==1){
??????????????????keep=n-i;
??????????????????break;
??????????}
??????????h++;
??????????h%=m;
??}
??for(int i=0;i<keep;i++)
??cin>>s;
??bool first=true;
??for(int i=0;i<m;i++){
????if(l[i]==true){
????????????if(first==false)
????????????cout<<" ";
????????????cout<<i+1;
????????????first=false;
????}
??}
??cout<<endl;
??}
??return 0;????
} | a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
6 | ??int n,m;
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ??int n,m;
| ^
a.cc:6:3: error: expected primary-expression before 'int'
6 | ??int n,m;
| ^~~
a.cc:6:3: error: expected ':' before 'int'
6 | ??int n,m;
| ^~~
| :
a.cc:6:3: error: expected primary-expression before 'int'
6 | ??int n,m;
| ^~~
a.cc:6:3: error: expected ':' before 'int'
6 | ??int n,m;
| ^~~
| :
a.cc:6:3: error: expected primary-expression before 'int'
6 | ??int n,m;
| ^~~
a.cc:7:1: error: expected primary-expression before '?' token
7 | ??string s;
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ??string s;
| ^
a.cc:7:10: error: expected primary-expression before 's'
7 | ??string s;
| ^
a.cc:7:9: error: expected ':' before 's'
7 | ??string s;
| ^~
| :
a.cc:7:10: error: 's' was not declared in this scope
7 | ??string s;
| ^
a.cc:7:11: error: expected ':' before ';' token
7 | ??string s;
| ^
| :
a.cc:7:11: error: expected primary-expression before ';' token
a.cc:8:1: error: expected primary-expression before '?' token
8 | ??while(true){
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ??while(true){
| ^
a.cc:8:3: error: expected primary-expression before 'while'
8 | ??while(true){
| ^~~~~
a.cc:8:3: error: expected ':' before 'while'
8 | ??while(true){
| ^~~~~
| :
a.cc:8:3: error: expected primary-expression before 'while'
8 | ??while(true){
| ^~~~~
a.cc:8:3: error: expected ':' before 'while'
8 | ??while(true){
| ^~~~~
| :
a.cc:8:3: error: expected primary-expression before 'while'
8 | ??while(true){
| ^~~~~
a.cc:64:1: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:64:2: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:64:3: error: expected primary-expression before 'return'
64 | ??return 0;????
| ^~~~~~
a.cc:64:3: error: expected ':' before 'return'
64 | ??return 0;????
| ^~~~~~
| :
a.cc:64:3: error: expected primary-expression before 'return'
64 | ??return 0;????
| ^~~~~~
a.cc:64:3: error: expected ':' before 'return'
64 | ??return 0;????
| ^~~~~~
| :
a.cc:64:3: error: expected primary-expression before 'return'
64 | ??return 0;????
| ^~~~~~
a.cc:64:12: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:64:13: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:64:14: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:64:15: error: expected primary-expression before '?' token
64 | ??return 0;????
| ^
a.cc:65:1: error: expected primary-expression before '}' token
65 | }
| ^
a.cc:64:16: error: expected ':' before '}' token
64 | ??return 0;????
| ^
| :
65 | }
| ~
a.cc:65:1: error: expected primary-expression before '}' token
65 | }
| ^
a.cc:64:16: error: expected ':' before '}' token
64 | ??return 0;????
| ^
| :
65 | }
| ~
a.cc:65:1: error: expected primary-expression before '}' token
65 | }
| ^
a.cc:64:16: error: expected ':' before '}' token
64 | ??return 0;????
| ^
| :
65 | }
| ~
a.cc:65:1: error: expected primary-expression before '}' token
65 | }
| ^
a.cc:64:16: error: expected ':' before '}' token
64 | ??return 0;????
| ^
| :
65 | }
| ~
a.cc:65:1: error: expected primary-expression before '}' token
65 | }
| ^
|
s019004161 | p00221 | C++ | #include<iostream> #include<string> using namespace std; bool l[1000]; int main(){ int n,m; string s; while(true){ cin>>m>>n; if(n+m==0) break; for(int i=0;i<m;i++) l[i]=true; int h=0; int ans=m,keep=0; for(int i=1;i<=n;i++){ cin>>s; while(true){ if(l[h]==true){if(i%15==0&&s!="FizzBuzz"){ l[h]=false; ans--; } if((i%15!=0&&i%5==0&&s!="Buzz")||(i%15!=0&&i%3==0&&s!="Fizz")){ l[h]=false; ans--; } if(i%3!=0&&i%5!=0){ int a=1,b=0; for(int j=0;j<s.size();j++){ b+=a*s[s.size()-1-j]; a*=10; } if(b!=i){ l[h]=false; ans--; } } break; } h++; h%=m; } if(ans==1){ keep=n-i; break; } h++; h%=m; } for(int i=0;i<keep;i++) cin>>s; bool first=true; for(int i=0;i<m;i++){ if(l[i]==true){ if(first==false) cout<<" "; cout<<i+1; first=false; } } cout<<endl; } return 0;} | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include<iostream> #include<string> using namespace std; bool l[1000]; int main(){ int n,m; string s; while(true){ cin>>m>>n; if(n+m==0) break; for(int i=0;i<m;i++) l[i]=true; int h=0; int ans=m,keep=0; for(int i=1;i<=n;i++){ cin>>s; while(true){ if(l[h]==true){if(i%15==0&&s!="FizzBuzz"){ l[h]=false; ans--; } if((i%15!=0&&i%5==0&&s!="Buzz")||(i%15!=0&&i%3==0&&s!="Fizz")){ l[h]=false; ans--; } if(i%3!=0&&i%5!=0){ int a=1,b=0; for(int j=0;j<s.size();j++){ b+=a*s[s.size()-1-j]; a*=10; } if(b!=i){ l[h]=false; ans--; } } break; } h++; h%=m; } if(ans==1){ keep=n-i; break; } h++; h%=m; } for(int i=0;i<keep;i++) cin>>s; bool first=true; for(int i=0;i<m;i++){ if(l[i]==true){ if(first==false) cout<<" "; cout<<i+1; first=false; } } cout<<endl; } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s098452045 | p00221 | C++ | #include<string>
using namespace std;
int main(){
int flag[1002] = { 0 };
int n, m;
int count=1;// ????¨????
char s[10];
cin >> m >> n;//????????°??¨?????°
while (n != 0 || m != 0){ // ?¶??¶??????¶
for (int i = 1; i<=n; i++){//????¨??????°??°?????????
while (flag[count] != 0){//????¨???????????????????
count++;
if (count > m) count = 1;
}cin >> s;
if (i % 3 == 0 && i % 5 == 0){
if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
}
else if (i % 3 == 0){
if (strcmp(s, "Fizz") != 0) flag[count] = 1;
}
else if (i % 5 == 0){
if (strcmp(s, "Buzz") != 0) flag[count] = 1;
}
count++;
if (count > m) count = 1;
}
//?????????????????????
for (int i = 1; i <= m; i++){
if (flag[i] == 0) cout << i;
}count = 0; cout << endl;
for (int i = 0; i < 1002; i++)flag[i] = 0;
cin >> m >> n;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | cin >> m >> n;//????????°??¨?????°
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:16:37: error: 'strcmp' was not declared in this scope
16 | if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<string>
+++ |+#include <cstring>
2 | using namespace std;
a.cc:19:37: error: 'strcmp' was not declared in this scope
19 | if (strcmp(s, "Fizz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:19:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:22:37: error: 'strcmp' was not declared in this scope
22 | if (strcmp(s, "Buzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:22:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:29:43: error: 'cout' was not declared in this scope
29 | if (flag[i] == 0) cout << i;
| ^~~~
a.cc:29:43: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:29: error: 'cout' was not declared in this scope
30 | }count = 0; cout << endl;
| ^~~~
a.cc:30:29: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:37: error: 'endl' was not declared in this scope
30 | }count = 0; cout << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<string>
+++ |+#include <ostream>
2 | using namespace std;
|
s138768908 | p00221 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int flag[1002] = { 0 };
int n, m, a[1002] = { 0 };
int count=1;// ????¨????
char s[10];
cin >> m >> n;//????????°??¨?????°
while (n != 0 || m != 0){ // ?¶??¶??????¶
for (int i = 1; i<=n; i++){//????¨??????°??°?????????
while (flag[count] != 0){//????¨???????????????????
count++;
if (count > m) count = 1;
}cin >> s;
if (i % 3 == 0 && i % 5 == 0){
if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
}
else if (i % 3 == 0){
if (strcmp(s, "Fizz") != 0) flag[count] = 1;
}
else if (i % 5 == 0){
if (strcmp(s, "Buzz") != 0) flag[count] = 1;
}
count++;
if (count > m) count = 1;
}count = 0;
//?????????????????????
for (int i = 1; i <= m; i++){
if (flag[i] == 0){
a[count] = i;
count++;
}
}
for (int i = 0; i < count-1; i++) cout << a[i] << " ";
cout << a[count-1] << endl;
count = 1;
for (int i = 0; i < 1002; i++)a[i] = 0;
for (int i = 0; i < 1002; i++)flag[i] = 0;
cin >> m >> n;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:37: error: 'strcmp' was not declared in this scope
17 | if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | #include<string>
a.cc:20:37: error: 'strcmp' was not declared in this scope
20 | if (strcmp(s, "Fizz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:20:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:23:37: error: 'strcmp' was not declared in this scope
23 | if (strcmp(s, "Buzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:23:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s787565732 | p00221 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int flag[1002] = { 0 };
int n, m, a[1002] = { 0 };
int count=1;// ????¨????
char s[10];
cin >> m >> n;//????????°??¨?????°
while (n != 0 && m != 0){ // ?¶??¶??????¶
for (int i = 1; i<=n; i++){//????¨??????°??°?????????
while (flag[count] != 0){//????¨???????????????????
count++;
if (count > m) count = 1;
}cin >> s;
if (i % 3 == 0 && i % 5 == 0){
if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
}
else if (i % 3 == 0){
if (strcmp(s, "Fizz") != 0) flag[count] = 1;
}
else if (i % 5 == 0){
if (strcmp(s, "Buzz") != 0) flag[count] = 1;
}
count++;
if (count > m) count = 1;
}count = 0;
//?????????????????????
for (int i = 1; i <= m; i++){
if (flag[i] == 0){
a[count] = i;
count++;
}
}
for (int i = 0; i < count-1; i++) cout << a[i] << " ";
cout << a[count-1] << endl;
count = 1;
for (int i = 0; i < 1002; i++)a[i] = 0;
for (int i = 0; i < 1002; i++)flag[i] = 0;
cin >> m >> n;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:37: error: 'strcmp' was not declared in this scope
17 | if (strcmp(s, "FizzBuzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | #include<string>
a.cc:20:37: error: 'strcmp' was not declared in this scope
20 | if (strcmp(s, "Fizz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:20:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:23:37: error: 'strcmp' was not declared in this scope
23 | if (strcmp(s, "Buzz") != 0) flag[count] = 1;
| ^~~~~~
a.cc:23:37: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s974130046 | p00221 | C++ | #include<iostream>
using namespace std;
#include<queue>
#include<vector>
#include<string>
#include<string.h>
#include<algorithm>
#include <conio.h>
bool b[2003];
#define REP(a) for(int i=0;i<a;i++)
int main()
{
bool f=0;
int x,m,n,j;
int prev[2001],next[2001],p,v=1;
string c,d;
cin>>m>>n;
while(m!=0||n!=0){
x=m;
REP(m){
next[i]=(i+1)%m;
prev[i]=(i+m-1)%m;
}
p=0;
REP(n){
cin>>c;
if(f==0){
if(c!="Fizz"&&(i+1)%3==0&&(i+1)%5!=0){
v=0;
m--;
}
else if(c!="Buzz"&&(i+1)%3!=0&&(i+1)%5==0){
v=0;
m--;
}
else if(c!="FizzBuzz"&&(i+1)%3==0&&(i+1)%5==0){
v=0;
m--;
}
else if(atoi(c.c_str())!=i+1&&(i+1)%3!=0&&(i+1)%5!=0){
v=0;
m--;
// cout<<'A';
}
}
if(v==0) {
prev[next[p]]=prev[p];
next[prev[p]]=next[p];
prev[p]=-1;
v=1;
}
p=next[p];
if(m==1) f=1;
}
REP(x){
if(prev[i]!=-1){
cout<<i+1;
p=i;
break;
}
}
for(v=p+1;v<x;v++){
if(prev[v]!=-1) cout<<" "<<v+1;
}
cout<<endl;
cin>>m>>n;
f=0;
j=1;
}
return 0;
} | a.cc:8:10: fatal error: conio.h: No such file or directory
8 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s949942380 | p00221 | C++ | #include<iostream>
using namespace std;
#include<queue>
#include<vector>
#include<string>
#include<string.h>
#include<algorithm>
#include <conio.h>
bool b[2003];
#define REP(a) for(int i=0;i<a;i++)
int main()
{
bool f=0;
int x,m,n,j;
int prev[2001],next[2001],p,v=1;
string c,d;
cin>>m>>n;
while(m!=0||n!=0){
x=m;
REP(m){
next[i]=(i+1)%m;
prev[i]=(i+m-1)%m;
}
p=0;
REP(n){
cin>>c;
if(f==0){
if(c!="Fizz"&&(i+1)%3==0&&(i+1)%5!=0){
v=0;
m--;
}
else if(c!="Buzz"&&(i+1)%3!=0&&(i+1)%5==0){
v=0;
m--;
}
else if(c!="FizzBuzz"&&(i+1)%3==0&&(i+1)%5==0){
v=0;
m--;
}
else if(atoi(c.c_str())!=i+1&&(i+1)%3!=0&&(i+1)%5!=0){
v=0;
m--;
// cout<<'A';
}
}
if(v==0) {
prev[next[p]]=prev[p];
next[prev[p]]=next[p];
prev[p]=-1;
v=1;
}
p=next[p];
if(m==1) f=1;
}
REP(x){
if(prev[i]!=-1){
cout<<i+1;
p=i;
break;
}
}
for(v=p+1;v<x;v++){
if(prev[v]!=-1) cout<<" "<<v+1;
}
cout<<endl;
cin>>m>>n;
f=0;
j=1;
}
return 0;
} | a.cc:8:10: fatal error: conio.h: No such file or directory
8 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s922928353 | p00221 | C++ | #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
//#define int long long
#define DBG 0
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
signed main() {
int m, n;
while (cin >> m >> n, m || n) {
vector<bool>v(m, true);// v[0] = false;
int cnt(1), index(0);
string s;
while (n--) {
cin >> s;
while (v[index%m] == false)index++;
if (cnt % 15 == 0 && s != "FizzBuzz")v[index%m] = false;
else if (cnt % 5 == 0 && s != "Buzz")v[index%m] = false;
else if (cnt % 3 == 0 && s != "Fizz")v[index%m] = false;
//else if (cnt != 15 && cnt != 5 && cnt != 3 && s != to_string(cnt))v[index%m] = false;
cnt++; index++;
if (accumulate(all(v), 0) == 1)break;
dumpc(v);
}
rep(i, 0, m) {
if (v[i]) {
cout << i + 1 << " ";
}
}
cout << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:50: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference'
8 | #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
| ^
a.cc:33:25: note: in expansion of macro 'dumpc'
33 | dumpc(v);
| ^~~~~
|
s051593052 | p00221 | C++ | #include"bits/stdc++.h"
#define N 10000
using namespace std;
int main() {
int a[N] , b[N], m, n, j = 1,hideo=1;
char str[10];
char str1[10] = { "Fizz" }, str2[10] = { "Buzz" }, str3[10] = { "FizzBuzz" };
memset(a, 1, sizeof(a));
while (1) {
cin >> m >> n;
if (m == 0 && n == 0)return 0;
for (int i = 0; i <= m; i++)a[i] = 1;
for (int i = 1; i <= n; i++) {
if (hideo == m - 2)goto ruio;
if (j > m)j = 1;
//cout << a[j] << endl;
if (a[j] == 1) {
memset(str, NULL, sizeof(str));
cin >> str;
if (strcmp(str, str1) == 0) {
if (i % 3 == 0 && i % 5 != 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else if (strcmp(str, str2) == 0) {
if (i % 3 != 0 && i % 5 == 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else if (strcmp(str, str3) == 0) {
if (i % 3 == 0 && i % 5 == 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else {
char *s = str;
int len;
len = atoi(str);
if (len % 3 == 0 || len % 5 == 0)a[j] = -1;
}
hell:;
j++;
}
}
ruio:;
int sum = 0;
j = 1;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
b[j] = i;
j++;
}#include"bits/stdc++.h"
#define N 10000
using namespace std;
int main() {
int a[N] , b[N], m, n, j = 1,hideo=1;
char str[10];
char str1[10] = { "Fizz" }, str2[10] = { "Buzz" }, str3[10] = { "FizzBuzz" };
memset(a, 1, sizeof(a));
while (1) {
cin >> m >> n;
if (m == 0 && n == 0)return 0;
for (int i = 1; i <= m; i++)a[i] = 1;
for (int i = 1; i <= n; i++) {
if (hideo == m - 1)goto ruio;
if (j > m)j = 1;
//cout << a[j] << endl;
if (a[j] == 1) {
memset(str, NULL, sizeof(str));
cin >> str;
if (strcmp(str, str1) == 0) {
if (i % 3 == 0 && i % 5 != 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else if (strcmp(str, str2) == 0) {
if (i % 3 != 0 && i % 5 == 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else if (strcmp(str, str3) == 0) {
if (i % 3 == 0 && i % 5 == 0)goto hell;
else {
a[j] = -1; hideo++;
}
}
else {
char *s = str;
int len;
len = atoi(str);
if (len % 3 == 0 || len % 5 == 0)a[j] = -1;
}
hell:;
j++;
}
}
ruio:;
int sum = 0;
j = 1;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
b[j] = i;
j++;
}
}
for (int i = 1; i < j; i++) {
cout << b[i];
if (i < j-1)cout << " ";
}
cout << endl;
}
}
}
for (int i = 1; i < j; i++) {
cout << b[i];
if (i < j-1)cout << " ";
}
cout << endl;
}
}
| a.cc:56:26: error: stray '#' in program
56 | }#include"bits/stdc++.h"
| ^
a.cc: In function 'int main()':
a.cc:18:45: warning: passing NULL to non-pointer argument 2 of 'void* memset(void*, int, size_t)' [-Wconversion-null]
18 | memset(str, NULL, sizeof(str));
| ^~~~
In file included from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/usr/include/string.h:61:37: note: declared here
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ~~~~^~~
a.cc:56:27: error: 'include' was not declared in this scope
56 | }#include"bits/stdc++.h"
| ^~~~~~~
a.cc:59:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
59 | int main() {
| ^~
a.cc:59:9: note: remove parentheses to default-initialize a variable
59 | int main() {
| ^~
| --
a.cc:59:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:59:12: error: a function-definition is not allowed here before '{' token
59 | int main() {
| ^
|
s263741308 | p00221 | C++ | #include"bits/stdc++.h"
using namespace std;
int main() {
int a[1001], b[1001], m, n, j = 1, j2, hideo = 0;
char str[30], str1[10] = { "Fizz" }, str2[10] = { "Buzz" }, str3[10] = { "FizzBuzz" };
while (1) {
cin >> m >> n;
if (m == 0 && n == 0)return 0;
for (int i = 1; i <= m; i++)a[i] = 1;
for (int i = 1; i <= n; i++) {
if (hideo ==1)goto ruio;
if (j > m)j = 1;
if (a[j] != 1) {
j2 = j;
for (int x = j; x <= m; x++) {
if (a[x] == 1)j = x;
}
if (j == j2) {
for (int x = 1; x < j; x++) {
if (a[x] == 1)j = x;
}
}
if (j == j2)goto ruio;
}
memset(str, NULL, sizeof(str));
cin >> str;
if (strcmp(str, str3) == 0) {
if (i %15==0)goto hell;
else {
a[j] = -1; hideo--;
}
}
else if (strcmp(str, str1) == 0) {
if (i % 3 == 0 )goto hell;
else {
a[j] = -1; hideo--;
}
}
else if (strcmp(str, str2) == 0) {
if (i % 5 == 0)goto hell;
else {
a[j] = -1; hideo--;
}
}
else {
char *s = str;
int len;
len = atoi(str);
if(len>0&&len<10001)if (len % 3 == 0 || len % 5 == 0){
a[j] = -1;
hideo--;
}
hell:;
j++;
}
goto souya;
ruio:;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
cout << i << endl;
}
}
souya:;
j = 0;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
b[j] = i;
j++;
}
}
for (int i = 0; i < j; i++) {
cout << b[i];
if (i < j-1)cout << " ";
}
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:25:37: warning: passing NULL to non-pointer argument 2 of 'void* memset(void*, int, size_t)' [-Wconversion-null]
25 | memset(str, NULL, sizeof(str));
| ^~~~
In file included from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/usr/include/string.h:61:37: note: declared here
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ~~~~^~~
a.cc:53:17: error: jump to label 'hell'
53 | hell:;
| ^~~~
a.cc:28:51: note: from here
28 | if (i %15==0)goto hell;
| ^~~~
a.cc:46:39: note: crosses initialization of 'char* s'
46 | char *s = str;
| ^
a.cc:78:2: error: expected '}' at end of input
78 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s975500566 | p00221 | C++ | #include"bits/stdc++.h"
using namespace std;
int main() {
int a[1001], b[1001], m, n, j = 1, j2, hideo = 0;
char str[30], str1[10] = { "Fizz" }, str2[10] = { "Buzz" }, str3[10] = { "FizzBuzz" };
while (1) {
cin >> m >> n;
if (m == 0 && n == 0)return 0;
for (int i = 1; i <= m; i++)a[i] = 1;
for (int i = 1; i <= n; i++) {
if (hideo ==1)goto ruio;
if (j > m)j = 1;
if (a[j] != 1) {
j2 = j;
for (int x = j; x <= m; x++) {
if (a[x] == 1)j = x;
}
if (j == j2) {
for (int x = 1; x < j; x++) {
if (a[x] == 1)j = x;
}
}
memset(str, NULL, sizeof(str));
cin >> str;
if (strcmp(str, str3) == 0) {
if (i %15==0)goto hell;
else {
a[j] = -1; hideo--;
}
}
else if (strcmp(str, str1) == 0) {
if (i % 3 == 0 )goto hell;
else {
a[j] = -1; hideo--;
}
}
else if (strcmp(str, str2) == 0) {
if (i % 5 == 0)goto hell;
else {
a[j] = -1; hideo--;
}
}
else {
char *s = str;
int len;
len = atoi(str);
if (len > 0 && len < 10001)if (len % 3 == 0 || len % 5 == 0) {
a[j] = -1;
hideo--;
}
}
hell:;
j++;
}
goto souya;
ruio:;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
cout << i << endl;
break;
}
}
souya:;
j = 0;
for (int i = 1; i <= m; i++) {
if (a[i] == 1) {
b[j] = i;
j++;
}
}
for (int i = 0; i < j; i++) {
cout << b[i];
if (i < j-1)cout << " ";
}
cout << endl;
}
}
/*#include"bits/stdc++.h"
using namespace std;
int main() {
int a[1001], n, m, s, j = 1,sum;
char str[20];
char str1[] = { "FizzBuzz" }, str2[] = { "Fizz" }, str3[] = { "Buzz" };
cin >> m >> n;
sum = m;
for (int i = 0; i <= 1000; i++)a[i] = 1;
for (int i = 1; i <= m;) {
if (sum == 1)break;
if (j > m)j = 1;
if (a[j] == 1) {
i++;
cin >> str;
if (strcmp(str, str1) == 0) {
if (i % 15 != 0) {
a[j] = -1;
sum--;
}
}
else if (strcmp(str, str2) == 0) {
if (i % 3 != 0) {
a[j] = -1;
sum--;
}
}
else if (strcmp(str, str3) == 0) {
if (i % 5 != 0) {
a[j] = -1;
sum--;
}
}
else {
char *strx = str;
int suu = atoi(strx);
if (suu >= 1 && suu <= 1000) {
if (suu % 3 == 0 || suu % 5 == 0) {
a[j] = -1;
sum--;
}
}
}
j++;
}
else {
j++;
}
}
for (int i = 1; i <= m; i++) {
if (a[i] == 1)cout << i << " ";
}
}*/ | a.cc: In function 'int main()':
a.cc:23:37: warning: passing NULL to non-pointer argument 2 of 'void* memset(void*, int, size_t)' [-Wconversion-null]
23 | memset(str, NULL, sizeof(str));
| ^~~~
In file included from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/usr/include/string.h:61:37: note: declared here
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ~~~~^~~
a.cc:78:2: error: expected '}' at end of input
78 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s708534848 | p00221 | C++ | #include<cstdio>
#include<iostream>
#include<string>
using namespace std;
int main(void){
int m,n,flg[1001],i,cnt,h,list[1000],ff,j;
char s[9],f[]="Fizz",b[]="Buzz",fb[]="FizzBuzz";
while(1){
cin>>m>>n;
if(m==0) break;
for(i=1;i<=m;i++) flg[i]=1;
cnt=0;
for(i=1;i<=n;i++){
cin>>s;
if(i%3==0&&i%5==0){
ff=1;
for(j=0;j<8;j++){
if(s[j]!=fb[j]){
ff=0;
break;
}
}
if(ff==0){
h=(i+cnt)%m;
if(h==0) h=m;
if(flg[h]==0)cnt++;
flg[h]=0;
// cout<<"35haitta"<<endl;
}
}
else if(i%3==0){
ff=1;
for(j=0;j<4;j++){
if(s[j]!=f[j]){
ff=0;
break;
}
}
if(ff==0){
h=(i+cnt)%m;
if(h==0) h=m;
if(flg[h]==0) cnt++;
flg[h]=0;
// cout<<"3haitta"<<endl;
}
}
else if(i%5==0){
ff=1;
for(j=0;j<4;j++){
if(s[j]!=b[j]){
ff=0;
break;
}
}
if(ff==0){
h=(i+cnt)%m;
// cout<<cnt<<endl;
if(h==0) h=m;
if(flg[h]==0) cnt++;
flg[h]=0;
// cout<<"5haitta"<<endl;
}
}
}
cnt=0;
for(i=1;i<=m;i++){
if(flg[i]==1){
list[cnt]=i;
cnt++;
}
}
// cout<<cnt<<endl;
cout<<list[0];
for(i=1;i<cnt;i++) cout<<' '<<list[i];
cout<<endl;
}
r | a.cc: In function 'int main()':
a.cc:77:9: error: 'r' was not declared in this scope
77 | r
| ^
a.cc:77:10: error: expected '}' at end of input
77 | r
| ^
a.cc:5:15: note: to match this '{'
5 | int main(void){
| ^
|
s983736985 | p00221 | C++ | #include<cstdio>
#include<iostream>
#include<string>
using namespace std;
int main(void){
int m,n,flg[1001],i,cnt,h,list[1000],ff,j;
char s[9],f[]="Fizz",b[]="Buzz",fb[]="FizzBuzz";
while(1){
cin>>m>>n;
if(m==0) break;
for(i=1;i<=m;i++) flg[i]=1;
cnt=0;
for(i=1;i<=n;i++){
cin>>s;
if(i%3==0&&i%5==0){
ff=1;
for(j=0;j<8;j++){
if(s[j]!=fb[j]){
ff=0;
break;
}
}
if(ff==0){
h=i%m;
if(h==0) h=m;
if(flg[h]==0){
cnt++;
h=(i+cnt)%m;
if(h==0) h=m;
}
flg[h]=0;
// cout<<"35haitta"<<endl;
}
}
else if(i%3==0){
ff=1;
for(j=0;j<4;j++){
if(s[j]!=f[j]){
ff=0;
break;
}
}
if(ff==0){
h=i+%m;
if(h==0) h=m;
if(flg[h]==0){
cnt++;
h=(i+cnt)%m;
if(h==0) h=m;
}
flg[h]=0;
// cout<<"3haitta"<<endl;
}
}
else if(i%5==0){
ff=1;
for(j=0;j<4;j++){
if(s[j]!=b[j]){
ff=0;
break;
}
}
if(ff==0){
h=i%m;
// cout<<cnt<<endl;
if(h==0) h=m;
if(flg[h]==0){
cnt++;
h=(i+cnt)%m;
if(h==0) h=m;
}
flg[h]=0;
// cout<<"5haitta"<<endl;
}
}
}
cnt=0;
for(i=1;i<=m;i++){
if(flg[i]==1){
list[cnt]=i;
cnt++;
}
}
// cout<<cnt<<endl;
for(i=0;i<cnt-1;i++) cout<<list[i]<<' ';
if(cnt!=0)cout<<list[cnt-1]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:44:45: error: expected primary-expression before '%' token
44 | h=i+%m;
| ^
|
s607306826 | p00221 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
int n, m;
while(cin >> n >> m, n||m){
int k = 0, a = n;
queue<int> players;
for(int i = 0; i < n; ++i) players.push(i+1);
for(int i = 1; i <= m; ++i){
string s, t;
cin >> s;
if(i%3 == 0) t += "Fizz";
if(i%5 == 0) t += "Buzz";
if(i%3 && i%5) t = to_string(i);
if(s == t){
int p = players.front();
players.pop();
players.push(p);
}else{
if(players.size() > 1){
players.pop();
}
}
}
vector<int> ans;
while(!players.empty()){
ans.push_back(players.front());
players.pop();
}
sort(ans.begin(), ans.end());
cout << ans[0];
for(int i = 1; i < ans.size(); ++i) cout << " " << ans[i];
cout << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'short'?
32 | sort(ans.begin(), ans.end());
| ^~~~
| short
|
s814440973 | p00221 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int m, n;
while (cin >> m >> n, m) {
bool live[1010];
int idx = 1, cnt = m;
memset(live, true, sizeof live);
for (int i = 1; i <= n; ++i) {
string s;
cin >> s;
if (cnt != 1) {
string str = to_string(i);
if (i % 15 == 0)
str = "FizzBuzz";
else if (i % 3 == 0)
srt = "Fizz";
else if (i % 5 == 0)
srt = "Buzz";
if (str != s) {
live[idx] = false;
cnt--;
}
idx++;
if (idx == m + 1) idx = 1;
while (!live[idx]) {
idx++;
if (idx == m + 1) idx = 1;
}
}
}
vector<int> ans;
for (int i = 1; i <= m; ++i) {
if (live[i]) ans.push_back(i);
}
for (int i = 0; i < ans.size(); ++i) {
cout << ans[i] << (i + 1 == ans.size() ? "\n" : " ");
}
}
}
| a.cc: In function 'int main()':
a.cc:20:11: error: 'srt' was not declared in this scope; did you mean 'str'?
20 | srt = "Fizz";
| ^~~
| str
a.cc:22:11: error: 'srt' was not declared in this scope; did you mean 'str'?
22 | srt = "Buzz";
| ^~~
| str
|
s486945707 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int m,n;
while(1){
cin>>m>>n;
if(m==0 && n==0)break;
int a[10000];
string b[10000];
int c[10000];
int k[10000];
for(int i=0;i<n;i++){
cin>>b[i];
if((i+1)%15==0 ){
if(b[i]=="FizzBuzz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%3==0){
if(b[i]=="Fizz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%5==0){
if(b[i]=="Buzz"){a[i]=1;}else{a[i]=0;}
}else if(b[i]!="FizzBuzz"&&b[i]!="Buzz"&&b[i]!="Fizz"){
c[i]=atoi(b[i].c_str());
int d=i+1;
if(c[i]==d){a[i]=1;}else{a[i]=0;}
}else{a[i]=0;}
}
for(int i=0;i<=m;i++){k[i]=1;}
int e=0;
int count=0;
int t=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(k[j]==0){count++;}
}
if(count==m-1){
cout<<endl
for(int j=0;j<m;j++){
if(k[j]==1){cout<<j+1;}
}
cout<<endl
i=n;
t=1;
}
if(k[e]==0){
e++;
i--;
}else if(a[i]==0){
k[e]=0;
e++;
}else if(a[i]==1){
k[e]=1;
e++;
}
if(e>m-1){e=0;}
else{count=0;}
}
if(t!=1){
cout<<endl;
for(int i=0;i<m;i++){
if(k[i]==1){cout<<<i+1<<" ";}
}
cout<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:44:19: error: expected ';' before 'for'
44 | cout<<endl
| ^
| ;
45 | for(int j=0;j<m;j++){
| ~~~
a.cc:45:21: error: 'j' was not declared in this scope
45 | for(int j=0;j<m;j++){
| ^
a.cc:48:19: error: expected ';' before 'i'
48 | cout<<endl
| ^
| ;
49 | i=n;
| ~
a.cc:70:27: error: expected primary-expression before '<' token
70 | if(k[i]==1){cout<<<i+1<<" ";}
| ^
a.cc:70:31: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
70 | if(k[i]==1){cout<<<i+1<<" ";}
| ~~~^~~~~
| | |
| int const char [2]
|
s012990031 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int m,n;
while(1){
cin>>m>>n;
if(m==0 && n==0)break;
int a[10000];
string b[10000];
int c[10000];
int k[10000];
for(int i=0;i<n;i++){
cin>>b[i];
if((i+1)%15==0 ){
if(b[i]=="FizzBuzz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%3==0){
if(b[i]=="Fizz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%5==0){
if(b[i]=="Buzz"){a[i]=1;}else{a[i]=0;}
}else if(b[i]!="FizzBuzz"&&b[i]!="Buzz"&&b[i]!="Fizz"){
c[i]=atoi(b[i].c_str());
int d=i+1;
if(c[i]==d){a[i]=1;}else{a[i]=0;}
}else{a[i]=0;}
}
for(int i=0;i<=m;i++){k[i]=1;}
int e=0;
int count=0;
int t=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(k[j]==0){count++;}
}
if(count==m-1){
for(int j=0;j<m;j++){
if(k[j]==1){cout<<j+1;}
}
cout<<endl;
i=n;
t=1;
}
if(k[e]==0){
e++;
i--;
}else if(a[i]==0){
k[e]=0;
e++;
}else if(a[i]==1){
k[e]=1;
e++;
}
if(e>m-1){e=0;}
else{count=0;}
}
if(t!=1){
cout<<endl
for(int i=0;i<m;i++){
if(k[i]==1){cout<<<i+1<<" ";}
}
cout<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:67:17: error: expected ';' before 'for'
67 | cout<<endl
| ^
| ;
68 | for(int i=0;i<m;i++){
| ~~~
a.cc:68:19: error: 'i' was not declared in this scope
68 | for(int i=0;i<m;i++){
| ^
|
s300378763 | p00221 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int m,n;
while(1){
cin>>m>>n;
if(m==0 && n==0)break;
int a[10000];
string b[10000];
int c[10000];
int k[10000];
for(int i=0;i<n;i++){
cin>>b[i];
if((i+1)%15==0 ){
if(b[i]=="FizzBuzz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%3==0){
if(b[i]=="Fizz"){a[i]=1;}else{a[i]=0;}
}else if((i+1)%5==0){
if(b[i]=="Buzz"){a[i]=1;}else{a[i]=0;}
}else if(b[i]!="FizzBuzz"&&b[i]!="Buzz"&&b[i]!="Fizz"){
c[i]=atoi(b[i].c_str());
int d=i+1;
if(c[i]==d){a[i]=1;}else{a[i]=0;}
}else{a[i]=0;}
}
for(int i=0;i<=m;i++){k[i]=1;}
int e=0;
int count=0;
int t=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(k[j]==0){count++;}
}
if(count==m-1){
for(int j=0;j<m;j++){
if(k[j]==1){cout<<j+1;}
}
cout<<endl;
i=n;
t=1;
}
if(k[e]==0){
e++;
i--;
}else if(a[i]==0){
k[e]=0;
e++;
}else if(a[i]==1){
k[e]=1;
e++;
}
if(e>m-1){e=0;}
else{count=0;}
}
if(t!=1){
for(int i=0;i<m;i++){
if(k[i]==1){cout<<<i+1<<" ";}
}
cout<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:68:27: error: expected primary-expression before '<' token
68 | if(k[i]==1){cout<<<i+1<<" ";}
| ^
a.cc:68:31: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
68 | if(k[i]==1){cout<<<i+1<<" ";}
| ~~~^~~~~
| | |
| int const char [2]
|
s398411045 | p00221 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
#include<vector>
using namespace std;
class Player{
int id;
}
int main()
{
while(true){
int m,n;
cin >> m >> n;
if( m == 0 && n == 0 ) break;
vector< Player > p;
for(int i = 0; i < m; ++i){
Player tp;
tp.id = i;
p.push_back( tp );
}
int ans = 1;
int nowplayer = 0;
int nextplayer = 1;
for(int i = 0; i < n; ++i){
string s;
cin >> s;
if( ans % 3 == 0 ){
if( s != "Fizz" ){
p.erase( p.begin() + nowplayer );
}
}else if( ans % 5 == 0 ){
if( s != "Buzz" ){
p.erase( p.begin() + nowplayer );
}
}else if(ans % 15 == 0 ){
if( s != "FizzBuzz" ){
p.erase( p.begin() + nowplayer );
}
}else{
bool ng=false;
for(int j=0;j<s.length();++j){
if(!isdigit(s[j]))ng=true;
}
int d = atoi( s.c_str() );
if( d != ans ){
ng=true;
}
if( ng ){
p.erase( p.begin() + nowplayer );
}
}
++nowplayer;
nowplayer %= p.size();
++ans;
}
int cnt = 0;
vector<int> heroes;
for(int i = 0; i < m; ++i){
if( left[i] ){
heroes.push_back( i + 1 );
}
}
for(int i = 0; i < heroes.size(); ++i){
if( i > 0 ) cout << ' ';
cout << heroes[i];
}
cout << endl;
}
return 0;
} | a.cc:10:2: error: expected ';' after class definition
10 | }
| ^
| ;
a.cc: In function 'int main()':
a.cc:21:10: error: 'int Player::id' is private within this context
21 | tp.id = i;
| ^~
a.cc:9:7: note: declared private here
9 | int id;
| ^~
a.cc:63:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
63 | if( left[i] ){
| ^
|
s460772790 | p00221 | C++ | #include<iostream>
#include<set>
#include<queue>
#include<vector>
#include<sstream>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
void solve(int n,int m,bool *isok){
vector<int> a;
rep(i,n){
a.pb(i);
}
int p=0;
for(int i=1;i<m+1 && a.size() != ;i++){
if (isok[i]){
p=(p+1)%a.size();
continue;
}
if (!isok[i]){
a.erase(a.begin()+p);
if (a.size() == 0)break;
p%=a.size();
}
}
rep(i,a.size()){
if (i)cout <<' ';
cout <<a[i]+1;
}
cout << endl;
}
main(){
int n,m;
bool isok[10011];
while(cin>>n>>m && n){
rep(i,m+1)isok[i]=true;
REP(i,1,m+1){
string in;
cin>>in;
if (i%3 == 0 && i% 5 == 0){
if (in != "FizzBuzz")isok[i]=false;
}else if (i%3==0){
if (in != "Fizz")isok[i]=false;
}else if (i%5==0){
if (in !="Buzz")isok[i]=false;
}else {
stringstream sin(in);
int tmp;
sin>>tmp;
if (tmp != i){
isok[i]=false;
}
}
}
solve(n,m,isok);
}
} | a.cc: In function 'void solve(int, int, bool*)':
a.cc:19:36: error: expected primary-expression before ';' token
19 | for(int i=1;i<m+1 && a.size() != ;i++){
| ^
a.cc: At global scope:
a.cc:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
39 | main(){
| ^~~~
|
s335425909 | p00221 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main( void )
{
int m, n;
string s;
while ( cin >> m >> n && m && n )
{
vector <int> R( m, 0 );
int curIndex = 0;
int curNumber = 1;
for ( int i = 0; i < n; i++ )
{
cin >> s;
if ( s == "FizzBuzz" && ( ( curNumber % 3 != 0 ) || ( curNumber % 5 != 0 ) ) )
{
R[curIndex] = 1;
}
else if ( s == "Fizz" && ( curNumber % 3 != 0 ) )
{
R[curIndex] = 1;
}
else if ( s == "Buzz" && ( curNumber % 5 != 0 ) )
{
R[curIndex] = 1;
}
else
{
int number;
istringstream is( s );
is >> number;
if ( number % 3 == 0 && number % 5 == 0 && s != "FizzBuzz" )
{
R[curIndex] = 1;
}
else if ( number % 3 == 0 && s != "Fizz" )
{
R[curIndex] = 1;
}
else if ( number % 5 == 0 && s != "Buzz" )
{
R[curIndex] = 1;
}
}
do
{
curIndex = ( curIndex + 1 ) % m;
} while ( R[curIndex] == 1 );
curNumber++;
}
vector <int> L;
for ( int i = 0; i < n; i++ )
{
if ( R[i] == 0 ) L.push_back( i+1 );
}
sort( L.begin(), L.end() );
for ( vector <int> ::iterator it = L.begin(); it != L.end(); it++ )
{
cout << *it;
if ( it + 1 != L.end() ) cout << " "; else cout << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:66:9: error: 'sort' was not declared in this scope; did you mean 'short'?
66 | sort( L.begin(), L.end() );
| ^~~~
| short
|
s535805172 | p00221 | C++ | //cout<<"O"<<endl;
}else{
count++;
exist[member]=false;
//cout<<"X"<<endl;
}
do{
member=(member+1)%m;
}while(!exist[member]);
}
bool first=true;
for(int i=0; i<m; i++){
if(exist[i]){
if(first){
printf("%d",i+1);
first=false;
}else{
printf(" %d",i+1);
}
}
}
cout<<endl;
}
return 0;
} | a.cc:2:7: error: expected declaration before '}' token
2 | }else{
| ^
a.cc:2:8: error: expected unqualified-id before 'else'
2 | }else{
| ^~~~
a.cc:7:7: error: expected unqualified-id before 'do'
7 | do{
| ^~
a.cc:9:8: error: expected unqualified-id before 'while'
9 | }while(!exist[member]);
| ^~~~~
a.cc:10:5: error: expected declaration before '}' token
10 | }
| ^
a.cc:12:5: error: expected unqualified-id before 'for'
12 | for(int i=0; i<m; i++){
| ^~~
a.cc:12:18: error: 'i' does not name a type
12 | for(int i=0; i<m; i++){
| ^
a.cc:12:23: error: 'i' does not name a type
12 | for(int i=0; i<m; i++){
| ^
a.cc:22:5: error: 'cout' does not name a type
22 | cout<<endl;
| ^~~~
a.cc:23:3: error: expected declaration before '}' token
23 | }
| ^
a.cc:24:3: error: expected unqualified-id before 'return'
24 | return 0;
| ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
25 | }
| ^
|
s404475102 | p00221 | C++ | #include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <vector>
using namespace std;
bool fizzbuzz(int n,string s){
if(n%15==0)return (s != "FizzBuzz");
if(n%3==0)return (s != "Fizz");
if(n%5==0)return (s != "Buzz");
for(int i=0;i<s.length();i++){
if(s[i]<'0'||s[i]>'9')return true;
}
/*ツつ「ツづォツつ「ツづォツ妥篠催エ*/
int zero = 0;
for(int i=0;i<s.length();i++){
if(s[i] == '0')zero++;
else break;
}
s = s.substr(zero,s.length()-zero);
if(s.length()>8)return true;
return (atoi(s.c_str()) != n);
}
int main(){
int n,m;
string s;
while(scanf("%d %d\n",&m,&n), m){
vector<int> rem(m);
for(int i=0;i<m;i++){
rem[i] = i+1;
}
int c = 0;
for(int i=1;i<=n;i++){
getline(cin,s);
if(rem.size() == 1)continue;
if( fizzbuzz(i,s) ){
rem.erase(remove(rem.begin(),rem.end(),rem[c]),rem.end());
}else{
c =(c+1)%rem.size();
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <vector>
using namespace std;
bool fizzbuzz(int n,string s){
if(n%15==0)return (s != "FizzBuzz");
if(n%3==0)return (s != "Fizz");
if(n%5==0)return (s != "Buzz");
for(int i=0;i<s.length();i++){
if(s[i]<'0'||s[i]>'9')return true;
}
/*ツつ「ツづォツつ「ツづォツ妥篠催エ*/
int zero = 0;
for(int i=0;i<s.length();i++){
if(s[i] == '0')zero++;
else break;
}
s = s.substr(zero,s.length()-zero);
if(s.length()>8)return true;
return (atoi(s.c_str()) != n);
}
int main(){
int n,m;
string s;
while(scanf("%d %d\n",&m,&n), m){
vector<int> rem(m);
for(int i=0;i<m;i++){
rem[i] = i+1;
}
int c = 0;
for(int i=1;i<=n;i++){
getline(cin,s);
if(rem.size() == 1)continue;
if( fizzbuzz(i,s) ){
rem.erase(remove(rem.begin(),rem.end(),rem[c]),rem.end());
}else{
c =(c+1)%rem.size();
}
}
for(int i=0;i<rem.size();i++){
cout << (i?" ":"") << rem[i];
}
cout << endl;
}
} }
}
for(int i=0;i<rem.size();i++){
cout << (i?" ":"") << rem[i];
}
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:54:30: error: a function-definition is not allowed here before '{' token
54 | bool fizzbuzz(int n,string s){
| ^
a.cc:75:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
75 | int main(){
| ^~
a.cc:75:9: note: remove parentheses to default-initialize a variable
75 | int main(){
| ^~
| --
a.cc:75:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:75:11: error: a function-definition is not allowed here before '{' token
75 | int main(){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.