제출 #91897

#제출 시각아이디문제언어결과실행 시간메모리
91897easrui보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.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); } }

컴파일 시 표준 에러 (stderr) 메시지

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:8:11: error: 'countTreasure' was not declared in this scope
     tmp = countTreasure(L,1,R,N);
           ^~~~~~~~~~~~~
treasure.cpp:8:11: note: suggested alternative: 'findTreasure'
     tmp = countTreasure(L,1,R,N);
           ^~~~~~~~~~~~~
           findTreasure
treasure.cpp:11:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(L=1) S[U-1][R] = tmp - res;
            ~^~
treasure.cpp:18:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(L=1) S[U-1][R] = tmp - res;
            ~^~
treasure.cpp:26:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:33:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:42:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:49:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if(L=1) S[U-1][R] = tmp - res;
                ~^~
treasure.cpp:56:36: error: 'Report' was not declared in this scope
             if(S[y][x]!=S[y][x-1]) Report(x,y);
                                    ^~~~~~
treasure.cpp:56:36: note: suggested alternative: 'qsort'
             if(S[y][x]!=S[y][x-1]) Report(x,y);
                                    ^~~~~~
                                    qsort