submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s572269615
|
p00026
|
C
|
int main()
{
int x,y,size,nasi=0,max=0,map[10][10]={0};
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
{
if(size==1)
{
map[y][x]++;
if(y-1>=0)
map[y-1][x]++;
if(x-1>=0)
map[y][x-1]++;
if(x+1>=0)
map[y][x+1]++;
if(y+1>=0)
map[y+1][x]++;
}
if(size==2)
{
map[y][x]++;
if(y-1>=0 && x-1>=0)
map[y-1][x-1]++;
if(y-1>=0)
map[y-1][x]++;
if(y-1>=0 && x+1>=0)
map[y-1][x+1]++;
if(x-1>=0)
map[y][x-1]++;
if(x+1>=0)
map[y][x+1]++;
if(y+1>=0 && x-1>=0)
map[y+1][x-1]++;
if(y+1>=0)
map[y+1][x]++;
if(y+1>=0 && x+1>=0)
map[y+1][x+1]++;
}
if(size==3)
{
map[y][x]++;
if(y-2>=0)
map[y-2][x]++;
if(x-2>=0)
map[y][x-2]++;
if(x+2>=0)
map[y][x+2]++;
if(y+2>=0)
map[y+2][x]++;
if(y-1>=0 && x-1>=0)
map[y-1][x-1]++;
if(y-1>=0)
map[y-1][x]++;
if(y-1>=0 && x+1>=0)
map[y-1][x+1]++;
if(x-1>=0)
map[y][x-1]++;
if(x+1>=0)
map[y][x+1]++;
if(y+1>=0 && x-1>=0)
map[y+1][x-1]++;
if(y+1>=0)
map[y+1][x]++;
if(y+1>=0 && x+1>=0)
map[y+1][x+1]++;
}
}
for(y=0; y<10; y++)
{
for(x=0; x<10; x++)
{
if(map[y][x]==0)
nasi++;
if(max<map[y][x])
max=map[y][x];
}
}
printf("%d\n%d\n",nasi,max);
return 0;
}
|
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main()
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
| ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:46: error: 'EOF' undeclared (first use in this function)
4 | while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
| ^~~
main.c:4:46: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:46: note: each undeclared identifier is reported only once for each function it appears in
main.c:77:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
77 | printf("%d\n%d\n",nasi,max);
| ^~~~~~
main.c:77:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:77:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:77:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s587653956
|
p00026
|
C
|
////#include <stdio.h>
////#include <math.h>
////int main(){
////double v;
////while(scanf("%lf",&v) != EOF){
////double y=v*v/19.6;
////int z=y;
////if(y==z){
////if(z%5==0){
//// z=y/5+1;
////printf("%d\n",z);
////continue;
////}
////}
////int q=y/5;
////q += 2;
////printf("%d\n",q);
////}
////return 0;
//
//#include <stdio.h>
// int main(){
// int a[5],b[5],i,j;
// int hit=0,blow=0;
// while(scanf("%d %d %d %d %d %d %d %d",&a[1],&a[2],&a[3],&a[4],&b[1],&b[2],&b[3],&b[4]) != EOF){
// for(i=1;i<=4;i++){
// if(a[i]==b[i]){
// hit++;
// }
// }
// for(i=1;i<=4;i++){
// for(j=1;j<= 4;j++){
// if(j != i){
// if(a[i]==b[j]){
// blow++;
// }
// }
// }
// }
// printf("%d %d\n",hit,blow);
// hit=0; blow=0;
// }
// return 0;
// }
#include <stdio.h>
int main(){
int x,y,s;
while(scanf("%d,%d,%d\n",&x,&y,&s) != EOF){
int i,j,num=0;
int xy[10][10]={};
if(s==1){
xy[x][y]++;
xy[x-1][y]++;
xy[x+1][y]++;
xy[x][y-1]++;
xy[x][y+1]++;
}else if(s==2){
xy[x-1][y-1]++;
xy[x-1][y]++;
xy[x-1][y+1]++;
xy[x][y-1]++;
xy[x][y]++;
xy[x][y+1]++;
xy[x+1][y-1]++;
xy[x+1][y]++;
xy[x+1][y+1]++;
}else if(s==3){
xy[x-2][y]++;
xy[x-1][y-1]++;
xy[x-1][y]++;
xy[x-1][y+1]++;
xy[x][y-2]++;
xy[x][y-1]++;
xy[x][y]++;
xy[x][y+1]++;
xy[x][y+2]++;
xy[x+1][y-1]++;
xy[x+1][y]++;
xy[x+1][y+1]++;
xy[x+2][y]++;
}
}
int max=xy[0][0];
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(xy[i][j]==0) num++;
if(xy[i][j]>max) max=xy[i][j];
}
}
printf("%d\n%d\n",num,max);
return 0;
}
|
main.c: In function 'main':
main.c:83:19: error: 'xy' undeclared (first use in this function); did you mean 'y'?
83 | int max=xy[0][0];
| ^~
| y
main.c:83:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:84:15: error: 'i' undeclared (first use in this function)
84 | for(i=0;i<10;i++){
| ^
main.c:85:23: error: 'j' undeclared (first use in this function)
85 | for(j=0;j<10;j++){
| ^
main.c:86:43: error: 'num' undeclared (first use in this function)
86 | if(xy[i][j]==0) num++;
| ^~~
|
s605606768
|
p00026
|
C
|
#include<stdio.h>
int main(){
int i,j,x,y,size;
int data[N][N];
int ptnx1[]={0,0,0,1,-1},ptny1[]={0,-1,1,0,0};
int ptnx2[]={0,0,0,-1,-1,-1,1,1,1},ptny2[]={0,-1,1,-1,0,1,-1,0,1};
int ptnx3[]={0,0,0,-1,-1,-1,1,1,1,0,0,-2,2},ptny3[]={0,-1,1,-1,0,1,-1,0,1,2,-\
2,0,0};
for (i=0;i<N;i++)
for (j=0;j<N;j++)
data[i][j]=0;
while (scanf("%d,%d,%d",&x,&y,&size)!=EOF){
if (size==1){
for (i=0;i<5;i++)
if ((x+ptnx1[i]<N) && (y+ptny1[i]<N)){
data[x+ptnx1[i]][y+ptny1[i]]++;
}
}
if (size==2){
for (i=0;i<9;i++)
if ((x+ptnx2[i]<N) && (y+ptny2[i]<N)){
data[x+ptnx2[i]][y+ptny2[i]]++;
}
}
if (size==3){
for (i=0;i<13;i++)
if ((x+ptnx3[i]<N) && (y+ptny3[i]<N)){
data[x+ptnx3[i]][y+ptny3[i]]++;
}
}
}
int max=0;
int cnt=0;
for (i=0;i<N;i++)
for (j=0;j<N;j++){
if (data[i][j]==0)
cnt++;
if (data[i][j]>max)
max=data[i][j];
}
printf("%d\n%d\n",cnt,max);
return 0;
}
|
main.c: In function 'main':
main.c:5:12: error: 'N' undeclared (first use in this function)
5 | int data[N][N];
| ^
main.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
|
s125029611
|
p00026
|
C
|
#include <stdio.h>
#define WIDTH 10
#define HEIGHT 10
int field[ WIDTH + 4 ][ HEIGHT + 4 ] = {};
const int dx[ 3 ][ 4 ] = { { -1, 0, 1, 0 }, { -1, 1, -1, 1 }, { -2, 0, 2, 0 } };
const int dy[ 3 ][ 4 ] = { { 0, -1, 0, 1 }, { -1, -1, 1, 1 }, { 0, -2, 0, 2 } };
int main( void ) {
int i, x, y, size, white, max;
while ( scanf( "%d,%d,%d", &x, &y, &size ) == 3 ) {
x += 2;
y += 2;
field[ x ][ y ]++;
while ( size-- )
for ( i = 4; i--; field[ x + dx[ size ][ i ] ][ y + dy[ size ][ i ] ]++ ) ;
}
white = max = 0;
for ( y = HEIGHT + 2; y-- > 2; )
for ( x = WIDTH + 2; x-- > 2; white += !field[ x ][ y ] ) {
if ( max < field[ x ][ y ] )
max = field[ x ][ y ];
printf( "%d\n%d\n", white, max );
return 0;
}
|
main.c: In function 'main':
main.c:32:1: error: expected declaration or statement at end of input
32 | }
| ^
|
s423301195
|
p00026
|
C
|
2,5,3
3,6,1
3,4,2
4,5,2
3,6,3
2,4,1
|
main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 2,5,3
| ^
|
s462733333
|
p00026
|
C
|
#include <stdio.h>
////(-"-;)ミスッテ…タ…////
void s(int x, int y, int pap[][10])
{
int i, j;
int x_dif, y_dif;
for (j = 0; j < 3; j++){
for (i = 0; i < 3; i++){
x_dif = x + (i % 3) - 1;
y_dif = y + (j - 1);
if (x_dif >= 0 && x_dif < 10){
if (y_dif >= 0 && y_dif < 10){
if ((i % 3) - 1 == 0 || (j - 1) == 0){
pap[y_dif][x_dif]++;
}
}
}
}
}
}
void m(int x, int y, int pap[][10])
{
int i, j;
int x_dif, y_dif;
for (j = 0; j < 3; j++){
for (i = 0; i < 3; i++){
x_dif = x + (i % 3) - 1;
y_dif = y + (j - 1);
if (x_dif >= 0 && x_dif < 10){
if (y_dif >= 0 && y_dif < 10){
pap[y_dif][x_dif]++;
}
}
}
}
}
void l(int x, int y, int pap[][10])
{
int i, j;
int x_dif, y_dif;
for (j = 0; j < 3; j++){
for (i = 0; i < 3; i++){
x_dif = x + (i % 3) - 1;
y_dif = y + (j - 1);
if (x_dif >= 0 && x_dif < 10){
if (y_dif >= 0 && y_dif < 10){
pap[y_dif][x_dif]++;
}
}
}
}
if (x - 2 >= 0){
pap[y][x - 2]++;
}
if (x + 2 < 10){
pap[y][x + 2]++;
}
if (y - 2 >= 0){
pap[y - 2][x]++;
}
if (y + 2 < 10){
pap[y + 2][x]++;
}
}
int main(void)
{
int pap[10][10] = {0};
int x, y , size, i, j;
int big, count;
big = 0;
count = 0;
while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
switch (size){
case 1:
s(x, y, pap);
break;
case 2:
m(x, y, pap);
break;
case 3:
l(x, y, pap);
break;
}
/*グラフィカルー
for (i = 0; i < 10; i++){
for (j = 0; j < 10; j++){
printf("%d", pap[i][j]);
}
printf("\n");
}
*//
}
for (i = 0; i < 10; i++){
for (j = 0; j < 10; j++){
if (pap[i][j] > big){
big = pap[i][j];
}
if (pap[i][j] == 0){
count++;
}
}
}
printf("%d\n%d\n", count, big);
return (0);
}
|
main.c: In function 'main':
main.c:110:19: error: expected expression before '/' token
110 | *//
| ^
|
s522328958
|
p00026
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<string> split(const string &str, char delim)
{
vector<string> res;
size_t current = 0, found;
while((found = str.find_first_of(delim, current)) != string::npos)
{
res.push_back(string(str, current, found - current));
current = found + 1;
}
res.push_back(string(str, current, str.size() - current));
return res;
}
int f[10][10];
bool checkf(int x,int y)
{
if(0 <= x && x < 10 && 0 <= y && y < 10)
{
return true;
}
else
{
return false;
}
}
void dropInk(int x,int y,int size)
{
if(size == 1)
{
f[x][y]++;
if(checkf(x+1,y)) f[x+1][y]++;
if(checkf(x-1,y)) f[x-1][y]++;
if(checkf(x,y+1)) f[x][y+1]++;
if(checkf(x,y-1)) f[x][y-1]++;
}
else if(size == 2)
{
REP(i,-1,2)
{
REP(j,-1,2)
{
if(checkf(x+i,y+j)) f[x+i][y+j]++;
}
}
}
else if(size == 3)
{
REP(i,-1,2)
{
REP(j,-1,2)
{
if(checkf(x+i,y+j)) f[x+i][y+j]++;
}
}
if(checkf(x+2,y)) f[x+2][y]++;
if(checkf(x-2,y)) f[x-2][y]++;
if(checkf(x,y+2)) f[x][y+2]++;
if(checkf(x,y-2)) f[x][y-2]++;
}
}
int main()
{
memset(f,0,sizeof(f));
string s;
while(cin >> s)
{
vector<string> _s = split(s,',');
int x = atoi(_s[0].c_str());
int y = atoi(_s[1].c_str());
int size = atoi(_s[2].c_str());
dropInk(y,x,size);
}
int count = 0;
int ans = 0;
rep(i,10)
{
rep(j,10)
{
if(f[i][j] == 0)
{
count++;
}
ans = max(ans,f[i][j]);
}
}
cout << count << endl << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:75:9: error: 'memset' was not declared in this scope
75 | memset(f,0,sizeof(f));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <cstring>
4 |
|
s082802752
|
p00026
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<string> split(const string &str, char delim)
{
vector<string> res;
size_t current = 0, found;
while((found = str.find_first_of(delim, current)) != string::npos)
{
res.push_back(string(str, current, found - current));
current = found + 1;
}
res.push_back(string(str, current, str.size() - current));
return res;
}
int f[10][10];
bool checkf(int x,int y)
{
if(0 <= x && x < 10 && 0 <= y && y < 10)
{
return true;
}
else
{
return false;
}
}
void dropInk(int x,int y,int size)
{
if(size == 1)
{
f[x][y]++;
if(checkf(x+1,y)) f[x+1][y]++;
if(checkf(x-1,y)) f[x-1][y]++;
if(checkf(x,y+1)) f[x][y+1]++;
if(checkf(x,y-1)) f[x][y-1]++;
}
else if(size == 2)
{
REP(i,-1,2)
{
REP(j,-1,2)
{
if(checkf(x+i,y+j)) f[x+i][y+j]++;
}
}
}
else if(size == 3)
{
REP(i,-1,2)
{
REP(j,-1,2)
{
if(checkf(x+i,y+j)) f[x+i][y+j]++;
}
}
if(checkf(x+2,y)) f[x+2][y]++;
if(checkf(x-2,y)) f[x-2][y]++;
if(checkf(x,y+2)) f[x][y+2]++;
if(checkf(x,y-2)) f[x][y-2]++;
}
}
int main()
{
memset(f,0,sizeof(f));
string s;
while(cin >> s)
{
vector<string> _s = split(s,',');
int x = atoi(_s[0].c_str());
int y = atoi(_s[1].c_str());
int size = atoi(_s[2].c_str());
dropInk(y,x,size);
}
int count = 0;
int ans = 0;
rep(i,10)
{
rep(j,10)
{
if(f[i][j] == 0)
{
count++;
}
ans = max(ans,f[i][j]);
}
}
cout << count << endl << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:76:9: error: 'memset' was not declared in this scope
76 | memset(f,0,sizeof(f));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <cstdlib>
+++ |+#include <cstring>
5 |
|
s054032605
|
p00026
|
C++
|
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define scanf scanf_s
int i, j, s;
int p[15][15];
void nuri(int i, int j)
{
if (i >= 0 && i < 10 && j >= 0 && j < 10) p[i][j]++;
}
void shou(int i, int j)
{
nuri(i, j);
nuri(i - 1, j);
nuri(i, j - 1);
nuri(i, j + 1);
nuri(i + 1, j);
}
void chu(int i, int j)
{
shou(i, j);
nuri(i - 1, j - 1);
nuri(i - 1, j + 1);
nuri(i + 1, j - 1);
nuri(i + 1, j + 1);
}
void dai(int i, int j)
{
chu(i, j);
nuri(i - 2, j);
nuri(i, j - 2);
nuri(i, j + 2);
nuri(i + 2, j);
}
int main()
{
REP(i, 15)REP(j, 15) p[i][j] = 0;
while (scanf("%d,%d,%d", &i, &j, &s))
{
if (s == 1) shou(i, j);
if (s == 2) chu(i, j);
if (s == 3) dai(i, j);
}
int cnt = 0; int mx = 0;
REP(i, 10)REP(j, 10)
{
if (p[i][j] == 0) cnt++;
mx = max(p[i][j], mx);
}
cout << cnt << endl << mx << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | #define scanf scanf_s
| ^~~~~~~
a.cc:64:16: note: in expansion of macro 'scanf'
64 | while (scanf("%d,%d,%d", &i, &j, &s))
| ^~~~~
|
s262128800
|
p00026
|
C++
|
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define scanf scanf_s
int i, j, s;
int p[15][15];
void nuri(int i, int j)
{
if (i >= 0 && i < 10 && j >= 0 && j < 10) p[i][j]++;
}
void shou(int i, int j)
{
nuri(i, j);
nuri(i - 1, j);
nuri(i, j - 1);
nuri(i, j + 1);
nuri(i + 1, j);
}
void chu(int i, int j)
{
shou(i, j);
nuri(i - 1, j - 1);
nuri(i - 1, j + 1);
nuri(i + 1, j - 1);
nuri(i + 1, j + 1);
}
void dai(int i, int j)
{
chu(i, j);
nuri(i - 2, j);
nuri(i, j - 2);
nuri(i, j + 2);
nuri(i + 2, j);
}
int main()
{
REP(i, 15)REP(j, 15) p[i][j] = 0;
while (scanf("%d,%d,%d", &i, &j, &s) != EOF)
{
if (s == 1) shou(i, j);
if (s == 2) chu(i, j);
if (s == 3) dai(i, j);
}
int cnt = 0; int mx = 0;
REP(i, 10)REP(j, 10)
{
if (p[i][j] == 0) cnt++;
mx = max(p[i][j], mx);
}
cout << cnt << endl << mx << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | #define scanf scanf_s
| ^~~~~~~
a.cc:64:16: note: in expansion of macro 'scanf'
64 | while (scanf("%d,%d,%d", &i, &j, &s) != EOF)
| ^~~~~
|
s664006534
|
p00026
|
C++
|
#include <stdio.h>
int main()
{
int ans1 = 0;
int ans2 = 0;
int x,y,size;
int paper[14][14];
for(int i = 0; i < 14; i++){
for(int j = 0; j < 14; j++){
paper[i][j] = 0;
}
}
while(scanf("%d,%d,%d",&x,&y,&size) != EOF){
paper[x + 2][y + 2] ++;
paper[x + 1][y + 2] ++;
paper[x + 2][y + 1] ++;
paper[x + 3][y + 2] ++;
paper[x + 2][y + 3] ++;
if(size > 1){
paper[x + 1][y + 3] ++;
paper[x + 1][y + 1] ++;
paper[x + 3][y + 1] ++;
paper[x + 3][y + 3] ++;
}
if(size > 2){
paper[x + 2][y + 4] ++;
paper[x + 2][y] ++;
paper[x + 4][y + 2] ++;
paper[x][y + 2] ++;
}
}
for(int i = 2; i < 12; i++){
for(int j = 2; j < 12; j++){
if(paper[i][j] == 0){
ans1++;
}
if(ans2 < paper[i][j]){
ans2 = paper[i][j];
}
}
}
printf("%d\n%d\n",ans1,ans2);
Sleep(2000);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:45:9: error: 'Sleep' was not declared in this scope
45 | Sleep(2000);
| ^~~~~
|
s622044814
|
p00026
|
C++
|
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>
#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;
int S[3][3] = {
{ 0, 1, 0 },
{ 1, 1, 1 },
{ 0, 1, 0 },
};
int M[3][3] = {
{ 1, 1, 1 },
{ 1, 1, 1 },
{ 1, 1, 1 },
};
int L[5][5] = {
{ 0, 0, 1, 0, 0 },
{ 0, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 1 },
{ 0, 1, 1, 1, 0 },
{ 0, 0, 1, 0, 0 },
};
int tile[10][10];
int main()
{
int x, y, size;
while (scanf_s("%d,%d,%d",&x,&y,&size)){
int xt = x;
int yt = y;
if (size == 1){
while (xt - 1 < 0)++xt;
while (yt - 1 < 0)++yt;
while (xt + 2 > 9)--xt;
while (yt + 2 > 9)--yt;
for (int i = yt - 1; i < yt + 2; ++i){
for (int j = xt - 1; j < xt + 2; ++j){
tile[i][j] += S[i + 1 - yt][j + 1 - xt];
}
}
}
if (size == 2){
while (xt - 1 < 0)++xt;
while (yt - 1 < 0)++yt;
while (xt + 2 > 9)--xt;
while (yt + 2 > 9)--yt;
for (int i = yt - 1; i < yt + 2; ++i){
for (int j = xt - 1; j < xt + 2; ++j){
tile[i][j] += M[i + 1 - yt][j + 1 - xt];
}
}
}
if (size == 3){
while (xt - 1 < 0)++xt;
while (yt - 1 < 0)++yt;
while (xt + 3 > 9)--xt;
while (yt + 3 > 9)--yt;
for (int i = yt - 2; i < yt + 3; ++i){
for (int j = xt - 2; j < xt + 3; ++j){
tile[i][j] += L[i + 2 - yt][j + 2 - xt];
}
}
}
}
int white = 0;
int max_ = -1;
REP(i, 10){
REP(j, 10){
if (!tile[i][j])
++white;
max_ = max(tile[i][j], max_);
}
}
cout << white << endl << max_ << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:49:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
49 | while (scanf_s("%d,%d,%d",&x,&y,&size)){
| ^~~~~~~
| scanf
|
s736413781
|
p00026
|
C++
|
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int field[10][10];
int sx[]={-1,0,0,0,1},sy[]={0,-1,0,1,0};
int bx[]={-2,-1,-1,-1,0,0,0,0,0,1,1,1,2},by[]={0,-1,0,1,-2,-1,0,1,2,-1,0,1,0};
void small(int x,int y){
for(int i=0;i<5;i++){
field[x+sx][y+sy]++;
}
}
void middle(int x,int y){
for(int i=-1;i<=1;i++){
for(int j=-1;j<=1;j++){
field[x+i][y+j]++;
}
void big(int x,int y){
for(int i=0;i<13;i++){
field[x+bx][y+by]++;
}
}
int main(){
int x,y,size,ans=0,count=0;
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
field[i][j]=0;
}
}
while(cin>>x>>y>>size){
if(size==1)small(x,y);
else if(size==2)middle(x,y);
else big(x,y);
}
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(field[i][j]==0)count++;
else ans=max(ans,field[i][j]);
}
}
cout<<count<<endl<<ans<<endl;
return 0;
}
|
a.cc: In function 'void small(int, int)':
a.cc:10:22: error: invalid types 'int [10][10][int*]' for array subscript
10 | field[x+sx][y+sy]++;
| ^
a.cc: In function 'void middle(int, int)':
a.cc:18:22: error: a function-definition is not allowed here before '{' token
18 | void big(int x,int y){
| ^
a.cc:23:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
23 | int main(){
| ^~
a.cc:23:9: note: remove parentheses to default-initialize a variable
23 | int main(){
| ^~
| --
a.cc:23:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:23:11: error: a function-definition is not allowed here before '{' token
23 | int main(){
| ^
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:14:31: note: to match this '{'
14 | for(int i=-1;i<=1;i++){
| ^
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:13:25: note: to match this '{'
13 | void middle(int x,int y){
| ^
|
s267999053
|
p00026
|
C++
|
#include<iostream>
using namespace std;
int data[15][15]={0};
int main(){
int x,y,s;
char c;
while(cin>>x>>c>>y>>c>>s && s){
while(1){
data[x][y]++;
if(y-1>=0)data[x][y-1]++;
if(x+1<10)data[x+1][y]++;
if(y+1<10)data[x][y+1]++;
if(x-1>=0)data[x-1][y]++;
if(s==1)break;
if(x+1<10 && y+1<10)data[x+1][y+1]++;
if(x+1<10 && y-1>=0)data[x+1][y-1]++;
if(x-1>=0 && y-1>=0)data[x-1][y-1]++;
if(x-1>=0 && y+1<10)data[x-1][y+1]++;
if(s==2)break;
if(x+2<10)data[x+2][y]++;
if(y-2>=0)data[x][y-2]++;
if(y+2<10)data[x][y+2]++;
if(x-2>=0)data[x-2][y]++;
break;
}
}
int white=0,ma=0;
for(int i=0;i<i<10;i++){
for(int j=0;j<10;j++){
if(data[i][j]==0)white++;
ma=max(ma,data[i][j]);
}
}
cout<<white<<" "<<ma<<endl;
}
|
a.cc:9:32: error: extended character is not valid in an identifier
9 | while(cin>>x>>c>>y>>c>>s && s){
| ^
a.cc: In function 'int main()':
a.cc:9:32: error: 's\U00003000' was not declared in this scope
9 | while(cin>>x>>c>>y>>c>>s && s){
| ^~~
a.cc:12:25: error: reference to 'data' is ambiguous
12 | data[x][y]++;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:13:35: error: reference to 'data' is ambiguous
13 | if(y-1>=0)data[x][y-1]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:14:35: error: reference to 'data' is ambiguous
14 | if(x+1<10)data[x+1][y]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:15:35: error: reference to 'data' is ambiguous
15 | if(y+1<10)data[x][y+1]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:16:35: error: reference to 'data' is ambiguous
16 | if(x-1>=0)data[x-1][y]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:18:45: error: reference to 'data' is ambiguous
18 | if(x+1<10 && y+1<10)data[x+1][y+1]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:19:45: error: reference to 'data' is ambiguous
19 | if(x+1<10 && y-1>=0)data[x+1][y-1]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | int data[15][15]={0};
| ^~~~
a.cc:20:45: error: reference to 'data' is ambiguous
20 | if(x-1>=0 && y-1>=0)data[x-1][y-1]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:5: note: 'int data [15][15]'
4 | in
|
s010231315
|
p00026
|
C++
|
#include<stdio.h>
static int map[11][11];
void small(int x,int y){
map[y][x]+=1;
map[y][x+1]+=1;
map[y][x-1]+=1;
map[y+1][x]+=1;
map[y-1][x]+=1;
}
void midium(int x,int y){
small(x,y);
map[y+1][x+1]+=1;
map[y-1][x-1]+=1;
map[y-1][x+1]+=1;
map[y+1][x-1]+=1;
}
void big(int x,int y){
medium(x,y);
map[y][x+2]+=1;
map[y][x-2]+=1;
map[y+2][x]+=1;
map[y-2][x]+=1;
}
int main(){
int x[1000],y[1000],select[1000];
int i,j;
int space=0,max=0;
for(i=0;i<11;i++){
for(j=0;j<11;j++)map[i][j]=0;
}
i=0;
while(scanf("%d,%d,%d",&x[i],&y[i],&select[i])!=EOF){
switch(select[i]){
case 1:
small(x[i]+1,y[i]+1);
break;
case 2:
medium(x[i]+1,y[i]+1);
break;
case 3:
big(x[i]+1,y[i]+1);
break;
}
i++;
}
for(i=1;i<11;i++){
for(j=1;j<11;j++){
if(map[i][j]==0)space++;
if(max<map[i][j])max=map[i][j];
}
}
printf("%d\n%d\n",space,max);
return 0;
}
|
a.cc: In function 'void big(int, int)':
a.cc:22:9: error: 'medium' was not declared in this scope; did you mean 'midium'?
22 | medium(x,y);
| ^~~~~~
| midium
a.cc: In function 'int main()':
a.cc:46:25: error: 'medium' was not declared in this scope; did you mean 'midium'?
46 | medium(x[i]+1,y[i]+1);
| ^~~~~~
| midium
|
s003101538
|
p00026
|
C++
|
#include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int main ()
{
int m[18][18] = {};
int x, y, s;
int dx1[4] = {0, 1, 0, -1}, dy1[4] = {1, 0, -1, 0};
int dx2[8] = {0, 1, 1, 1, 0, -1, -1, -1}, dy2[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx3[12] = {0, -1, 0, 1, -2, -1, 1, 2, -1, 0, 1, 0}, dy3[12] = {2, 1, 1, 1, 0, 0, 0, 0, -1, -1, -1, -2};
while (scanf("%d,%d,%d", &x, &y, &s) != EOF)
{
x += 3;
y += 3;
m[x][y]++;
switch (s)
{
case 1:
for (int i = 0; i < 4; i++)m[x + dx1[i]][y + dy1[i]]++;
break;
case 2:B
for (int i = 0; i < 8; i++)m[x + dx2[i]][y + dy2[i]]++;
break;
case 3:
for (int i = 0; i < 12; i++)m[x + dx3[i]][y + dy3[i]]++;
break;
}
}
int ans1 = 0, ans2 = 0;
for (int x = 3; x <13; x++)
{
for (int y = 3; y < 13; y++)
{
if (m[x][y] == 0)ans1++;
ans2 = max(ans2, m[x][y]);
cout<<m[y][x];
}
cout<<endl;
}
cout << ans1 << endl << ans2 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:24: error: 'B' was not declared in this scope
24 | case 2:B
| ^
a.cc:25:41: error: 'i' was not declared in this scope
25 | for (int i = 0; i < 8; i++)m[x + dx2[i]][y + dy2[i]]++;
| ^
|
s528739566
|
p00026
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int ma[10][10];
int x,y,d;
char c;
memset(ma,0,sizeof(ma));
//while(cin>>x>>c>>y>>c>>d){
for(int i=0;i<6;i++){
cin>>x>>c>>y>>c>>d;
ma[y][x]++;
if(d==1){
if(x>0){
ma[y][x-1]++;
}
if(x<9){
ma[y][x+1]++;
}
if(y>0){
ma[y-1][x]++;
}
if(y<9){
ma[y+1][x]++;
}
}
else if(d==2){
if(x>0){
ma[y][x-1]++;
}
if(x<9){
ma[y][x+1]++;
}
if(y>0){
ma[y-1][x]++;
}
if(y<9){
ma[y+1][x]++;
}
if(x>0&&y<9){
ma[y+1][x-1]++;
}
if(x<9&&y>0){
ma[y-1][x+1]++;
}
if(x>0&&y>0){
ma[y-1][x-1]++;
}
if(x<9&&y<9){
ma[y+1][x+1]++;
}
}
else{
if(x>0){
ma[y][x-1]++;
}
if(x<9){
ma[y][x+1]++;
}
if(y>0){
ma[y-1][x]++;
}
if(y<9){
ma[y+1][x]++;
}
if(x>0&&y<9){
ma[y+1][x-1]++;
}
if(x<9&&y>0){
ma[y-1][x+1]++;
}
if(x>0&&y>0){
ma[y-1][x-1]++;
}
if(x<9&&y<9){
ma[y+1][x+1]++;
}
if(x>1){
ma[y][x-2]++;
}
if(x<8){
ma[y][x+2]++;
}
if(y>1){
ma[y-2][x]++;
}
if(y<8){
ma[y+2][x]++;
}
}
}
int em=0,m=0;
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(ma[i][j]==0)em++;
m=max(m,ma[i][j]);
}
}
cout<<em<<endl<<m<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: 'memset' was not declared in this scope
8 | memset(ma,0,sizeof(ma));
| ^~~~~~
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;
|
s170337839
|
p00026
|
C++
|
import Control.Monad
import qualified Data.Array.Unboxed as A
import qualified Data.Array.ST as AS
import Data.List
data Drop = Small | Middle | Large deriving (Enum)
spread :: Drop -> (Int,Int) -> [(Int,Int)]
spread Small = neighbours 1
spread Middle = \(x,y) -> [(x+i,y+j) | i <- [-1..1], j <- [-1..1]]
spread Large = neighbours 2
neighbours :: Int -> (Int,Int) -> [(Int,Int)]
neighbours n (x,y) =
[(x+i,y+j) | i <- [-n..n], let jw = n - abs i, j <- [-jw..jw]]
dropInk :: [((Int,Int), Drop)] -> A.UArray (Int,Int) Int
dropInk ds = AS.runSTUArray $ do
paper <- AS.newArray ((0,0), (9,9)) 0
forM_ ds $ \ (loc, d) ->
forM_ (spread d loc) $ \ stain ->
unless (outside stain) $
AS.readArray paper stain >>= AS.writeArray paper stain . succ
return paper
outside :: (Int,Int) -> Bool
outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
parseLine :: String -> ((Int,Int), Drop)
parseLine s = let (x:y:d:_) = map read . splitWith ',' $ s
in ((x,y), toEnum (d-1))
splitWith :: Eq a => a -> [a] -> [[a]]
splitWith c = unfoldr f where
f [] = Nothing
f xs = let (pre,post) = break (== c) xs in
Just (pre, drop 1 post)
main = do
paper <- A.elems . dropInk . map parseLine . lines <$> getContents
print . length . filter (== 0) $ paper
print . maximum $ paper
|
a.cc:9:17: error: stray '\' in program
9 | spread Middle = \(x,y) -> [(x+i,y+j) | i <- [-1..1], j <- [-1..1]]
| ^
a.cc:9:47: error: too many decimal points in number
9 | spread Middle = \(x,y) -> [(x+i,y+j) | i <- [-1..1], j <- [-1..1]]
| ^~~~
a.cc:9:61: error: too many decimal points in number
9 | spread Middle = \(x,y) -> [(x+i,y+j) | i <- [-1..1], j <- [-1..1]]
| ^~~~
a.cc:19:16: error: stray '\' in program
19 | forM_ ds $ \ (loc, d) ->
| ^
a.cc:20:32: error: stray '\' in program
20 | forM_ (spread d loc) $ \ stain ->
| ^
a.cc:26:25: error: stray '`' in program
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^
a.cc:26:30: error: stray '`' in program
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^
a.cc:26:33: error: too many decimal points in number
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^~~~
a.cc:26:44: error: stray '`' in program
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^
a.cc:26:49: error: stray '`' in program
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^
a.cc:26:52: error: too many decimal points in number
26 | outside (x,y) = not $ x `elem` [0..9] && y `elem` [0..9]
| ^~~~
a.cc:1:1: error: 'import' does not name a type
1 | import Control.Monad
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s603704210
|
p00026
|
C++
|
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX 1e7
int sx[] = {0,0,-1,1};
int sy[] = {1,-1,0,0};
int my[] = {0,0,1,1,1,-1,-1,-1};
int mx[] = {1,-1,0,1,-1,0,1,-1};
int lx[] = {0,0,0,0,1,1,1,2,-1,-1,-1,-2};
int ly[] = {1,-1,2,-2,0,1,-1,0,0,-1,1,0};
int main(){
vvi v(12,vi(12,0));
vi x(100,0); vi y(100,0); vi ink(100,0);
int i =0; char c,d;
while(cin >> x[i] >>c>>y[i] >>d >> ink[i]){
v[y[i]][x[i]]+=1;
if(ink[i] == 1){
rep(j,4){
int tx =x[i]+sx[j]; int ty = y[i]+sy[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}else if(ink[i] == 2){
rep(j,8){
int tx =x[i]+mx[j]; int ty = y[i]+my[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}else if(ink[i] == 3){
rep(j,12){
int tx =x[i]+lx[j]; int ty = y[i]+ly[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}
i++;
}
int ans1 = -INF; int ans2 = 0;
rep(i,10) rep(j,10){
ans1 = max(ans1,v[i][j]);
if(v[i][j] == 0)
ans2++;
}
cout << ans2<< endl;
cout << ans1<< endl;
return 0;
|
a.cc: In function 'int main()':
a.cc:71:14: error: expected '}' at end of input
71 | return 0;
| ^
a.cc:34:12: note: to match this '{'
34 | int main(){
| ^
|
s231319922
|
p00026
|
C++
|
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX 1e7
int sx[] = {0,0,-1,1};
int sy[] = {1,-1,0,0};
int my[] = {0,0,1,1,1,-1,-1,-1};
int mx[] = {1,-1,0,1,-1,0,1,-1};
int lx[] = {0,0,0,0,1,1,1,2,-1,-1,-1,-2};
int ly[] = {1,-1,2,-2,0,1,-1,0,0,-1,1,0};
int main(){
vvi v(12,vi(12,0));
vi x(100,0); vi y(100,0); vi ink(100,0);
int i =0; char c,d;
while(cin >> x[i] >>c>>y[i] >>d >> ink[i]){
v[y[i]][x[i]]+=1;
if(ink[i] == 1){
rep(j,4){
int tx =x[i]+sx[j]; int ty = y[i]+sy[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}else if(ink[i] == 2){
rep(j,8){
int tx =x[i]+mx[j]; int ty = y[i]+my[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}else if(ink[i] == 3){
rep(j,12){
int tx =x[i]+lx[j]; int ty = y[i]+ly[j];
if(0<=tx && tx<10 && 0<=ty && ty<10)
v[ty][tx]+=1;
}
}
i++;
}
int ans1 = -INF; int ans2 = 0;
rep(i,10) rep(j,10){
ans1 = max(ans1,v[i][j]);
if(v[i][j] == 0)
ans2++;
}
cout << ans2<< endl;
cout << ans1<< endl;
return 0;
|
a.cc: In function 'int main()':
a.cc:71:14: error: expected '}' at end of input
71 | return 0;
| ^
a.cc:34:12: note: to match this '{'
34 | int main(){
| ^
|
s442927636
|
p00026
|
C++
|
#include <iostream>
#include <cstdio>
#define scanf scanf_s
#define SIZE 10
using namespace std;
int format[3][12][2] = { { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } },
{ { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 } },
{ { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 },{ 0,2 },{ 2,0 },{ 0,-2 },{ -2,0 } } };
int main() {
int dx, dy, x, y, s, count, most, map[SIZE][SIZE], num[3] = { 4,9,12 };
count = 100;
most = 0;
while (scanf("%d,%d,%d", &x, &y, &s)) {
x--;
y--;
s--;
for (int i = 0; i < num[s]; i++) {
dx = x + format[s][i][0];
dy = y + format[s][i][1];
if (dx < 0 || dx >= SIZE || dy < 0 || dy >= SIZE) {
continue;
}
map[dx][dy]++;
if (map[dx][dy] == 1) {
count--;
}
if (map[dx][dy] > most) {
most = map[dx][dy];
}
}
}
cout << count << endl << most << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
4 | #define scanf scanf_s
| ^~~~~~~
a.cc:18:16: note: in expansion of macro 'scanf'
18 | while (scanf("%d,%d,%d", &x, &y, &s)) {
| ^~~~~
|
s776271018
|
p00026
|
C++
|
#include <iostream>
#include <cstdio>
#define scanf scanf_s
#define SIZE 10
using namespace std;
int map[SIZE][SIZE];
void drop(int x, int y) {
if (x < 0 || y < 0 || x >= SIZE || y >= SIZE) return;
map[x][y]++;
}
int main() {
int x, y, s, count = 0, most = 0;
while (scanf("%d,%d,%d", &x, &y, &s)) {
x--;
y--;
drop(x, y);
drop(x, y + 1);
drop(x + 1, y);
drop(x, y - 1);
drop(x - 1, y);
if (s > 1) {
drop(x + 1, y + 1);
drop(x + 1, y - 1);
drop(x - 1, y - 1);
drop(x - 1, y + 1);
if (s > 2) {
drop(x, y + 2);
drop(x, y - 2);
drop(x + 2, y);
drop(x - 2, y);
}
}
}
for (int i = 0; i < SIZE; i++) {
for (int j = 0; j < SIZE; j++) {
if (map[i][j] > most) {
most = map[i][j];
}
if (map[i][j] == 0) {
count++;
}
}
}
cout << count << endl << most << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
4 | #define scanf scanf_s
| ^~~~~~~
a.cc:20:16: note: in expansion of macro 'scanf'
20 | while (scanf("%d,%d,%d", &x, &y, &s)) {
| ^~~~~
|
s049120951
|
p00026
|
C++
|
#include <iostream>
#include <algorithm>
int main()
{
int s = 100;
int xy[10][10] = {};
while (true) {
int x, y, n;
char a, b;
std::cin >> x >> a >> y >> b >> n;
if (x == 0) {
break;
}
switch (n)
{
case 1:{
if (x != 0) {
++xy[x - 1][y];
}
++xy[x + 1][y];
if (y != 0) {
++xy[x][y - 1];
}
++xy[x][y + 1];
break;
}
case 2:{
if (x != 0) {
++xy[x - 1][y];
++xy[x - 1][y - 1];
++xy[x - 1][y + 1];
}
if (y != 0) {
++xy[x][y - 1];
++xy[x + 1][y - 1];
}
++xy[x + 1][y];
++xy[x][y + 1];
++xy[x + 1][y + 1];
break;
}
case 3:{
if (x != 0) {
++xy[x - 1][y];
++xy[x - 1][y - 1];
++xy[x - 1][y + 1];
}
if (y != 0) {
++xy[x][y - 1];
++xy[x + 1][y - 1];
}
++xy[x + 1][y];
++xy[x][y + 1];
++xy[x + 1][y + 1];
if(x!=2){ ++xy[x - 2][y];}
++xy[x + 2][y];
if (y != 2) {
++xy[x][y - 2];
}
++xy[x][y + 2];
break;
}
}
}
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
if (xy[i][j] > 0) {
--s;
}
}
}
std::sort(xy[0][0], xy[10][10]);
std::cout << s << std::endl;
std::cout << xy[10][10] << std::endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:73:11: required from here
73 | std::sort(xy[0][0], xy[10][10]);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int')
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int')
1782 | *__first = _GLIBCXX_MOVE(__val);
| ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1777 | if (__comp(__i, __first))
| ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:73:11: required from here
73 | std::sort(xy[0][0], xy[10][10]);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algo.h:61:
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1593 | std::__make_heap(__first, __middle, __comp);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:73:11: required from here
73 | std::sort(xy[0][0], xy[10][10]);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
344 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
346 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1596 | std::__pop_heap(__first, __middle, __i, __comp);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:73:11: required from here
73 | std::sort(xy[0][0], xy[10][10]);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
258 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
260 | _DistanceType;
| ^~~~~~~~
|
s302662664
|
p00026
|
C++
|
#include <iostream>
#include <algorithm>
int main()
{ int x, y, n;
char a, b;
int a = 0;
int s = 100;
int xy[10][10] = {};
while (std::cin >>x>> a >> y >> b >> n) {
switch (n)
{
case 1: {
if (x != 0) {
++xy[x - 1][y];
}
++xy[x + 1][y];
if (y != 0) {
++xy[x][y - 1];
}
++xy[x][y + 1];
break;
}
case 2: {
if (x != 0) {
++xy[x - 1][y];
++xy[x - 1][y - 1];
++xy[x - 1][y + 1];
}
if (y != 0) {
++xy[x][y - 1];
++xy[x + 1][y - 1];
}
++xy[x + 1][y];
++xy[x][y + 1];
++xy[x + 1][y + 1];
break;
}
case 3: {
if (x != 0) {
++xy[x - 1][y];
++xy[x - 1][y - 1];
++xy[x - 1][y + 1];
}
if (y != 0) {
++xy[x][y - 1];
++xy[x + 1][y - 1];
}
++xy[x + 1][y];
++xy[x][y + 1];
++xy[x + 1][y + 1];
if (x != 2) { ++xy[x - 2][y]; }
++xy[x + 2][y];
if (y != 2) {
++xy[x][y - 2];
}
++xy[x][y + 2];
break;
}
}
}
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
if (xy[i][j] > 0) {
--s;
}
}
}
a = xy[0][0];
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
if (a < xy[i][j]) {
a = xy[i][j];
}
}
}
std::cout << s-1 << std::endl;
std::cout << a << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:13: error: conflicting declaration 'int a'
6 | int a = 0;
| ^
a.cc:5:22: note: previous declaration as 'char a'
5 | char a, b;
| ^
|
s731902453
|
p00026
|
C++
|
#include<iostream>
#include<stdio.h>
#define DROP(x,y) if(x>=0&&y>=0&&x<10&&y<10)++cloth[x][y]
using namespace std;
??
int main(){
??
????????int x, y, size;
????????int cloth[10][10];
????????int count, max;
??????????
????????for (int i = 0; i < 10; ++i)
????????for (int j = 0; j < 10; ++j)
????????????????cloth[i][j] = 0;
??
????????while (scanf("%d,%d,%d", &x, &y, &size) + 1){
????????????????if (size == 1){
????????????????????????DROP(x, y);
????????????????????????DROP(x + 1, y);
????????????????????????DROP(x, y + 1);
????????????????????????DROP(x - 1, y);
????????????????????????DROP(x, y - 1);
????????????????}
??
????????????????else if (size == 2){
????????????????????????DROP(x, y);
????????????????????????DROP(x, y - 1);
????????????????????????DROP(x, y + 1);
????????????????????????DROP(x - 1, y - 1);
????????????????????????DROP(x - 1, y);
????????????????????????DROP(x - 1, y + 1);
????????????????????????DROP(x + 1, y - 1);
????????????????????????DROP(x + 1, y);
????????????????????????DROP(x + 1, y + 1);
????????????????}
??
????????????????else if (size == 3){
????????????????????????DROP(x, y);
????????????????????????DROP(x, y - 1);
????????????????????????DROP(x, y + 1);
????????????????????????DROP(x - 1, y - 1);
????????????????????????DROP(x - 1, y);
????????????????????????DROP(x - 1, y + 1);
????????????????????????DROP(x + 1, y - 1);
????????????????????????DROP(x + 1, y);
????????????????????????DROP(x + 1, y + 1);
????????????????????????DROP(x + 2, y);
????????????????????????DROP(x - 2, y);
????????????????????????DROP(x, y + 2);
????????????????????????DROP(x, y - 2);
????????????????}
????????}
??
????????for (int i = 0; i < 10; ++i)
????????for (int j = 0; j < 10; ++j){
????????????????if (cloth[i][j] == 0)++count;
????????????????if (cloth[i][j] > max)max = cloth[i][j];
????????}
??
????????cout << count << endl << max << endl;
??
??????????
??
??
??
}
|
a.cc:5:1: error: expected unqualified-id before '?' token
5 | ??
| ^
|
s133049842
|
p00026
|
C++
|
#include<iostream>
int main()
{
????????int density[10][10] = {};
????????int x, y, size;
????????char comma;
????????while (std::cin >> x >> comma >> y >> comma >> size) {
????????????????switch (size) {
????????????????case 3:
????????????????????????if (x - 2 >= 0) ++density[x - 2][y];
????????????????????????if (y - 2 >= 0) ++density[x][y - 2];
????????????????????????if (x + 2 < 10) ++density[x + 2][y];
????????????????????????if (y + 2 < 10) ++density[x][y + 2];
????????????????????????// fall through
????????????????case 2:
????????????????????????if (x - 1 >= 0 && y - 1 >= 0) ++density[x - 1][y - 1];
????????????????????????if (x - 1 >= 0 && y + 1 < 10) ++density[x - 1][y + 1];
????????????????????????if (x + 1 < 10 && y - 1 >= 0) ++density[x + 1][y - 1];
????????????????????????if (x + 1 < 10 && y + 1 < 10) ++density[x + 1][y + 1];
????????????????????????// fall through
????????????????case 1:
????????????????????????if (x - 1 >= 0) ++density[x - 1][y];
????????????????????????if (y - 1 >= 0) ++density[x][y - 1];
????????????????????????if (x + 1 < 10) ++density[x + 1][y];
????????????????????????if (y + 1 < 10) ++density[x][y + 1];
????????????????}
????????????????++density[x][y];
????????}
??
????????int cnt = 0, max = 0;
????????for (int i = 0; i < 10; ++i) {
????????????????for (int j = 0; j < 10; ++j) {
????????????????????????if (density[i][j] == 0) ++cnt;
????????????????????????if (max < density[i][j]) max = density[i][j];
????????????????}
????????}
????????std::cout << cnt << std::endl << max << std::endl;
}
|
a.cc:14:23: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
14 | ????????????????????????// fall through
a.cc:20:23: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
20 | ????????????????????????// fall through
a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:2: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:3: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:4: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:5: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:6: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:7: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:8: error: expected primary-expression before '?' token
4 | ????????int density[10][10] = {};
| ^
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int density[10][10] = {};
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int density[10][10] = {};
| ^~~
a.cc:5:1: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:4: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:5: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:6: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:7: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:8: error: expected primary-expression before '?' token
5 | ????????int x, y, size;
| ^
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int x, y, size;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int x, y, size;
| ^~~
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:4: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:5: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:6: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:7: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:8: error: expected primary-expression before '?' token
6 | ????????char comma;
| ^
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:6:9: error: expected ':' before 'char'
6 | ????????char comma;
| ^~~~
| :
a.cc:6:9: error: expected primary-expression before 'char'
6 | ????????char comma;
| ^~~~
a.cc:7:1: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:3: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:4: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:5: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:6: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:7: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:8: error: expected primary-expression before '?' token
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^
a.cc:7:9: error: expected primary-expression before 'while'
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^~~~~
a.cc:7:9: error: expected ':' before 'while'
7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
| ^~~~~
| :
a.cc:7:9: error: expec
|
s323021626
|
p00026
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
????????int paper[15][15] = {{0}};
????????int x,y,size;
????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
????????{
????????????????x+=2;
????????????????y+=2;
????????????????if(size==1)
????????????????{
????????????????????????paper[x][y]+=1;paper[x+1][y]+=1;paper[x-1][y]+=1;paper[x][y-1]+=1;paper[x][y+1]+=1;
????????????????}
????????????????if(size==2)
????????????????{
????????????????????????paper[x][y]+=1;paper[x-1][y+1]+=1;paper[x-1][y]+=1;paper[x-1][y-1]+=1;paper[x][y+1]+=1;paper[x][y-1]+=1;paper[x+1][y-1]+=1;paper[x+1][y]+=1;paper[x+1][y+1]+=1;
????????????????}
????????????????if(size==3)
????????????????{
????????????????????????paper[x][y]+=1;paper[x-1][y+1]+=1;paper[x-1][y]+=1;paper[x-1][y-1]+=1;paper[x][y+1]+=1;paper[x][y-1]+=1;paper[x+1][y-1]+=1;paper[x+1][y]+=1;paper[x+1][y+1]+=1;paper[x+2][y]+=1;paper[x-2][y]+=1;paper[x][y+2]+=1;paper[x][y-2]+=1;
????????????????}
????????}
????????int max=0,voi=0;
????????for(int i=2;i<=11;i++)
????????{
????????????????for(int j=2;j<=11;j++)
????????????????{
????????????????????????if(paper[i][j]>max)max=paper[i][j];
????????????????????????if(paper[i][j]==0)voi++;
????????????????}
????????}
????????cout<<voi<<endl<<max<<endl;
????????return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:3: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:4: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:5: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:6: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:7: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:8: error: expected primary-expression before '?' token
7 | ????????int paper[15][15] = {{0}};
| ^
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:7:9: error: expected ':' before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
| :
a.cc:7:9: error: expected primary-expression before 'int'
7 | ????????int paper[15][15] = {{0}};
| ^~~
a.cc:8:1: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:7: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:8: error: expected primary-expression before '?' token
8 | ????????int x,y,size;
| ^
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:8:9: error: expected ':' before 'int'
8 | ????????int x,y,size;
| ^~~
| :
a.cc:8:9: error: expected primary-expression before 'int'
8 | ????????int x,y,size;
| ^~~
a.cc:9:1: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:2: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:3: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:4: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:5: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:7: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:8: error: expected primary-expression before '?' token
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:9:9: error: expected ':' before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
| :
a.cc:9:9: error: expected primary-expression before 'while'
9 | ????????while( scanf ("%d,%d,%d",&x ,&y ,&size ) != EOF)
| ^~~~~
a.cc:26:1: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:2: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:3: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:4: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:5: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:6: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:7: error: expected primary-expression before '?' token
26 | ????????int max=0,voi=0;
| ^
a.cc:26:8: error: expected primary-expression before '?' token
|
s577601358
|
p00026
|
C++
|
#include<iostream>
int main(){
int paper[10][10],x,y,a,max=0;
std::string s;
for(x=0; x<10; x++)
for(y=0; y<10; y++)
paper[x][y]=0;
while(std::cin>>s){
x=s.at(0)-'0';
y=s.at(2)-'0';
a=s.at(4)-'0';
paper[x][y]++;
if(x>0) paper[x-1][y]++;
if(x<9) paper[x+1][y]++;
if(y>0) paper[x][y-1]++;
if(y<9) paper[x][y+1]++;
if(a>1){
if(x>0&&y>0) paper[x-1][y-1]++;
if(x<9&&y>0) paper[x+1][y-1]++;
if(x>0&&y<9) paper[x-1][y+1]++;
if(x<9&&y<9) paper[x+1][y+1]++;
}
if(a>2){
if(x>1)paper[x-2][y]++;
if(y>1)paper[x][y-2]++;
if(x<8)paper[x+2][y]++;
if(y<8)paper[x][y+2]++;
}
}
for(x=0,a=0;x<10;x++)
for(y=0;y<10;y++){
paper[x][y]==0 ? a++:,
paper[x][y]>max ? max=paper[x][y]:;
}
std::cout<<a<<"\n"<<max<<"\n";
}
|
a.cc: In function 'int main()':
a.cc:35:28: error: expected primary-expression before ',' token
35 | paper[x][y]==0 ? a++:,
| ^
a.cc:36:41: error: expected primary-expression before ';' token
36 | paper[x][y]>max ? max=paper[x][y]:;
| ^
|
s049881372
|
p00026
|
C++
|
#include <stdio.h>
#define TIMES 6
/* http://rose.u-aizu.ac.jp/onlinejudge/ProblemSet/description.jsp?id=0026&lang=jp */
int main(void)
{
int paper[10][10] = {0} ;
int blank = 0;
int maxdk = 0;
int x = 0 ;
int y = 0 ;
int size = 0 ;
for ( ; i < TIMES ; i++ ){
scanf("%d",&x) ;
scanf(",%d",&y) ;
scanf(",%d",&size) ;
if(size >= 1){
if (x+1<10)
paper[x+1][y]++;
if (x-1>=0)
paper[x-1][y]++;
if (y+1<10)
paper[x][y+1]++;
if (y-1>=0)
paper[x][y-1]++;
}
if(size >= 2){
if (x+1<10 && y+1<10)
paper[x+1][y+1]++;
if (x-1>=0 && y+1<10)
paper[x-1][y+1]++;
if (x-1>=0 && y-1>=0)
paper[x-1][y-1]++;
if (x+1<10 && y-1>=0)
paper[x+1][y-1]++;
}
if(size >= 3){
if (x+2<10)
paper[x+2][y]++;
if (x-2>=0)
paper[x-2][y]++;
if (y+2<10)
paper[x][y+2]++;
if (y-2>=0)
paper[x][y-2]++;
}
/* printf("%d,",x); printf("%d,",y); printf("%d\n",size); */
}
for( y = 0 ; y < 10 ; y++ ){
for( x = 0 ; x < 10 ; x++ ){
if(paper[x][y] == 0)
blank++;
if(paper[x][y] > maxdk)
maxdk = paper[x][y] ;
}
}
printf("----------------\n");
printf("BLANK:%d\n",blank);
printf("MAX:%d\n",maxdk);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:17: error: 'i' was not declared in this scope
15 | for ( ; i < TIMES ; i++ ){
| ^
|
s266773777
|
p00026
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
int paper[10][10];
const int dx[] = {0,0,1,-1};
const int dy[] = {1,-1,0,0};
const int diax[] = {1,1,-1,-1};
const int diay[] = {-1,1,1,-1};
void dai(int x, int y){
REP(z,1,3)rep(k,4){
int tx = x+dx[k]*z , ty = y+dy[k]*z;
if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
paper[ty][tx]++;
}
rep(k,4){
int tx = x+diax[k] , ty = y+diay[k];
if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
paper[ty][tx]++;
}
}
void chuu(int x, int y){
rep(k,4){
int tx = x+dx[k] , ty = y+dy[k];
if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
paper[ty][tx]++;
}
rep(k,4){
int tx = x+diax[k] , ty = y+diay[k];
if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
paper[ty][tx]++;
}
}
void shou(int x, int y){
rep(k,4){
int tx = x+dx[k] , ty = y+dy[k];
if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
paper[ty][tx]++;
}
}
int main(){
int x,y,sz;
memset(paper,0,sizeof(paper));
while(~scanf("%d,%d,%d",&x,&y,&sz)){
if( sz==3 ) dai(x,y);
else if( sz==2 ) chuu(x,y);
else shou(x,y);
}
int nasi = 0, ari = 0;
rep(i,10)rep(j,10){
if( paper[i][j]==0 )nasi++;
else{
ari = max(ari,paper[i][j]);
}
}
printf("%d\n%d\n",nasi,ari);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:50:9: error: 'memset' was not declared in this scope
50 | memset(paper,0,sizeof(paper));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <vector>
+++ |+#include <cstring>
5 | using namespace std;
|
s738100105
|
p00026
|
C++
|
#include <iostream>
using namespace std;
int main(){
int x,y,size;
int canvas[10][10];
int empty_num, max_val;
int i, j;
for(i=0; i<10; i++)
for(j=0; j<10; j++) canvas[i][j]=0;
while(cin>>x){
cin>>y; cin>>size;
for(i=-1; i<=1; i=i+2)
if(x+i>=0 && x+i<10) canvas[x+i][y]++;
for(i=-1; i<=1; i=i+2)
if(y+i>=0 && y+i<10) canvas[x][y+i]++;
if(size>1){
for(i=-1; i<=1; i=i+2){
for(j=-1; j<=1; j=j+2)
if(x+i>=0 && x+i<10 && y+j>=0 && y+j<10) canvas[x+i][y+j]++;
}
}
if(size>2){
for(i=-2; i<=2; i=i+4)
if(x+i>=0 && x+i<10) canvas[x+i][y]++;
for(i=-2; i<=2; i=i+4)
if(y+i>=0 && y+i<10) canvas[x][y+i]++;
}
}
empty_num=0; max_val=0;
for(i=0; i<10; i++){
for(j=0; j<10; j++){
if(canvas[i][j]>max_val) max_val=canvas[i][j];
else if(canvas[i][j]==0) empty_num++;
}
}
printf("%d\n%d\n", empty_num, max_val);
}
return 0;
}
|
a.cc:43:3: error: expected unqualified-id before 'return'
43 | return 0;
| ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
44 | }
| ^
|
s123655217
|
p00026
|
C++
|
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
int x,y,size,m[14][14]={0},max=0,none=0;
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF{
if(size>=1){
m[x+2][y+2]++;
m[x+2][y+1]++;
m[x+2][y+3]++;
m[x+1][y+2]++;
m[x+3][y+2]++;
}
if(size>=2){
m[x+1][y+1]++;
m[x+1][y+3]++;
m[x+3][y+1]++;
m[x+3][y+3]++;
}
if(size==3){
m[x+2][y]++;
m[x+2][y+4]++;
m[x][y+2]++;
m[x+4][y+2]++;
}
for(y=0;y<14;y++){
for(x=0;x<14;x++){
cout<<m[x][y];
(x==13)?cout<<endl:cout<<" ";
}
}
}
for(y=0;y<10;y++){
for(x=0;x<10;x++){
if(m[x+2][y+2]>max)max=m[x+2][y+2];
if(!m[x+2][y+2])none++;
}
}
cout<<none<<endl<<max<<endl;
}
|
a.cc: In function 'int main()':
a.cc:12:43: error: expected ')' before '{' token
12 | while(scanf("%d,%d,%d",&x,&y,&size)!=EOF{
| ~ ^
|
s215661540
|
p00026
|
C++
|
void dfs1(int x, int y) {
field[y][x] += 1;
for(int dx = -1 ; dx <= 1 ; dx++) {
int nx = x + dx;
if(0 <= nx && nx < 10 && nx != x) field[y][nx] += 1;
}
for(int dy = -1 ; dy <= 1 ; dy++) {
int ny = y + dy;
if(0 <= ny && ny < 10 && ny != y) field[ny][x] += 1;
}
}
void dfs2(int x, int y) {
field[y][x] += 1;
if(y+1 < 10) field[y+1][x] += 1;
if(y-1 >= 0) field[y-1][x] += 1;
if(x+1 < 10) field[y][x+1] += 1;
if(x-1 >= 0) field[y][x-1] += 1;
for(int dx = -1 ; dx <= 1 ; dx++) {
for(int dy = -1 ; dy <= 1 ; dy++) {
int nx = x + dx, ny = y + dy;
if(0 <= nx && nx < 10 && 0 <= ny && ny < 10 && nx != x && ny != y) field[ny][nx] += 1;
}
}
}
void dfs3(int x, int y) {
field[y][x] += 1;
if(y+2 < 10) field[y+2][x] += 1;
if(y-2 >= 0) field[y-2][x] += 1;
if(x+2 < 10) field[y][x+2] += 1;
if(x-2 >= 0) field[y][x-2] += 1;
if(y+1 < 10) field[y+1][x] += 1;
if(y-1 >= 0) field[y-1][x] += 1;
if(x+1 < 10) field[y][x+1] += 1;
if(x-1 >= 0) field[y][x-1] += 1;
for(int dx = -1 ; dx <= 1 ; dx++) {
for(int dy = -1 ; dy <= 1 ; dy++) {
int nx = x + dx, ny = y + dy;
if(0 <= nx && nx < 10 && 0 <= ny && ny < 10 && nx != x && ny != y) field[ny][nx] += 1;
}
}
}
int main(void) {
int x, y, size;
char c1, c2;
int max=0;
int white=0;
while(cin >> x >> c1 >> y >> c2 >> size) {
if(size == 1) dfs1(x, y);
if(size == 2) dfs2(x, y);
if(size == 3) dfs3(x, y);
}
/*for(int i = 0 ; i < 10 ; i++) {
for(int j = 0 ; j < 10 ; j++) {
cout << field[i][j] << ' ';
}
cout << endl;
}*/
for(int i = 0 ; i < 10 ; i++) {
for(int j = 0 ; j < 10 ; j++) {
if(field[i][j] > max) max = field[i][j];
if(field[i][j] == 0) white++;
}
}
cout << white << endl;
cout << max << endl;
return 0;
}
|
a.cc: In function 'void dfs1(int, int)':
a.cc:2:3: error: 'field' was not declared in this scope; did you mean 'friend'?
2 | field[y][x] += 1;
| ^~~~~
| friend
a.cc: In function 'void dfs2(int, int)':
a.cc:14:3: error: 'field' was not declared in this scope; did you mean 'friend'?
14 | field[y][x] += 1;
| ^~~~~
| friend
a.cc: In function 'void dfs3(int, int)':
a.cc:28:3: error: 'field' was not declared in this scope; did you mean 'friend'?
28 | field[y][x] += 1;
| ^~~~~
| friend
a.cc: In function 'int main()':
a.cc:50:9: error: 'cin' was not declared in this scope
50 | while(cin >> x >> c1 >> y >> c2 >> size) {
| ^~~
a.cc:63:10: error: 'field' was not declared in this scope; did you mean 'friend'?
63 | if(field[i][j] > max) max = field[i][j];
| ^~~~~
| friend
a.cc:64:10: error: 'field' was not declared in this scope; did you mean 'friend'?
64 | if(field[i][j] == 0) white++;
| ^~~~~
| friend
a.cc:67:3: error: 'cout' was not declared in this scope
67 | cout << white << endl;
| ^~~~
a.cc:67:20: error: 'endl' was not declared in this scope
67 | cout << white << endl;
| ^~~~
|
s482485397
|
p00026
|
C++
|
#include <iostream>
using namespace std;
int small_x[4] = {-1, 0, 0, 1};
int small_y[4] = { 0, -1, 1, 0};
int medium_x[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int medium_y[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int large_x[12] = {-2, -1, -1, -1, 0, 0, 0, 0, 1, 1, 1, 2};
int large_y[12] = { 0, -1, 0, 1, -2, -1, 1, 2, -1, 0, 1, 0};
void solve()
{
int Field[14][14];
memset(Field, 0, sizeof(Field));
int a, b, c;
while(scanf("%d,%d,%d", &a, &b, &c))
{
++Field[b + 2][a + 2];
if(c == 1)
{
for(int i = 0; i < 4; ++i)
{
++Field[b + 2 + small_y[i]][a + 2 + small_x[i]];
}
}
else if(c == 2)
{
for(int i = 0; i < 8; ++i)
{
++Field[b + 2 + medium_y[i]][a + 2 + medium_x[i]];
}
}
else if(c == 3)
{
for(int i = 0; i < 12; ++i)
{
++Field[b + 2 + large_y[i]][a + 2 + large_x[i]];
}
}
}
int count = 0;
int Max = 0;
for(int i = 2; i < 12; ++i)
{
for(int j = 2; j < 12; ++j)
{
if(Field[i][j] == 0)
{
++count;
}
if(Max < Field[i][j])
{
Max = Field[i][j];
}
}
}
cout << count << endl;
cout << Max << endl;
}
int main()
{
solve();
return(0);
}
|
a.cc: In function 'void solve()':
a.cc:17:9: error: 'memset' was not declared in this scope
17 | memset(Field, 0, sizeof(Field));
| ^~~~~~
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 |
|
s218770374
|
p00026
|
C++
|
import java.util.Scanner;
public class Main {
static int max = 0;
static int count = 100;
static int[][] p = new int[10][10];
public static void main(String[] args) {
Scanner in = new Scanner(System.in)
.useDelimiter("[^0-9]+");
max = 0;
count = 100;
for (int i = 0; i < p.length; i++) {
for (int j = 0; j < p[i].length; j++) {
p[i][j] = 0;
}
}
while (in.hasNextLine()) {
ink(in.nextInt(), in.nextInt(), in.nextInt());
}
System.out.println(count);
System.out.println(max);
}
static void ink(int x, int y, final int size) {
if (size >= 3) {
pi(x + 2, y);
pi(x - 2, y);
pi(x, y + 2);
pi(x, y - 2);
}
if (size >= 2) {
pi(x + 1, y + 1);
pi(x + 1, y - 1);
pi(x - 1, y + 1);
pi(x - 1, y - 1);
}
if (size >= 1) {
pi(x + 1, y);
pi(x - 1, y);
pi(x, y + 1);
pi(x, y - 1);
}
pi(x, y);
}
static void pi(int x, int y) {
if (0 <= x && x < 10 && 0 <= y && y < 10) {
if (p[x][y] == 0) {
count--;
}
p[x][y]++;
max = Math.max(max, p[x][y]);
}
}
}
|
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main {
| ^~~~~~
|
s510129594
|
p00026
|
C++
|
import java.util.Scanner;
public class Main {
static int max = 0;
static int count = 100;
static int[][] p = new int[10][10];
public static void main(String[] args) {
Scanner in = new Scanner(System.in)
.useDelimiter("[^0-9]+");
max = 0;
count = 100;
for (int i = 0; i < p.length; i++) {
for (int j = 0; j < p[i].length; j++) {
p[i][j] = 0;
}
}
while (in.hasNextLine()) {
ink(in.nextInt(), in.nextInt(), in.nextInt());
}
System.out.println(count);
System.out.println(max);
}
static void ink(int x, int y, final int size) {
if (size >= 3) {
pi(x + 2, y);
pi(x - 2, y);
pi(x, y + 2);
pi(x, y - 2);
}
if (size >= 2) {
pi(x + 1, y + 1);
pi(x + 1, y - 1);
pi(x - 1, y + 1);
pi(x - 1, y - 1);
}
if (size >= 1) {
pi(x + 1, y);
pi(x - 1, y);
pi(x, y + 1);
pi(x, y - 1);
}
pi(x, y);
}
static void pi(int x, int y) {
if (0 <= x && x < 10 && 0 <= y && y < 10) {
if (p[x][y] == 0) {
count--;
}
p[x][y]++;
max = Math.max(max, p[x][y]);
}
}
}
|
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:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s727142290
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[10][10];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=0;i<10;i++){
for(j=0;j<10;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)==3){
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:56:30: error: expected primary-expression before ',' token
56 | printf("%d\n%d\n",not,da);
| ^
|
s578070159
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[10][10];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=0;i<10;i++){
for(j=0;j<10;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:56:30: error: expected primary-expression before ',' token
56 | printf("%d\n%d\n",not,da);
| ^
|
s428200674
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(){
int pa[10][10];
int i,j; //ループカウンタ
int x,y,size,da=0,not=-1;
//二次元配列の初期化
for(i=0;i<10;i++){
for(j=0;j<10;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=-1;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:56:30: error: expected primary-expression before ',' token
56 | printf("%d\n%d\n",not,da);
| ^
|
s027659582
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[10][10];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=0;i<10;i++){
for(j=0;j<10;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=-1){
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:56:30: error: expected primary-expression before ',' token
56 | printf("%d\n%d\n",not,da);
| ^
|
s604400089
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[14][14];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=2;i<12;i++){
for(j=2;j<12;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:56:30: error: expected primary-expression before ',' token
56 | printf("%d\n%d\n",not,da);
| ^
|
s902410143
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[14][14];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=2;i<12;i++){
for(j=2;j<12;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
x=x+2;
y=y+2;
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:49:38: error: expected primary-expression before ';' token
49 | not++;
| ^
a.cc:58:30: error: expected primary-expression before ',' token
58 | printf("%d\n%d\n",not,da);
| ^
|
s733258420
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[14][14];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
x=x+2;
y=y+2;
switch(size){
case 1: //小
pa[x][y]++;
pa[x-1][y]++;
pa[x+1][y]++;
pa[x][y-1]++;
pa[x][y+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[x+i][y+j]++;
}
pa[x-2][y]++;
pa[x+2][y]++;
pa[x][y-2]++;
pa[x][y+2]++;
break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:49:38: error: expected primary-expression before ';' token
49 | not++;
| ^
a.cc:58:30: error: expected primary-expression before ',' token
58 | printf("%d\n%d\n",not,da);
| ^
|
s585134629
|
p00026
|
C++
|
//インクを落とす
#include<cstdio>
using namespace std;
int main(void){
int pa[14][14];
int i,j; //ループカウンタ
int x,y,size,da=0,not=0;
//二次元配列の初期化
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
x=x+2;
y=y+2;
switch(size){
case 1: //小
pa[y][x]++;
pa[y-1][x]++;
pa[y+1][x]++;
pa[y][x-1]++;
pa[y][x+1]++;
break;
case 2: //中
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
break;
case 3: //大
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
pa[y-2][x]++;
pa[y+2][x]++;
pa[y][x-2]++;
pa[y][x+2]++;
break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:27: error: expected unqualified-id before 'not' token
9 | int x,y,size,da=0,not=0;
| ^~~
a.cc:49:38: error: expected primary-expression before ';' token
49 | not++;
| ^
a.cc:58:30: error: expected primary-expression before ',' token
58 | printf("%d\n%d\n",not,da);
| ^
|
s717032406
|
p00026
|
C++
|
#include<cstdio>
using namespace std;
int main(void){
int pa[14][14];
int i,j;
int x,y,size,da=0,not=0;
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
x=x+2;
y=y+2;
switch(size){
case 1:
pa[y][x]++;
pa[y-1][x]++;
pa[y+1][x]++;
pa[y][x-1]++;
pa[y][x+1]++;
break;
case 2:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
break;
case 3:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
pa[y-2][x]++;
pa[y+2][x]++;
pa[y][x-2]++;
pa[y][x+2]++;
break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:27: error: expected unqualified-id before 'not' token
8 | int x,y,size,da=0,not=0;
| ^~~
a.cc:47:38: error: expected primary-expression before ';' token
47 | not++;
| ^
a.cc:52:30: error: expected primary-expression before ',' token
52 | printf("%d\n%d\n",not,da);
| ^
|
s940307587
|
p00026
|
C++
|
#include<cstdio>
using namespace std;
int main(){
int pa[14][14];
int i,j;
int x,y,size;
int da=0,not=0;
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&s)!=-1){
x=x+2;
y=y+2;
switch(size){
case 1:
pa[y][x]++;
pa[y-1][x]++;
pa[y+1][x]++;
pa[y][x-1]++;
pa[y][x+1]++;
break;
case 2:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
break;
case 3:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++)
pa[y+i][x+j]++;
}
pa[y-2][x]++;
pa[y+2][x]++;
pa[y][x-2]++;
pa[y][x+2]++;
break;
default: break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0)
not++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da)
da=pa[i][j];
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: expected unqualified-id before 'not' token
9 | int da=0,not=0;
| ^~~
a.cc:16:32: error: 's' was not declared in this scope
16 | while(scanf("%d,%d,%d",&x,&y,&s)!=-1){
| ^
a.cc:49:10: error: expected primary-expression before ';' token
49 | not++;
| ^
a.cc:58:23: error: expected primary-expression before ',' token
58 | printf("%d\n%d\n",not,da);
| ^
|
s028062856
|
p00026
|
C++
|
#include<cstdio>
using namespace std;
int main(){
int pa[14][14];
int i,j;
int x,y,size;
int da=0,not=0;
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=-1){
x=x+2;
y=y+2;
switch(size){
case 1:
pa[y][x]++;
pa[y-1][x]++;
pa[y+1][x]++;
pa[y][x-1]++;
pa[y][x+1]++;
break;
case 2:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++){
pa[y+i][x+j]++;
}
}
break;
case 3:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++){
pa[y+i][x+j]++;
}
}
pa[y-2][x]++;
pa[y+2][x]++;
pa[y][x-2]++;
pa[y][x+2]++;
break;
default: break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0){
not++;
}
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da){
da=pa[i][j];
}
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: expected unqualified-id before 'not' token
9 | int da=0,not=0;
| ^~~
a.cc:51:10: error: expected primary-expression before ';' token
51 | not++;
| ^
a.cc:62:23: error: expected primary-expression before ',' token
62 | printf("%d\n%d\n",not,da);
| ^
|
s145142627
|
p00026
|
C++
|
#include<cstdio>
using namespace std;
int main(){
int pa[14][14];
int i,j;
int x,y,size;
int da;
int not;
da=not=0;
for(i=0;i<14;i++){
for(j=0;j<14;j++)
pa[i][j]=0;
}
while(scanf("%d,%d,%d",&x,&y,&size)!=-1){
x=x+2;
y=y+2;
switch(size){
case 1:
pa[y][x]++;
pa[y-1][x]++;
pa[y+1][x]++;
pa[y][x-1]++;
pa[y][x+1]++;
break;
case 2:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++){
pa[y+i][x+j]++;
}
}
break;
case 3:
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++){
pa[y+i][x+j]++;
}
}
pa[y-2][x]++;
pa[y+2][x]++;
pa[y][x-2]++;
pa[y][x+2]++;
break;
default:break;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]==0){
not++;
}
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(pa[i][j]>da){
da=pa[i][j];
}
}
}
printf("%d\n%d\n",not,da);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: expected unqualified-id before 'not' token
10 | int not;
| ^~~
a.cc:11:8: error: expected primary-expression before '=' token
11 | da=not=0;
| ^
a.cc:52:10: error: expected primary-expression before ';' token
52 | not++;
| ^
a.cc:63:23: error: expected primary-expression before ',' token
63 | printf("%d\n%d\n",not,da);
| ^
|
s368000238
|
p00026
|
C++
|
#include<iostream>
using namespace std;
int main(){
int grid[14][14];
int s[4][2]={{0,-1},{0,1},{-1,0},{1,0}};
int m[4][2]={{-1,-1},{-1,1},{1,-1},{1,1}};
int l[4][2]={{0,-2},{0,2},{-2,0},{2,0}};
int x, y, size;
int i, j;
int max=0;
int blank;
char comma;
for(i=0;i<14;i++){
for(j=0;j<14;j++){
grid[i][j] = 0;
}
}
while(cin >> x >> comma >> y >> comma >> size){
x += 2;
y += 2;
grid[x][y] += 1;
for(i=0;i<4;i++){
grid[x+s[0]][y+s[1]] += 1;
}
if(size > 1){
for(i=0;i<4;i++){
grid[x+m[0]][y+m[1]] += 1;
}
if(size > 2){
for(i=0;i<4;i++){
grid[x+l[0]][y+l[1]] += 1;
}
}
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(grid[i][j] > max){
max = grid[i][j];
}else if(grid[i][j] = 0){
blank += 1;
}
}
}
cout << blank << endl;
cout << max << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:17: error: invalid types 'int [14][14][int*]' for array subscript
24 | grid[x+s[0]][y+s[1]] += 1;
| ^
a.cc:28:21: error: invalid types 'int [14][14][int*]' for array subscript
28 | grid[x+m[0]][y+m[1]] += 1;
| ^
a.cc:32:25: error: invalid types 'int [14][14][int*]' for array subscript
32 | grid[x+l[0]][y+l[1]] += 1;
| ^
|
s199820758
|
p00026
|
C++
|
#include<iostream>
#include<vector>
#include <algorithm>
#include<stdio.h>
int main(){
std::vector<std::vector<int>> vec(10,std::vector<int>(10,0));
while(1){
int x,y,size;
scanf("%d,%d,%d",&x,&y,&size);
//std::cin>>x>>y>>size;
if(scanf.eof())break;
//if(x==0&&y==0&&size==0)break;
vec[y][x]++;
vec[y-1][x]++;
vec[y+1][x]++;
vec[y][x-1]++;
vec[y][x+1]++;
if(size>=2){
vec[y-1][x-1]++;
vec[y-1][x+1]++;
vec[y+1][x-1]++;
vec[y+1][x+1]++;
}
if(size==3){
vec[y-2][x]++;
vec[y+2][x]++;
vec[y][x-2]++;
vec[y][x+2]++;
}
}
std::vector<int> vec2(100);
for(int i=0;i<10;i++){
for(int j=0;j<10;j++)vec2[i*10+j]=vec[i][j];
}
int no=0;
for(int i=0;i<100;i++){
if(vec2[i]==0)no++;
}
std::cout<<no<<std::endl;
sort(vec2.begin(),vec2.end(),std::greater<int>());
std::cout<<vec2[0]<<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:26: error: request for member 'eof' in 'scanf', which is of non-class type 'int(const char*, ...)'
11 | if(scanf.eof())break;
| ^~~
|
s284051947
|
p00026
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdio.h>
int main(){
int x,y,size;
std::vector<std::vector<int> > vec(10,std::vector<int>(10,0));
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
vec[y][x]++;
vec[y-1][x]++;
vec[y+1][x]++;
vec[y][x-1]++;
vec[y][x+1]++;
if(size>=2){
vec[y-1][x-1]++;
vec[y-1][x+1]++;
vec[y+1][x-1]++;
vec[y+1][x+1]++;
}
if(size==3){
vec[y-2][x]++;
vec[y+2][x]++;
vec[y][x-2]++;
vec[y][x+2]++;
}
}
std::vector<int> vec2(100);
for(int i=0;i<10;i++){
for(int j=0;j<10;j++)vec2[i*10+j]=vec[i][j];
}
int no=0,max=0;
for(int i=0;i<100;i++){
if(vec2[i]==0)no++;
if(max<vec[i])max=vec[i];
}
std::cout<<no<<std::endl;
std::cout<<max<<std::endl;
/*sort(vec2.begin(),vec2.end(),std::greater<int>());
std::cout<<vec2[0]<<std::endl;*/
return 0;
}
|
a.cc: In function 'int main()':
a.cc:34:23: error: no match for 'operator<' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
34 | if(max<vec[i])max=vec[i];
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: 'std::vector<int>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const _CharT*' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:34:29: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
34 | if(max<vec[i])max=vec[i];
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'int' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'int' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:34:40: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
34 | if(max<vec[i])max=vec[i];
| ^
|
s078105425
|
p00026
|
C++
|
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>
#include <cassert>
using namespace std;
bool solve(){
int dx1[] = {0, 1, 0, -1, 0};
int dy1[] = {0, 0, 1, 0, -1};
int dx2[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dy2[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dx3[] = {0, 0, 0, 0, 0, 1, 1, 1, 2, -1, -1, -1, -2};
int dy3[] = {-2, -1, 0, 1, 2, -1, 0, 1, 0, -1, 0, 1, 0};
int a[14][14] = {0};
int x, y, size;
char c[2];
while(cin>>x){
cin>> c[0]>> y>> c[1]>> size;
x += 2;
y += 2;
switch(size){
case 1:
for(int i=0;i<5;i++){
a[x+dx1[i]][y+dy1[i]]++;
}
break;
case 2:
for(int i=0;i<9;i++){
a[x+dx2[i]][y+dy2[i]]++;
}
break;
case 3:
for(int i=0;i<13;i++){
a[x+dx3[i]][y+dy3[i]]++;
}
break;
default:
cout<< "default"<< endl;
break;
}
}
int ans = 0;
int ans2 = 0;
for(int i=2;i<12;i++){
for(int j=2;j<12;j++){
if(a[i][j] == 0) ans++;
ans2 = max(ans2, a[i][j]);
}
}
cout<< ans<< endl
cout<< ans2<< endl;
return true;
}
int main(){
cout.setf(ios::fixed);
cout.precision(10);
solve();
return 0;
}
|
a.cc: In function 'bool solve()':
a.cc:61:26: error: expected ';' before 'cout'
61 | cout<< ans<< endl
| ^
| ;
62 | cout<< ans2<< endl;
| ~~~~
|
s432150828
|
p00026
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
//4方向ベクトル→↑←↓
const int px[4] ={1,0,-1,0};
const int py[4] ={0,-1,0,1};
int board[15][15];
int x,y,size;
int ans1,ans2;
int main()
{
ans1 = 0;
for(int i = 0;i <10;i++){
for(int j = 0;j < 10;j++){
board[i][j] = 0;
}
}
while(scanf("%d,%d,%d",&x,&y,&size) !=EOF){
if(x <0||y < 0||x >10 ||y >10){
continue;
}
if(size ==1){
board[y][x] +=1;
for(int j = 0;j < 4;j++){
int nx = x + px[j];
int ny = y + py[j];
if(nx <0 ||ny < 0||nx > 10||ny >10)
continue;
board[ny][nx] = 1;
}
}else if(size ==2){
for(int i = -1;i <=1;i++){
for(int j = -1;j <=1;j++){
int nx = x +j;
int ny = y +i;
if(nx <0 ||nx >=10||ny <0||ny >=10)
continue;
board[ny][nx] +=1;
}
}
}else if(size ==3){
for(int i = -2;i <=2;i++){
for(int j = -2;j <=2;j++){
if(i == -2&&j ==0){
board[y+i][x] +=1;
}else if(i == -1&&(j !=-2&&j !=2)){
board[y+i][x+j] +=1;
}else if(i == 0){
board[y+i][x+j] +=1;
}else if(i == 1&&(j !=-2&&j !=2)){
board[y+i][x+j] +=1;
}else if(i ==2&&j ==0){
board[y+i][x] +=1;
}
}
}
}
}
ans2 = 0;
for(int i = 0;i <10;i++){
for(int j = 0;j < 10;j++){
if(board[i][j] == 0){
ans1++;
}
if(board[i][j] > ans2){
ans2 = board[i][j];
}
}
}
for(int i = 0;i < 10;i++){
for(int j = 0;j < 10;j++){
cout <<board[i][j];
}
cout <<endl;
}
cout <<ans1<<endl;
cout <<ans2<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: reference to 'size' is ambiguous
21 | while(scanf("%d,%d,%d",&x,&y,&size) !=EOF){
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:11:9: note: 'int size'
11 | int x,y,size;
| ^~~~
a.cc:25:8: error: reference to 'size' is ambiguous
25 | if(size ==1){
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:11:9: note: 'int size'
11 | int x,y,size;
| ^~~~
a.cc:34:14: error: reference to 'size' is ambiguous
34 | }else if(size ==2){
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:11:9: note: 'int size'
11 | int x,y,size;
| ^~~~
a.cc:44:14: error: reference to 'size' is ambiguous
44 | }else if(size ==3){
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:11:9: note: 'int size'
11 | int x,y,size;
| ^~~~
|
s153983150
|
p00026
|
C++
|
#include<iostream>
using namespace std ;
int map[10][10]={};
int sx[] = { 0,-1,1,0 } , sy[] = { -1,0,0,1 } ;
int mx[] = { -1,0,1 }, my[] = { -1,0,1 } ;
int lx[] = { 0,-1,0,1,-2,-1,1,2,-1,0,1,0 } ;
int ly[] = { -2,-1,-1,-1,0,0,0,0,1,1,1,2 } ;
int main(){
int x,y,size ;
char temp;
int enpty=0,max=0;
while(1){
cin >> x ;
if( cin.eof() ) break;
cin >> temp >> y ;
cin >> temp >> size ;
map[x][y]++;
if( size==1 ){
for( int i=0 ; i<4 ; i++ ){
if( x+sx[i]>=0 && x+sx[i]<=9 && y+sy[i]>=0 && y+sy[i]<=9 )
map[x+sx[i]][y+sy[i]]++;
}
}
else if( size==2 ){
for( int i=0 ; i<9 ; i++ ){
if( x+mx[i%3]>=0 && x+mx[i%3]<=9 && y+my[i/3]>=0 && y+my[i/3]<=9 )
map[x+mx[i%3]][y+my[i/3]]++;
}
}
else if( size==3 ){
for( int i=0 ; i<12 ; i++ ){
if( x+lx[i]>=0 && x+lx[i]<=9 && y+ly[i]>=0 && y+ly[i]<=9 )
map[x+sx[i]][y+sy[i]]++;
}
}
}
for( int i=0 ; i<10 ; i++ ){
for( int j=0 ; j<10 ; j++ ){
if( map[i][j]==0 ) empty++;
if( map[i][j]>max ) max=map[i][j] ;
}
}
cout << empty << endl ;
cout << max << endl ;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:46:49: error: no post-increment operator for type
46 | if( map[i][j]==0 ) empty++;
| ^~
a.cc:51:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
51 | cout << empty << endl ;
| ~~~~~^~~~~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
|
|
s266227311
|
p00026
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a[10][10]={},x,y,size,dumy,max=0,ans=0;
int mx[12]={0,-1,1,0,-1,1,-1,1,0,-2,2,0},my[12]={-1,0,0,1,-1,-1,1,1,-2,0,0,2};
while(cin>>x>>y>>size!=EOF){
dumy=4*size;
for(int i=0;i<dumy;i++){
if(x+mx[i]>=0&&y+my[i]>=0)
a[x+mx[i]][y+my[i]]++;
}
}
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(a[i][j]==0){
ans++;
}else{
if(max<=a[i][j])
max=a[i][j];
}
}
}
cout<<ans<<endl<<max<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:30: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
6 | while(cin>>x>>y>>size!=EOF){
| ~~~~~~~~~~~~~~~^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:6:30: note: candidate: 'operator!=(int, int)' (built-in)
6 | while(cin>>x>>y>>size!=EOF){
| ^
a.cc:6:30: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
6 | while(cin>>x>>y>>size!=EOF){
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2613 | operator!=(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed:
a.cc:6:32: note: 'std::basic_istream<char>::__istream_type' {aka 'std::b
|
s918736892
|
p00026
|
C++
|
#include<iostream>
#define DROP(x,y) if(x>=0&&y>=0&&x<10&&y<10)++cloth[x][y]
using namespace std;
int main(){
int x, y, size;
int cloth[10][10];
int count, max;
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
cloth[i][j] = 0;
while (scanf_s("%d,%d,%d", &x, &y, &size) + 1){
if (size == 1){
DROP(x, y);
DROP(x + 1, y);
DROP(x, y + 1);
DROP(x - 1, y);
DROP(x, y - 1);
}
else if (size == 2){
DROP(x, y);
DROP(x, y - 1);
DROP(x, y + 1);
DROP(x - 1, y - 1);
DROP(x - 1, y);
DROP(x - 1, y + 1);
DROP(x + 1, y - 1);
DROP(x + 1, y);
DROP(x + 1, y + 1);
}
else if (size == 3){
DROP(x, y);
DROP(x, y - 1);
DROP(x, y + 1);
DROP(x - 1, y - 1);
DROP(x - 1, y);
DROP(x - 1, y + 1);
DROP(x + 1, y - 1);
DROP(x + 1, y);
DROP(x + 1, y + 1);
DROP(x + 2, y);
DROP(x - 2, y);
DROP(x, y + 2);
DROP(x, y - 2);
}
}
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j){
if (cloth[i][j] == 0)++count;
if (cloth[i][j] > max)max = cloth[i][j];
}
cout << count << endl << max << endl;
}
|
a.cc: In function 'int main()':
a.cc:15:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
15 | while (scanf_s("%d,%d,%d", &x, &y, &size) + 1){
| ^~~~~~~
| scanf
|
s016043231
|
p00026
|
C++
|
#include<iostream>
#include<stdio.h>
#define DROP(x,y) if(x>=0&&y>=0&&x<10&&y<10)++cloth[x][y]
using namespace std;
int main(){
int x, y, size;
int cloth[10][10];
int count, max;
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
cloth[i][j] = 0;
while (scanf_s("%d,%d,%d", &x, &y, &size) + 1){
if (size == 1){
DROP(x, y);
DROP(x + 1, y);
DROP(x, y + 1);
DROP(x - 1, y);
DROP(x, y - 1);
}
else if (size == 2){
DROP(x, y);
DROP(x, y - 1);
DROP(x, y + 1);
DROP(x - 1, y - 1);
DROP(x - 1, y);
DROP(x - 1, y + 1);
DROP(x + 1, y - 1);
DROP(x + 1, y);
DROP(x + 1, y + 1);
}
else if (size == 3){
DROP(x, y);
DROP(x, y - 1);
DROP(x, y + 1);
DROP(x - 1, y - 1);
DROP(x - 1, y);
DROP(x - 1, y + 1);
DROP(x + 1, y - 1);
DROP(x + 1, y);
DROP(x + 1, y + 1);
DROP(x + 2, y);
DROP(x - 2, y);
DROP(x, y + 2);
DROP(x, y - 2);
}
}
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j){
if (cloth[i][j] == 0)++count;
if (cloth[i][j] > max)max = cloth[i][j];
}
cout << count << endl << max << endl;
}
|
a.cc: In function 'int main()':
a.cc:16:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | while (scanf_s("%d,%d,%d", &x, &y, &size) + 1){
| ^~~~~~~
| scanf
|
s029609560
|
p00026
|
C++
|
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a[10][10]={},x,y,size,dumy=0max=0,ans=0;
int mx[12]={0,-1,1,0,-1,1,-1,1,0,-2,2,0},my[12]={-1,0,0,1,-1,-1,1,1,-2,0,0,2};
while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
dumy=4*size;
//cout<<size<<endl;
for(int i=0;i<dumy;i++){
if(x+mx[i]>=0&&y+my[i]>=0)
a[x+mx[i]][y+my[i]]++;
}
}
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(a[i][j]==0){
ans++;
}else{
if(max<=a[i][j])
max=a[i][j];
}
}
}
cout<<ans<<endl<<max<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:40: error: unable to find numeric literal operator 'operator""max'
5 | int a[10][10]={},x,y,size,dumy=0max=0,ans=0;
| ^~~~
a.cc:18:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
18 | ans++;
| ^~~
| abs
a.cc:20:39: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<='
20 | if(max<=a[i][j])
| ~~~^~~~~~~~~
a.cc:21:43: error: overloaded function with no contextual type information
21 | max=a[i][j];
| ^
a.cc:25:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | cout<<ans<<endl<<max<<endl;
| ^~~
| abs
|
s559609681
|
p00026
|
C++
|
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int grid[14][14] = { 0 };
void small(int x, int y){
grid[x][y]++;
grid[x - 1][y]++;
grid[x + 1][y]++;
grid[x][y - 1]++;
grid[x][y + 1]++;
}
void medium(int x, int y){
small(x, y);
grid[x - 1][y - 1]++;
grid[x + 1][y - 1]++;
grid[x - 1][y + 1]++;
grid[x + 1][y + 1]++;
}
void large(int x, int y){
medium(x, y);
grid[x - 2][y]++;
grid[x + 2][y]++;
grid[x][y - 2]++;
grid[x][y + 2]++;
}
int main(){
int x, y, size;
while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
if (size == 1) small(x + 2, y + 2);
else if (size == 2) medium(x + 2, y + 2);
else if (size == 3) large(x + 2, y + 2);
}
int ans1 = 0;
int ans2 = 0;
for (int i = 2; i < 12; i++){
for (int j = 2; j < 12; j++){
if (grid[i][j] == 0)
ans1++;
else
ans2 = max(ans2, grid[i][j]);
}
}
printf("%d\n%d\n", ans1, ans2);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:36:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
36 | while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
| ^~~~~~~
| scanf
|
s432913988
|
p00026
|
C++
|
#include <iostream>
#include <algorithm>
#define MAX 30
using namespace std;
int main()
{
int p[MAX][MAX];
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
p[i][j] = 0;
}
}
int x, y, size;
while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
x += 10;
y += 10;
p[x][y]++;
p[x - 1][y]++;
p[x + 1][y]++;
p[x][y - 1]++;
p[x][y + 1]++;
if (size == 1){
continue;
}
p[x - 1][y - 1]++;
p[x - 1][y + 1]++;
p[x + 1][y - 1]++;
p[x + 1][y + 1]++;
if (size == 2){
continue;
}
p[x - 2][y]++;
p[x + 2][y]++;
p[x][y - 2]++;
p[x][y + 2]++;
}
int clean = 0, ink = 0;
for (int i = 10; i < 20; i++){
for (int j = 10; j < 20; j++){
if (p[i][j] == 0){
clean++;
}
ink = max(ink, p[i][j]);
}
}
cout << clean << endl;
cout << ink << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
| ^~~~~~~
| scanf
|
s222417482
|
p00026
|
C++
|
#include <iostream>
#include <algorithm>
#include <cstdio>
#define MAX 30
using namespace std;
int main()
{
int p[MAX][MAX];
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
p[i][j] = 0;
}
}
int x, y, size;
while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
x += 10;
y += 10;
p[x][y]++;
p[x - 1][y]++;
p[x + 1][y]++;
p[x][y - 1]++;
p[x][y + 1]++;
if (size == 1){
continue;
}
p[x - 1][y - 1]++;
p[x - 1][y + 1]++;
p[x + 1][y - 1]++;
p[x + 1][y + 1]++;
if (size == 2){
continue;
}
p[x - 2][y]++;
p[x + 2][y]++;
p[x][y - 2]++;
p[x][y + 2]++;
}
int clean = 0, ink = 0;
for (int i = 10; i < 20; i++){
for (int j = 10; j < 20; j++){
if (p[i][j] == 0){
clean++;
}
ink = max(ink, p[i][j]);
}
}
cout << clean << endl;
cout << ink << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
17 | while (scanf_s("%d,%d,%d", &x, &y, &size) != EOF){
| ^~~~~~~
| scanf
|
s432466991
|
p00027
|
Java
|
import java.util.Scanner;
public class MyClass{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] w = {"Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"};
int[] d = {31,29,31,30,31,30,31,31,30,31,30,31};
int sum = 0;
while(true){
sum = 0;
int a = sc.nextInt();
int b = sc.nextInt();
if(a ==0 && b == 0){
break;
}
for(int i = 0;i < a-1; i++){
sum += d[i];
}
sum = sum + b;
System.out.println( w[sum % 7]);
}
}
}
|
Main.java:3: error: class MyClass is public, should be declared in a file named MyClass.java
public class MyClass{
^
1 error
|
s362499449
|
p00027
|
Java
|
import java.io.*;
import java.util.*;
public class Tmp{
public static void main(String[] args)throws IOException{
//BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
Scanner reader=new Scanner(System.in);
//int in=reader.nextInt();
int[] tmp={31,29,31,30,31,30,31,31,30,30,30,31};
String[] ans={"Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"};
int a,b;
while(true){
a=reader.nextInt();
b=reader.nextInt();
if(a==0&&b==0)break;
int h=1;
int co=0;
while(h!=a){
co+=tmp[h-1];
h++;
}
co+=b;
System.out.println(ans[co%7]);
}
}
}
|
Main.java:3: error: class Tmp is public, should be declared in a file named Tmp.java
public class Tmp{
^
1 error
|
s025788152
|
p00027
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
int mon = scan.nextInt();
int day = scan.nextInt();
if(mon == 0){
break;
}
int year = 2004;
Calendar cal = Calendar.getInstance();
cal.set(2004, mon - 1, day);
int week = cal.get(Calendar.DAY_OF_WEEK);
String s = "";
switch(week){
case Calendar.SUNDAY :
s = "Sunday";
break;
case Calendar.MONDAY :
s = "Monday";
break;
case Calendar.TUESDAY :
s = "Tuesday";
break;
case Calendar.WEDNESDAY :
s = "Wednesday";
break;
case Calendar.THURSDAY :
s = "Thursday";
break;
case Calendar.FRIDAY :
s = "Friday";
break;
case Calendar.SATURDAY :
s = "Saturday";
break;
default :
break;
}
System.out.printf("%s\n", s);
}
}
|
Main.java:46: error: reached end of file while parsing
}
^
1 error
|
s514726554
|
p00027
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
int year = 2004;
int mon = scan.nextInt();
int dat = scan.nextInt();
Calendar cal = Calendar.getInstance();
cal.set(2004, mon - 1, day);
int week = cal.get(Calendar.DAY_OF_WEEK);
String s = "";
switch(week){
case Calendar.SUNDAY :
s = "Sunday";
break;
case Calendar.MONDAY :
s = "Monday";
break;
case Calendar.TUESDAY :
s = "Tuesday";
break;
case Calendar.WEDNESDAY :
s = "Wednesday";
break;
case Calendar.THURSDAY :
s = "Thursday";
break;
case Calendar.FRIDAY :
s = "Friday";
break;
case Calender.SATURDAY :
s = "Saturday";
break;
default :
break;
}
System.out.printf("%s\n", s);
}
}
}
|
Main.java:13: error: cannot find symbol
cal.set(2004, mon - 1, day);
^
symbol: variable day
location: class Main
Main.java:35: error: package Calender does not exist
case Calender.SATURDAY :
^
2 errors
|
s761490291
|
p00027
|
Java
|
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;
string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
int m, d;
while(cin >> m >> d, m) {
int res = 0;
for(int i = 1; i < m; i++) {
res += day[i-1];
}
res += (d-1);
cout << days[res%7] << endl;
}
return 0;
}
|
Main.java:1: error: illegal character: '#'
#include <vector>
^
Main.java:2: error: illegal character: '#'
#include <list>
^
Main.java:3: error: illegal character: '#'
#include <map>
^
Main.java:4: error: illegal character: '#'
#include <set>
^
Main.java:5: error: illegal character: '#'
#include <stack>
^
Main.java:6: error: illegal character: '#'
#include <queue>
^
Main.java:7: error: illegal character: '#'
#include <deque>
^
Main.java:8: error: illegal character: '#'
#include <algorithm>
^
Main.java:9: error: illegal character: '#'
#include <utility>
^
Main.java:10: error: illegal character: '#'
#include <functional>
^
Main.java:11: error: illegal character: '#'
#include <sstream>
^
Main.java:12: error: illegal character: '#'
#include <iostream>
^
Main.java:13: error: illegal character: '#'
#include <cstdio>
^
Main.java:14: error: illegal character: '#'
#include <cmath>
^
Main.java:15: error: illegal character: '#'
#include <cstdlib>
^
Main.java:16: error: illegal character: '#'
#include <cctype>
^
Main.java:17: error: illegal character: '#'
#include <string>
^
Main.java:18: error: illegal character: '#'
#include <cstring>
^
Main.java:19: error: illegal character: '#'
#include <ctime>
^
Main.java:20: error: illegal character: '#'
#include <climits>
^
Main.java:21: error: illegal character: '#'
#include <cassert>
^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:23: error: unnamed classes are a preview feature and are disabled by default.
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
(use --enable-preview to enable unnamed classes)
Main.java:23: error: <identifier> expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:24: error: '{' expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
^
Main.java:24: error: illegal start of type
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
^
Main.java:25: error: class, interface, enum, or record expected
typedef vector<int> vi;
^
Main.java:26: error: class, interface, enum, or record expected
typedef vector<vi> vvi;
^
Main.java:27: error: class, interface, enum, or record expected
typedef vector<string> vs;
^
Main.java:28: error: class, interface, enum, or record expected
typedef pair<int, int> pii;
^
Main.java:29: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:30: error: illegal character: '#'
#define ALL(a) (a).begin(),(a).end()
^
Main.java:30: error: class, interface, enum, or record expected
#define ALL(a) (a).begin(),(a).end()
^
Main.java:31: error: illegal character: '#'
#define RALL(a) (a).rbegin(),(a).rend()
^
Main.java:32: error: illegal character: '#'
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
^
Main.java:32: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
^
Main.java:32: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
^
Main.java:33: error: illegal character: '#'
#define REP(i,n) FOR(i,0,(n)-1)
^
Main.java:35: error: class, interface, enum, or record expected
const double PI = acos(-1.0);
^
Main.java:36: error: class, interface, enum, or record expected
const int INF = INT_MAX/10;
^
Main.java:38: error: class, interface, enum, or record expected
string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
^
Main.java:39: error: class, interface, enum, or record expected
int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
^
Main.java:43: error: not a statement
while(cin >> m >> d, m) {
^
Main.java:50: error: not a statement
cout << days[res%7] << endl;
^
Main.java:43: error: ')' expected
while(cin >> m >> d, m) {
^
Main.java:43: error: ';' expected
while(cin >> m >> d, m) {
^
52 errors
|
s711404150
|
p00027
|
C
|
#include <stdio.h>
int main(void)
{
int date[12][31];
int d;
int i, j;
int day;
day = 5;
for (i = 0; i < 12; i++){
switch (i + 1){
case 1:
d = 31;
break;
case 3:
d = 31;
break;
case 5:
d = 31;
break;
case 7:
d = 31;
break;
case 8:
d = 31;
break;
case 10:
d = 31;
break;
case 12:
d = 31;
break;
case 4:
d = 30;
break;
case 6:
d = 30;
break;
case 9:
d = 30;
break;
case 11:
d = 30;
break;
case 2:
d = 29;
break;
}
for (j = 0; j < d; j++){
date[i][j] = day;
day++;
if (day > 7){
day = 1;
}
}
}
while (scanf("%d %d", &i, &j) i != 0 && j != 0){
switch (date[i - 1][j - 1]){
case 1:
printf("Sunday\n");
break;
case 2:
printf("Monday\n");
break;
case 3:
printf("Tuesday\n");
break;
case 4:
printf("Wednesday\n");
break;
case 5:
printf("Thursday\n");
break;
case 6:
printf("Friday\n");
break;
case 7:
printf("Saturday\n");
break;
}
}
return (0);
}
|
main.c: In function 'main':
main.c:69:38: error: expected ')' before 'i'
69 | while (scanf("%d %d", &i, &j) i != 0 && j != 0){
| ~ ^~
| )
|
s062491285
|
p00027
|
C
|
#include<stdio.h>
main(){
int mon[12],month,day,day2,i,j;
for(i=0;i<12;i++){
if(i==2){
mon[i]=29;
}
if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12){
mon[i]=31;
}
else{
mon[i]=30;
}
while(1){
scanf("%d %d",&month,&day);
if(month==0 && day==0){
break;
}
day2=0;
for(i=2;i<month+1;i++){
day2+=mon[i-2];
}
day2+=day;
day2%=7;
if(day2==1){
printf("Thursday\n");
}
else if(day2==2){
printf("Friday\n");
}
else if(day2==3){
printf("Saturday\n");
}
else if(day2==4){
printf("Sunday\n");
}
else if(day2==5){
printf("Monday\n");
}
else if(day2==6){
printf("Tuesday\n");
}
else if(day2==0){
printf("Wednesday\n");
}
}
return 0;
}
|
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:48:1: error: expected declaration or statement at end of input
48 | }
| ^
|
s018698904
|
p00027
|
C
|
#include <stdio.h>
int main(){
int mon,day;
while(1){
scanf("%d%d",&mon,&day);
if(!mon&&!day)break;
t=0;
for(i=1;i<mon;i++){
if(i==2)t+=29;
else if(i==4||i==6||i==9||i==11)t+=30;
else t+=31;
}
t+=day;
switch(t%7){
case 0:
printf("Wednesday\n");
break;
case 1:
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:10:9: error: 't' undeclared (first use in this function)
10 | t=0;
| ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:13: error: 'i' undeclared (first use in this function)
11 | for(i=1;i<mon;i++){
| ^
main.c: At top level:
main.c:50:1: error: expected identifier or '(' before 'return'
50 | return 0;
| ^~~~~~
main.c:51:1: error: expected identifier or '(' before '}' token
51 | }
| ^
|
s864772641
|
p00027
|
C
|
#include <stdio.h>
int main(){
int m,day,date;
int a[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int i,j,k;
while(1){
date=2;
b=1;
scanf("%d %d",&m,&day);
if(m==0&&day==0)break;
for(i=1; i<=12; i++){
for(j=1; j<=a[i]; j++){
date=(date+1)%7;
printf(" month:%2d day:%2d date:%2d\n",i,j,date);
if(j==day&&i==m){
b=0;
break;
}
}
if(!b)break;
}
if(date==0)printf("Monday\n");
else if(date==1)printf("Tuesday\n");
else if(date==2)printf("Wednesday\n");
else if(date==3)printf("Thursday\n");
else if(date==4)printf("Friday\n");
else if(date==5)printf("Saturday\n");
else if(date==6)printf("Sunday\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:9:17: error: 'b' undeclared (first use in this function)
9 | b=1;
| ^
main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
|
s242731175
|
p00027
|
C
|
#include <stdio.h>
int main(){
int m,day,date;
int a[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int i,j,k;
while(1){
date=2;
b=1;
scanf("%d %d",&m,&day);
if(m==0&&day==0)break;
for(i=1; i<=12; i++){
for(j=1; j<=a[i]; j++){
date=(date+1)%7;
printf(" month:%2d day:%2d date:%2d\n",i,j,date);
if(j==day&&i==m){
b=0;
break;
}
}
if(!b)break;
}
if(date==0)printf("Monday\n");
else if(date==1)printf("Tuesday\n");
else if(date==2)printf("Wednesday\n");
else if(date==3)printf("Thursday\n");
else if(date==4)printf("Friday\n");
else if(date==5)printf("Saturday\n");
else if(date==6)printf("Sunday\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:9:17: error: 'b' undeclared (first use in this function)
9 | b=1;
| ^
main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
|
s189073518
|
p00027
|
C
|
// ConsoleApplication2.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#define _CRT_SECURE_NO_WARNINGS 1
#include "stdafx.h"
#include<string.h>
int _tmain(int argc, _TCHAR* argv[])
{
char you[8][15];
int a,b,x,y=0,z;
strcpy (you[5],"Monday");
strcpy (you[6],"Tuesday");
strcpy (you[0],"Wednesday");
strcpy (you[1],"Thursday");
strcpy (you[2],"Friday");
strcpy (you[3],"Saturday");
strcpy (you[4],"Sunday");
while(scanf("%d %d",&a,&b),a+b!=0){
if(a==1){
x=b%7;
}
else if(a==2){
y+=31;
x=(y+b)%7;
}
else if(a==3){
y+=29;
x=(y+b)%7;
}
else if(a==4){
y+=31;
x=(y+b)%7;
}
else if(a==5){
y+=30;
x=(y+b)%7;
}
else if(a==6){
y+=31;
x=(y+b)%7;
}
else if(a==7){
y+=30;
x=(y+b)%7;
}
else if(a==8){
y+=31;
x=(y+b)%7;
}
else if(a==9){
y+=31;
x=(y+b)%7;
}
else if(a==10){
y+=30;
x=(y+b)%7;
}
else if(a==11){
y+=31;
x=(y+b)%7;
}
else if(a==12){
y+=30;
x=(y+b)%7;
}
printf("%s\n",you[x]);
y=0;
}
return 0;
}
|
main.c:6:10: fatal error: stdafx.h: No such file or directory
6 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s338908938
|
p00027
|
C
|
// ConsoleApplication2.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#define _CRT_SECURE_NO_WARNINGS 1
#include "stdafx.h"
#include<string.h>
int _tmain(int argc, _TCHAR* argv[])
{
char you[8][15];
int a,b,x,y=0,z;
strcpy (you[5],"Monday");
strcpy (you[6],"Tuesday");
strcpy (you[0],"Wednesday");
strcpy (you[1],"Thursday");
strcpy (you[2],"Friday");
strcpy (you[3],"Saturday");
strcpy (you[4],"Sunday");
while(scanf("%d %d",&a,&b),a+b!=0){
if(a==1)
x=b%7;
y+=31;
if(a==2)
x=(y+b)%7;
y+=29;
if(a==3)
x=(y+b)%7;
y+=31;
if(a==4)
x=(y+b)%7;
y+=30;
if(a==5)
x=(y+b)%7;
y+=31;
if(a==6)
x=(y+b)%7;
y+=30;
if(a==7)
x=(y+b)%7;
y+=31;
if(a==8)
x=(y+b)%7;
y+=31;
if(a==9)
x=(y+b)%7;
y+=30;
if(a==10)
x=(y+b)%7;
y+=31;
if(a==11)
x=(y+b)%7;
y+=30;
if(a==12)
x=(y+b)%7;
printf("%s\n",you[x]);
y=0;
}
return 0;
}
|
main.c:6:10: fatal error: stdafx.h: No such file or directory
6 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s579119925
|
p00027
|
C
|
// ConsoleApplication2.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#define _CRT_SECURE_NO_WARNINGS 1
#include "stdafx.h"
#include<string.h>
int _tmain(int argc, _TCHAR* argv[])
{
char you[8][15];
int a,b,x,y=0,z;
strcpy (you[5],"Monday");
strcpy (you[6],"Tuesday");
strcpy (you[0],"Wednesday");
strcpy (you[1],"Thursday");
strcpy (you[2],"Friday");
strcpy (you[3],"Saturday");
strcpy (you[4],"Sunday");
while(scanf("%d %d",&a,&b),a+b!=0){
if(a==1)
x=b%7;
y+=31;
if(a==2)
x=(y+b)%7;
y+=29;
if(a==3)
x=(y+b)%7;
y+=31;
if(a==4)
x=(y+b)%7;
y+=30;
if(a==5)
x=(y+b)%7;
y+=31;
if(a==6)
x=(y+b)%7;
y+=30;
if(a==7)
x=(y+b)%7;
y+=31;
if(a==8)
x=(y+b)%7;
y+=31;
if(a==9)
x=(y+b)%7;
y+=30;
if(a==10)
x=(y+b)%7;
y+=31;
if(a==11)
x=(y+b)%7;
y+=30;
if(a==12)
x=(y+b)%7;
printf("%s\n",you[x]);
y=0;
}
return 0;
}
|
main.c:6:10: fatal error: stdafx.h: No such file or directory
6 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s307026008
|
p00027
|
C
|
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0027
|
main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
1 | http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0027
| ^
|
s664553372
|
p00027
|
C
|
d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
|
main.c:1:1: warning: data definition has no type or storage class
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^
main.c:1:52: error: return type defaults to 'int' [-Wimplicit-int]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~
main.c: In function 'main':
main.c:1:52: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:1:66: error: expected identifier or '(' before '[' token
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^
main.c:1:134: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
main.c:1:134: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~~
main.c:1:134: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:160: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
main.c:1:160: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~
main.c:1:160: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:178: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^~~~~~
main.c:1:178: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:178: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:178: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:195: error: 'a' undeclared (first use in this function)
1 | d,s[]={0,31,60,91,121,152,182,213,244,274,305,335};main(m){char [9][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};while(1){scanf("%d%d",&m,&d);if(!m)exit(0);d+=s[m-1];printf("%sday\n",a[(!d%7)?6:(d%7-1)]);}}
| ^
main.c:1:195: note: each undeclared identifier is reported only once for each function it appears in
|
s801863394
|
p00027
|
C
|
m,s[]={0,31,60,91,121,152,182,213,244,274,305,335};
main(d){char a[7][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};
while(1)
{
scanf("%d%d",&m,&d);
if(!m)exit(0);
d+=s[m-1];
printf("%sday\n",&a[(d%7)?(d%7-1)][0]:6);
}
}
|
main.c:1:1: warning: data definition has no type or storage class
1 | m,s[]={0,31,60,91,121,152,182,213,244,274,305,335};
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | m,s[]={0,31,60,91,121,152,182,213,244,274,305,335};
| ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(d){char a[7][9]={"Thurs","Fri","Satur","Sun","Mon","Tues","Wednes"};
| ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:5:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%d%d",&m,&d);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | m,s[]={0,31,60,91,121,152,182,213,244,274,305,335};
main.c:5:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | scanf("%d%d",&m,&d);
| ^~~~~
main.c:5:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:13: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
6 | if(!m)exit(0);
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | m,s[]={0,31,60,91,121,152,182,213,244,274,305,335};
main.c:6:13: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
6 | if(!m)exit(0);
| ^~~~
main.c:6:13: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:8:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
8 | printf("%sday\n",&a[(d%7)?(d%7-1)][0]:6);
| ^~~~~~
main.c:8:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:40: error: expected ':' before ']' token
8 | printf("%sday\n",&a[(d%7)?(d%7-1)][0]:6);
| ^
| :
|
s180312460
|
p00027
|
C
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while ( sc.hasNext() ) {
int i = 0;
double in,t,y;
in = sc.nextDouble();
t = in / 9.8;
y = 4.9 * (t*t);
while ( 5*i-5<y ) i++;
System.out.println(i);
}
}
}
|
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 'public'
3 | public class Main {
| ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
3 | public class Main {
| ^~~~
|
s171650704
|
p00027
|
C
|
#include <iostream>
int main(){
using namespace std;
while(1){
int month,day,year = 2004,mod;
cin >> month >> day;
if (month==0) break;
else if (month<=2) {
month += 12;
year -= 1;
}
int k = year % 100;
int j = year / 100;
mod = (day+(((month+1)*26)/10)+k+(k/4)+(j/4)+5*j)%7;
if (mod == 0) cout << "Saturday" << endl;
else if (mod == 1) cout << "Sunday" << endl;
else if (mod == 2) cout << "Monday" << endl;
else if (mod == 3) cout << "Tuesday" << endl;
else if (mod == 4) cout << "Wednesday" << endl;
else if (mod == 5) cout << "Thursday" << endl;
else if (mod == 6) cout << "Friday" << endl;
}
return 0;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s112545179
|
p00027
|
C
|
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
}
}
return 0;
}
|
main.c:2:7: error: expected identifier or '(' before 'case'
2 | case 5:
| ^~~~
main.c:4:9: error: expected identifier or '(' before 'break'
4 | break;
| ^~~~~
main.c:6:7: error: expected identifier or '(' before 'case'
6 | case 6:
| ^~~~
main.c:8:9: error: expected identifier or '(' before 'break'
8 | break;
| ^~~~~
main.c:9:5: error: expected identifier or '(' before '}' token
9 | }
| ^
main.c:10:3: error: expected identifier or '(' before '}' token
10 | }
| ^
main.c:12:3: error: expected identifier or '(' before 'return'
12 | return 0;
| ^~~~~~
main.c:13:1: error: expected identifier or '(' before '}' token
13 | }
| ^
|
s849857928
|
p00027
|
C
|
n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
|
main.c:1:1: warning: data definition has no type or storage class
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:17: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~
main.c:1:17: note: (near initialization for 'n')
main.c:1:26: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~~~
main.c:1:26: note: (near initialization for 'n')
main.c:1:37: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~
main.c:1:37: note: (near initialization for 'n')
main.c:1:46: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~
main.c:1:46: note: (near initialization for 'n')
main.c:1:55: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~~
main.c:1:55: note: (near initialization for 'n')
main.c:1:65: error: excess elements in 'int[]' initializer
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~~~~~~~
main.c:1:65: note: (near initialization for 'n')
main.c:1:5: error: cannot initialize array of 'int' from a string literal with type array of 'char'
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^
main.c:1:78: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^
main.c:1:80: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^
main.c:1:82: error: return type defaults to 'int' [-Wimplicit-int]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~
main.c: In function 'main':
main.c:1:94: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
main.c:1:94: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~~
main.c:1:94: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:116: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ^~~~
main.c:1:116: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:122: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
1 | n[]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"},m,d;main(){for(;scanf("%d%d",&m,&d),m;puts(n[(d-13*~m/5)%7]))m<3?d-=2,m+=12:0;}
| ~^~~~~~~~~~~~~~~
| |
| int
main.c:1:122: note: expected 'const char *' but argument is of type 'int'
|
s393301964
|
p00027
|
C
|
#include <stdio.h>
int main(void){
int i, j;
int month, day;
int daycount = 0;
while(1){
daycount = 0;
scanf("%d", &month);
scanf("%d", &day);
if((month == 0) && (day == 0)){
return 0;
}
for(i = 1; i < month; i++){
if((i == 11) || (i == 4) || (i == 6) || (i == 9)){
daycount += 30;
}else if((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) ||\ (i == 10) || (i == 12)){
daycount += 31;
}else if(i == 2){
daycount += 29;
}
}
daycount += day;
daycount = daycount % 7;
if(daycount == 0){
printf("Wednesday\n");
}else if(daycount == 1){
printf("Thursday\n");
}else if(daycount == 2){
printf("Friday\n");
}else if(daycount == 3){
printf("Saturday\n");
}else if(daycount == 4){
printf("Sanday\n");
}else if(daycount == 5){
printf("Monday\n");
}else if(daycount == 6){
printf("Tuesday\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:21:75: error: stray '\' in program
21 | }else if((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) ||\ (i == 10) || (i == 12)){
| ^
|
s417732837
|
p00027
|
C
|
#include<stdio.h>
int main(){
int a[11], day, month, i;
a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = 31;
a[1] = 29;
a[3] = a[5] = a[8] = a[10] = 0;
while(scanf("%d%d", month, day) != 0){
if(month == 0 && day == 0) break;
for(i = 0; i < month - 1; i++) day += a[i];
if(day % 7 == 1) printf("Thursday\n");
if(day % 7 == 2) printf("Friday\n");
if(day % 7 == 3) printf("Saturday\n");
if(day % 7 == 4) printf("Sunday\n");
if(day % 7 == 5) printf("Monday\n");
if(day % 7 == 6) printf("Tuesday\n");
if(day % 7 == 0) printf("Wednesday\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:8:43: error: stray '\343' in program
8 | while(scanf("%d%d", month, day) !=<U+3000>0){
| ^~~~~~~~
|
s835392743
|
p00027
|
C
|
#include<stdio.h>
int main(){
int a[11], day, month, i;
a[0] = 31;
a[2] = 31;
a[4] = 31;
a[6] = 31;
a[7] = 31;
a[9] = 31;
a[1] = 29;
a[3] = 30;
a[5] = 30;
a[8] = 30;
a[10] = 30;
while(scanf("%d%d", month, day) != 0){
if(month == 0 && day == 0) break;
for(i = 0; i < month - 1; i++) day += a[i];
if(day % 7 == 1) printf("Thursday\n");
if(day % 7 == 2) printf("Friday\n");
if(day % 7 == 3) printf("Saturday\n");
if(day % 7 == 4) printf("Sunday\n");
if(day % 7 == 5) printf("Monday\n");
if(day % 7 == 6) printf("Tuesday\n");
if(day % 7 == 0) printf("Wednesday\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:16:43: error: stray '\343' in program
16 | while(scanf("%d%d", month, day) !=<U+3000>0){
| ^~~~~~~~
|
s801477066
|
p00027
|
C
|
n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
|
main.c:1:1: warning: data definition has no type or storage class
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:13: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~
main.c:1:13: note: (near initialization for 'n')
main.c:1:19: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~~
main.c:1:19: note: (near initialization for 'n')
main.c:1:26: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~~~~
main.c:1:26: note: (near initialization for 'n')
main.c:1:35: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~~~
main.c:1:35: note: (near initialization for 'n')
main.c:1:43: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~
main.c:1:43: note: (near initialization for 'n')
main.c:1:49: error: excess elements in 'int[7]' initializer
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~~~
main.c:1:49: note: (near initialization for 'n')
main.c:1:6: error: cannot initialize array of 'int' from a string literal with type array of 'char'
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^
main.c:1:58: warning: data definition has no type or storage class
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^
main.c:1:58: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:60: error: return type defaults to 'int' [-Wimplicit-int]
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~
main.c: In function 'main':
main.c:1:60: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:1:73: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
main.c:1:73: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~
main.c:1:73: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:95: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | n[7]={"Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"};m;main(d){for(;scanf("%d%d",&m,&d)*m;printf("%sday\n",n[(3+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));}
| ^~~~~~
main.c:1:95: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:95: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:95: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s497920265
|
p00027
|
C
|
#include <stdio.h>
int main () {
int mo;
int da;
int sum = 0;
int i;
int array [13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
while (1) {
scanf("%d %d",&mo, &da);
sum = 0;
if (mo == 0 && da == 0) {
break;
}
for (i = 1; i < mo; i++) {
sum += array[i];
}
sum += da;
if (sum % 7 == 0) {
printf("Wednesday\n");
}
else if (sum % 7 == 1) {
printf("Thursday\n");
}
else if (sum % 7 == 2) {
printf("Friday\n");
}
else if (sum % 7 == 3) {
printf("Saturday\n");
}
else if (sum % 7 == 4) {
printf("Sunday\n");
}
else if (sum % 7 == 5) {
printf("Monday\n");
}
else if (sum % 7 == 6) {
printf("Tuesday\n");
}
}
return 0;
|
main.c: In function 'main':
main.c:41:5: error: expected declaration or statement at end of input
41 | return 0;
| ^~~~~~
|
s525616695
|
p00027
|
C
|
#include<stdio.h>
int main(){
int i,answer=0,mod[12],day[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<12;i++){
mod[i]=day[i]%7;
}
char Date1[]="Wednesday";
char Date2[]="Thursday";
char Date3[]="Friday";
char Date4[]="Saturday";
char Date5[]="Sunday";
char Date6[]="Monday";
char Date7[]="Tuesday";
while(1){
for(i=0;i<2;i++){
scanf("%d",&number[i]);
}
if(number[0]==0||number[1]==0){
break;
}
for(i=0;i<number[0]-1;i++){
answer+=mod[i];
}
answer+=number[1]%7;
answer%=7;
switch(answer){
case 0:
printf("%s\n",Date1);
break;
case 1:
printf("%s\n",Date2);
break;
case 2:
printf("%s\n",Date3);
break;
case 3:
printf("%s\n",Date4);
break;
case 4:
printf("%s\n",Date5);
break;
case 5:
printf("%s\n",Date6);
break;
case 6:
printf("%s\n",Date7);
break;
}
}
|
main.c: In function 'main':
main.c:17:37: error: 'number' undeclared (first use in this function)
17 | scanf("%d",&number[i]);
| ^~~~~~
main.c:17:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:50:1: error: expected declaration or statement at end of input
50 | }
| ^
|
s588825042
|
p00027
|
C
|
#include<stdio.h>
int main(){
int i,answer=0,number[2],mod[12],day[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<12;i++){
mod[i]=day[i]%7;
}
char Date1[]="Wednesday";
char Date2[]="Thursday";
char Date3[]="Friday";
char Date4[]="Saturday";
char Date5[]="Sunday";
char Date6[]="Monday";
char Date7[]="Tuesday";
while(1){
for(i=0;i<2;i++){
scanf("%d",&number[i]);
}
if(number[0]==0||number[1]==0){
break;
}
for(i=0;i<number[0]-1;i++){
answer+=mod[i];
}
answer+=number[1]%7;
answer%=7;
switch(answer){
case 0:
printf("%s\n",Date1);
break;
case 1:
printf("%s\n",Date2);
break;
case 2:
printf("%s\n",Date3);
break;
case 3:
printf("%s\n",Date4);
break;
case 4:
printf("%s\n",Date5);
break;
case 5:
printf("%s\n",Date6);
break;
case 6:
printf("%s\n",Date7);
break;
}
}
|
main.c: In function 'main':
main.c:50:1: error: expected declaration or statement at end of input
50 | }
| ^
|
s801487727
|
p00027
|
C
|
#include<stdio.h>
int main(){
int i,answer,number[2],mod[12],day[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<12;i++){
mod[i]=day[i]%7;
}
char Date1[]="Wednesday";
char Date2[]="Thursday";
char Date3[]="Friday";
char Date4[]="Saturday";
char Date5[]="Sunday";
char Date6[]="Monday";
char Date7[]="Tuesday";
while(1){
for(i=0;i<2;i++){
scanf("%d",&number[i]);
}
if(number[0]==0||number[1]==0){
break;
}
for(i=0;i<number[0]-1;i++){
answer+=mod[i];
}
answer+=number[1]%7;
answer%=7;
switch(answer){
case 0:
printf("%s\n",Date1);
break;
case 1:
printf("%s\n",Date2);
break;
case 2:
printf("%s\n",Date3);
break;
case 3:
printf("%s\n",Date4);
break;
case 4:
printf("%s\n",Date5);
break;
case 5:
printf("%s\n",Date6);
break;
case 6:
printf("%s\n",Date7);
break;
}
return 0;
}
|
main.c: In function 'main':
main.c:51:1: error: expected declaration or statement at end of input
51 | }
| ^
|
s598398344
|
p00027
|
C
|
#include<stdio.h>
int main(){
int i,answer=0,number1=0,number2=0,mod[12],day[12]={28,31,29,31,30,31,30,31,31,30,31,30};
for(i=0;i<12;i++){
mod[i]=day[i]%7;
}
char Date1[]="Wednesday";
char Date2[]="Thursday";
char Date3[]="Friday";
char Date4[]="Saturday";
char Date5[]="Sunday";
char Date6[]="Monday";
char Date7[]="Tuesday";
while(1){
scanf("%d %d",&number1,&number2);
if(number[0]==0&&number[1]==0){
break;
}
for(i=0;i<number1;i++){
answer=answer+mod[i];
}
answer+=number2;
answer%=7;
switch(answer){
case 0:
printf("%s\n",Date1);
break;
case 1:
printf("%s\n",Date2);
break;
case 2:
printf("%s\n",Date3);
break;
case 3:
printf("%s\n",Date4);
break;
case 4:
printf("%s\n",Date5);
break;
case 5:
printf("%s\n",Date6);
break;
case 6:
printf("%s\n",Date7);
break;
}
return 0;
}
|
main.c: In function 'main':
main.c:17:20: error: 'number' undeclared (first use in this function); did you mean 'number2'?
17 | if(number[0]==0&&number[1]==0){
| ^~~~~~
| number2
main.c:17:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:50:1: error: expected declaration or statement at end of input
50 | }
| ^
|
s688202417
|
p00027
|
C
|
#include<iostream>
using namespace std;
int main(){
int m,d;
while(cin >> m >> d){
if(m==0)
break;
int cd=d;
for(int i=1;i<=m;i++){
switch(i){
case 2:cd+=31;break;
case 3:cd+=29;break;
case 4:cd+=31;break;
case 5:cd+=30;break;
case 6:cd+=31;break;
case 7:cd+=30;break;
case 8:cd+=31;break;
case 9:cd+=31;break;
case 10:cd+=30;break;
case 11:cd+=31;break;
case 12:cd+=30;break;
}
}
switch(cd%7){
case 0:cout << "Wednesday" << endl;break;
case 1:cout << "Thursday" << endl;break;
case 2:cout << "Friday" << endl;break;
case 3:cout << "Saturday" << endl;break;
case 4:cout << "Sunday" << endl;break;
case 5:cout << "Monday" << endl;break;
case 6:cout << "Tuesday" << endl;break;
}
}
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s101586155
|
p00027
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int day[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string date[7] = {
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
};
int main() {
int m, d;
while (cin >> m >> d, m && d) {
int t = d + accumulate(day, day + m - 1, 0);
cout << date[(t + 2) % 7] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:21: error: 'accumulate' was not declared in this scope
14 | int t = d + accumulate(day, day + m - 1, 0);
| ^~~~~~~~~~
|
s220422372
|
p00027
|
C++
|
#include<stdio.h>
int main()
{
int p[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int M,D,sum;
while(1)
{
sum=0;
scanf("%d %d",&M,&D);
if(M==0)break;
for(int i=0;i<M;i++);
sum+=p[i];
sum+=D;
switch(sum%d)
{
case 0:
printf("Sunday\n");
case 1:
printf("Monday\n");
case 2:
printf("Tuesday\n");
case 3:
printf("Wednesday\n");
case 4:
printf("Tursday\n");
case 5:
printf("Friday\n");
case 6:
printf("Saturday\n");
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:8: error: 'i' was not declared in this scope
12 | sum+=p[i];
| ^
a.cc:16:12: error: 'd' was not declared in this scope
16 | switch(sum%d)
| ^
|
s045705585
|
p00027
|
C++
|
#include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
using namespace std;
double r(double x1,double y1,double x2,double y2){
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main() {
// your code goes here
int a[13];
a[1]=31;
a[2]=29;
a[3]=31;
a[4]=30;
a[5]=31;
a[6]=30;
a[7]=31;
a[8]=31;
a[9]=30;
a[10]=31;
a[11]=30;
a[12]=31;
int m,d,z,y;
cin>>m>>d;
while(m!=0){
if(m==0) z=d;
else{
z=d;
for(int i=1;i<m;i++){
z=z+a[i];
}
}
y=z%7;
if(y==1){
cout<<"Thursday"<<endl;
}
if(y==2){
cout<<"Friday"<<endl;
}
if(y==3){
cout<<"Saturday"<<endl;
}
if(y==4){
cout<<"Sunday"<<endl;
}
if(y==5){
cout<<"Monday"<<endl;
}
if(y==6){
cout<<"Tuesday"<<endl;
}
if(y==0){
cout<<"Wednesday"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:59:10: error: expected '}' at end of input
59 | }
| ^
a.cc:30:12: note: to match this '{'
30 | while(m!=0){
| ^
a.cc:59:10: error: expected '}' at end of input
59 | }
| ^
a.cc:12:12: note: to match this '{'
12 | int main() {
| ^
|
s085072329
|
p00027
|
C++
|
import sys
import math
dayy = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def days(a, day):
if a == 0:
return day
else:
return days(a-1, day + dayy[a])
while 1:
inp = raw_input().split()
ii = int(inp[0])
jj = int(inp[1])
if ii == 0 and jj== 0:
break
ans = days(ii-1, 0) + jj
ans = ans % 7
if ans == 1:
print "Thursday"
continue
if ans == 2:
print "Friday"
continue
if ans == 3:
print "Saturday"
continue
if ans == 4:
print "Sunday"
continue
if ans == 5:
print "Monday"
continue
if ans == 6:
print "Tuesday"
continue
if ans == 0:
print "Wednesday"
continue
|
a.cc:2:1: error: 'import' does not name a type
2 | import sys
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s335863948
|
p00027
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int month[12];
month[0]=31;
month[1]=29;
month[2]=31;
month[3]=30;
month[4]=31;
month[5]=30;
month[6]=31;
month[7]=31;
month[8]=30;
month[9]=31;
month[10]=30;
month[11]=31;
int hoge,fuge;
cin >> hoge >> fuga;
int i;
int count=0;
if(hoge!=0)
{
for(i=0;i<hoge-1;i++)
{
count+=month[i];
}
count+=fuga;
flag = count % 7;
if(flag==0)
{
cout << "Wednesday" <<endl;
}
if(fkag==1)
{
cout << "Thursday" <<endl;
}
if(fkag==2)
{
cout << "Friday" <<endl;
}
if(fkag==3)
{
cout << "Saturday" <<endl;
}
if(fkag==4)
{
cout << "Sunday" <<endl;
}
if(fkag==5)
{
cout << "Monday" <<endl;
}
if(fkag==6)
{
cout << "Tuesday" <<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:24:24: error: 'fuga' was not declared in this scope; did you mean 'fuge'?
24 | cin >> hoge >> fuga;
| ^~~~
| fuge
a.cc:38:17: error: 'flag' was not declared in this scope
38 | flag = count % 7;
| ^~~~
a.cc:43:20: error: 'fkag' was not declared in this scope
43 | if(fkag==1)
| ^~~~
a.cc:47:20: error: 'fkag' was not declared in this scope
47 | if(fkag==2)
| ^~~~
a.cc:51:20: error: 'fkag' was not declared in this scope
51 | if(fkag==3)
| ^~~~
a.cc:55:20: error: 'fkag' was not declared in this scope
55 | if(fkag==4)
| ^~~~
a.cc:59:20: error: 'fkag' was not declared in this scope
59 | if(fkag==5)
| ^~~~
a.cc:63:20: error: 'fkag' was not declared in this scope
63 | if(fkag==6)
| ^~~~
|
s680403250
|
p00027
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int month[12];
month[0]=31;
month[1]=29;
month[2]=31;
month[3]=30;
month[4]=31;
month[5]=30;
month[6]=31;
month[7]=31;
month[8]=30;
month[9]=31;
month[10]=30;
month[11]=31;
int hoge,fuge;
cin >> hoge >> fuga;
int i;
int count=0;
if(hoge!=0)
{
for(i=0;i<hoge-1;i++)
{
count+=month[i];
}
count+=fuga;
int flag = 0;
flag = count % 7;
if(flag==0)
{
cout << "Wednesday" <<endl;
}
if(flag==1)
{
cout << "Thursday" <<endl;
}
if(flag==2)
{
cout << "Friday" <<endl;
}
if(flag==3)
{
cout << "Saturday" <<endl;
}
if(flag==4)
{
cout << "Sunday" <<endl;
}
if(flag==5)
{
cout << "Monday" <<endl;
}
if(flag==6)
{
cout << "Tuesday" <<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:24:24: error: 'fuga' was not declared in this scope; did you mean 'fuge'?
24 | cin >> hoge >> fuga;
| ^~~~
| fuge
|
s349071730
|
p00027
|
C++
|
#include<cstdio>
int main(){
int a[] = {0,0,31,60,91,121,152,182,213,244,274,305,335,366};
int m, d;
char day[7][10] = {"Monday", "Tuesday", "Wednesday", "Thursday","Friday","Saturday","Sunday"};
scanf("%d %d", &m, &d
while(m || d){
printf("%s\n", day[(a[m] + d + 2) % 7]);
scanf("%d %d", &m, &d
}
}
|
a.cc: In function 'int main()':
a.cc:7:30: error: expected ')' before 'while'
7 | scanf("%d %d", &m, &d
| ~ ^
| )
8 | while(m || d){
| ~~~~~
|
s027577981
|
p00027
|
C++
|
int zeller(int y , int m , int d){
if(m==1 || m==2) m+=12; y-=1;
return(y + y/4 - y/100 + y/400 + ((13*m+8)/5) + d )%7;
}
int main(){
int m , d , w=4 , fw;
while (cin >> m >> d, m){
switch(zeller(2004,m,d)){
case 0:
cout << "Sunday" << endl;
break;
case 1:
cout << "Monday" << endl;
break;
case 2:
cout << "Tuesday" << endl;
break;
case 3:
cout << "Wednesday" << endl;
break;
case 4:
cout << "Thursday" << endl;
break;
case 5:
cout << "Friday" << endl;
break;
case 6:
cout << "Saturday" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:16: error: 'cin' was not declared in this scope
8 | while (cin >> m >> d, m){
| ^~~
a.cc:11:25: error: 'cout' was not declared in this scope
11 | cout << "Sunday" << endl;
| ^~~~
a.cc:11:45: error: 'endl' was not declared in this scope
11 | cout << "Sunday" << endl;
| ^~~~
|
s488978339
|
p00027
|
C++
|
int main()
{
char yobi[7][10]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
int month,day;
while(1){
scanf("%d %d",&month,&day);
if(month==0)
break;
for(int i=0;i<month;i++){
switch(i){
case 2:
day+=29;
case 4:
case 6:
case 9:
case 11:
day+=30;
default:
day+=31;
}
}
printf("%s\n",yobi[day%7]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:17: error: 'scanf' was not declared in this scope
6 | scanf("%d %d",&month,&day);
| ^~~~~
a.cc:22:17: error: 'printf' was not declared in this scope
22 | printf("%s\n",yobi[day%7]);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.