Submission #296154

#TimeUsernameProblemLanguageResultExecution timeMemory
296154SamAndVision Program (IOI19_vision)C++17
0 / 100
1 ms416 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define m_p make_pair #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) typedef long long ll; const int N = 202; int n, m; int z; int a[N * N]; void construct_network(int H, int W, int K) { n = H; m = W; z = n * m; int x1 = -1, y1_ = -1, x2 = -1, y2 = -1; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (a[z++] = add_not(i * n + j)) { if (x1 == -1) { x1 = i; y1_ = j; } else { x2 = i; y2 = j; } } } } if (abs(x1 - x2) + abs(y1_ - y2) != K) { a[z++] = add_not(x2 * n + y2); } else { a[z++] = add_not(x2 * n + y2); add_not(z - 1); } }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:24: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   28 |             if (a[z++] = add_not(i * n + j))
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...