Submission #42492

#TimeUsernameProblemLanguageResultExecution timeMemory
42492nonocutTreasure (different grader from official contest) (CEOI13_treasure2)C++14
100 / 100
6 ms1884 KiB
#include "treasure.h" #include<bits/stdc++.h> using namespace std; int s[105][105]; map<int,map<int,map<int,map<int,int>>>> mp; int get(int r1,int c1,int r2,int c2) { if(!mp[r1][c1][r2][c2]) mp[r1][c1][r2][c2] = countTreasure(r1,c1,r2,c2); return mp[r1][c1][r2][c2]; } void findTreasure (int N) { //section 4 for(int i=N/2+1;i<=N;i++) { for(int j=N/2+1;j<=N;j++) { s[i][j] = get(1,1,i,j); } } //section 3 for(int i=1;i<=N/2;i++) { for(int j=N/2+1;j<=N;j++) { s[i][j] = s[N][j] - get(i+1,1,N,j); } } //section 2 for(int i=N/2+1;i<=N;i++) { for(int j=1;j<=N/2;j++) { s[i][j] = s[i][N] - get(1,j+1,i,N); } } //section1 for(int i=1;i<=N/2;i++) { for(int j=1;j<=N/2;j++) { s[i][j] = s[N][j] + s[i][N] + get(i+1,j+1,N,N) - s[N][N]; } } for(int i=1;i<=N;i++) { for(int j=1;j<=N;j++) { if(s[i][j]-s[i-1][j]-s[i][j-1]+s[i-1][j-1]) Report(i,j); // printf("%d ",s[i][j]); } // printf("\n"); } }

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)");
                                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...