Submission #1021526

#TimeUsernameProblemLanguageResultExecution timeMemory
1021526vjudge1Vision Program (IOI19_vision)C++17
0 / 100
2 ms984 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; using vi = vector <int>; void construct_network (int h, int w, int k) { vi th; auto toLine = [&](ll i, ll j) { return 0 <= i && i < h && 0 <= j && j < w ? i*w+j : -16; }; auto getNeigh = [&](ll i, ll j) -> vi { vi ans; if (toLine(i-1, j) != -16) ans.push_back(toLine(i-1, j)); if (toLine(i+1, j) != -16) ans.push_back(toLine(i+1, j)); if (toLine(i, j-1) != -16) ans.push_back(toLine(i, j-1)); if (toLine(i, j+1) != -16) ans.push_back(toLine(i, j+1)); return ans; }; for (ll i = 0; i < h; i++) { for (ll j = 0; j < w; j++) { th.push_back(add_and({ toLine(i, j), add_or({ getNeigh(i, j) }) })); } } add_or(th); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:21:42: warning: narrowing conversion of 'toLine.construct_network(int, int, int)::<lambda(ll, ll)>(i, j)' from 'long long int' to 'int' [-Wnarrowing]
   21 |             th.push_back(add_and({ toLine(i, j), add_or({ getNeigh(i, j) }) }));
      |                                    ~~~~~~^~~~~~
vision.cpp:21:42: warning: narrowing conversion of 'toLine.construct_network(int, int, int)::<lambda(ll, ll)>(i, j)' from 'long long int' to 'int' [-Wnarrowing]
#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...