Submission #43491

#TimeUsernameProblemLanguageResultExecution timeMemory
43491HassoonyTreasure (different grader from official contest) (CEOI13_treasure2)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int MX=102; int grid[MX][MX],n; bool is[MX][MX][MX][MX]; void calc(int x1,int y1,int x2,int y2,int how){ if(!how)return; if(x1==x2&&y1==y2){ if(how==1){ grid[x1][y1]=1; } return; } if(x1==x2){ int mid=(y1+y2)/2; if(!is[x1][y1][x2][mid]){ cout<<x1<<" "<<y1<<" "<<x2<<" "<<mid<<endl; int x; scanf("%d",&x); is[x1][y1][x2][mid]=1; calc(x1,y1,x2,mid,x); } if(mid+1>y2)return; if(!is[x1][mid+1][x2][y2]){ cout<<x1<<" "<<mid+1<<" "<<x2<<" "<<y2<<endl; int x;scanf("%d",&x); is[x1][mid+1][x2][y2]=1; calc(x1,mid+1,x2,y2,x); } return; } int mid=(x1+x2)/2; if(!is[x1][y1][mid][y2]){ cout<<x1<<" "<<y1<<" "<<mid<<" "<<y2<<endl; int x;scanf("%d",&x); is[x1][y1][mid][y2]=1; calc(x1,y1,mid,x2,x); } if(mid+1>x2)return; if(!is[mid+1][y1][x2][y2]){ cout<<mid+1<<" "<<y1<<" "<<x2<<" "<<y2<<endl; int x;scanf("%d",&x); is[mid+1][y1][x2][y2]=1; calc(mid+1,y1,x2,y2,x); } } int main(){ scanf("%d",&n); cout<<1<<" "<<1<<" "<<n<<" "<<n<<endl; int x;scanf("%d",&x); calc(1,1,n,n,x); for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<grid[i][j]; } puts(""); } }

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:63:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         my_assert(strlen(A[i]+1) == N, "each line of the map must contain N zeroes or ones (before loop)");
                                  ^
treasure.cpp: In function 'void calc(int, int, int, int, int)':
treasure.cpp:21:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&x);
                           ^
treasure.cpp:28:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             int x;scanf("%d",&x);
                                 ^
treasure.cpp:37:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         int x;scanf("%d",&x);
                             ^
treasure.cpp:44:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         int x;scanf("%d",&x);
                             ^
treasure.cpp: In function 'int main()':
treasure.cpp:50:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^
treasure.cpp:52:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int x;scanf("%d",&x);
                         ^
/tmp/ccOK0SU3.o: In function `main':
treasure.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccqmEwu6.o:grader.c:(.text.startup+0x0): first defined here
/tmp/ccqmEwu6.o: In function `main':
grader.c:(.text.startup+0x107): undefined reference to `findTreasure(int)'
collect2: error: ld returned 1 exit status