Submission #414493

#TimeUsernameProblemLanguageResultExecution timeMemory
414493ollelVision Program (IOI19_vision)C++14
0 / 100
1 ms216 KiB
#include <bits/stdc++.h> #include <iostream> #include "vision.h" using namespace std; #define rep(i,a,b) for(int i = a; i < b; i++) #define pb push_back typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int,int> pii; int h, w, k, inst; // bool add_or(vi& q) { // cout << "or:\n"; // for(auto &i : q) cout << i << " ";cout<<endl; // bool ans; cin >> ans; // return ans; // } // // bool add_not(int x ) { // cout << "not:\n"; // cout << x << endl; // bool ans; cin >> ans; return ans; // } void construct_network(int H, int W, int K) { h = H; w = W; k = K; inst = h * w; int fi = inst; rep(x, 0, w) rep(y, 0, h) { vi ask = {x+y*w}; inst++; if (add_and(ask)) rep(x2, 0, w) rep(y2, 0, h) { if (abs(x2 - x) + abs(y2 - y) == k) { inst++; vi ask = {x+y*w, x2+y2*w}; if (add_and(ask)) return; } } } rep(x, 0, w) rep(y, 0, h) { vi ask = {x+y*w}; if (!add_and(ask)) return; } } // int main() { // int H ,W, K; cin >> H>>W>>K;construct_network(H, W, K); // }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:7: warning: unused variable 'fi' [-Wunused-variable]
   33 |   int fi = inst;
      |       ^~
#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...