Submission #91898

#TimeUsernameProblemLanguageResultExecution timeMemory
91898easruiTreasure (different grader from official contest) (CEOI13_treasure2)C++14
0 / 100
1084 ms400 KiB
#include <bits/stdc++.h> #include "treasure.h" using namespace std; int S[101][101]; // S[a][b] a행 b열까지합 void findTreasure(int N){ int L,R,U,D,tmp,res; L=1,R=N,U=1,D=N; tmp = countTreasure(L,1,R,N); for(U=2,D=N;U<=(1+N)/2;U++){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } tmp = countTreasure(L,1,R,N); for(U=1,D=N-1;D>(1+N)/2;D--){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } for(L=2,R=N;L<=(1+N)/2;L++){ tmp = countTreasure(L,1,R,N); for(U=2,D=N;U<=(1+N)/2;U++){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } tmp = countTreasure(L,1,R,N); for(U=1,D=N-1;D>(1+N)/2;D--){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } } for(L=1,R=N-1;R>(1+N)/2;R--){ tmp = countTreasure(L,1,R,N); for(U=2,D=N;U<=(1+N)/2;U++){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } tmp = countTreasure(L,1,R,N); for(U=1,D=N-1;D>(1+N)/2;D--){ res = countTreasure(L,U,R,D); if(L=1) S[U-1][R] = tmp - res; else S[U-1][L-1] = S[U-1][N] - (tmp - res); tmp = res; } } for(int x=1; x<=N; x++) for(int y=1; y<=N; y++){ if(S[y][x]!=S[y][x-1]) Report(x,y); } }

Compilation message (stderr)

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:12:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(L=1) S[U-1][R] = tmp - res;
            ~^~
treasure.cpp:19:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(L=1) S[U-1][R] = tmp - res;
            ~^~
treasure.cpp:27:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:34:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:43:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:50:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...