Submission #79409

#TimeUsernameProblemLanguageResultExecution timeMemory
79409szawinisTreasure (different grader from official contest) (CEOI13_treasure2)C++17
0 / 100
3 ms652 KiB
#include "treasure.h" #include <bits/stdc++.h> using namespace std; int N, a[101][101], b[101][101], c[101][101], d[101][101]; void findTreasure (int n) { N = n; for(int i = 1; i <= N; i++) for(int j = 1; j <= N; j++) a[i][j] = b[i][j] = c[i][j] = d[i][j] = -1; for(int i = N/2+1; i <= N; i++) for(int j = N/2+1; j <= N; j++) a[i][j] = countTreasure(1, 1, i, j); for(int i = N/2+1; i <= N; i++) for(int j = 1; j <= N/2; j++) b[i][j] = countTreasure(1, j, i, N); for(int i = 1; i <= N/2; i++) for(int j = N/2+1; j <= N; j++) c[i][j] = countTreasure(i, 1, N, j); for(int i = 1; i <= N/2; i++) for(int j = 1; j <= N/2; j++) d[i][j] = countTreasure(i, j, N, N); for(int i = 1; i <= N; i++) for(int j = 1; j <= N; j++) { if(i > N/2 & j > N/2 && a[i][j] - a[i-1][j] - a[i][j-1] + a[i-1][j-1]) Report(i, j); if(i > N/2 && j <= N/2 && b[i][j] - b[i-1][j] - b[i][j+1] + b[i-1][j+1]) Report(i, j); if(i <= N/2 && j > N/2 && c[i][j] - c[i+1][j] - c[i][j-1] + c[i+1][j-1]) Report(i, j); if(i <= N/2 && j <= N/2 && d[i][j] - d[i+1][j] - d[i][j+1] + d[i+1][j+1]) Report(i, j); } }

Compilation message (stderr)

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:15:14: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
         if(i > N/2 & j > N/2 && a[i][j] - a[i-1][j] - a[i][j-1] + a[i-1][j-1]) Report(i, j);
            ~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...