Submission #1053449

#TimeUsernameProblemLanguageResultExecution timeMemory
1053449TobVision Program (IOI19_vision)C++14
52 / 100
2 ms2264 KiB
#include <bits/stdc++.h> #include "vision.h" #define F first #define S second #define pb push_back using namespace std; typedef pair <int, int> pii; void construct_network(int h, int w, int k) { int cnt = h*w; if (min(h, w) == 1) { vector <int> v; for (int i = 0; i < max(h, w)-k; i++) v.pb(add_and({i, i+k})); add_or(v); return; } if (max(h, w) <= 100) { vector <int> v; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { int x = i, y = j-k; vector <int> vv; while (y < j) { x++; y++; if (x < h && y >= 0) vv.pb(x*w+y); } while (x > i) { x--; y++; if (x < h && y < w) vv.pb(x*w+y); } if (vv.empty()) continue; int a = add_xor(vv); v.pb(add_and({a, i*w+j})); } } add_or(v); return; } vector <int> v; for (int i = 0; i < 1; i++) { for (int j = 0; j < 1; j++) { int x = i, y = j-k; vector <int> vv; while (y < j) { x++; y++; if (x < h && y >= 0) vv.pb(x*w+y); } while (x > i) { x--; y++; if (x < h && y < w) vv.pb(x*w+y); } if (vv.empty()) continue; int a = add_xor(vv); v.pb(add_and({a, i*w+j})); } } add_or(v); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:15:6: warning: unused variable 'cnt' [-Wunused-variable]
   15 |  int cnt = h*w;
      |      ^~~
#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...