Submission #1062090

#TimeUsernameProblemLanguageResultExecution timeMemory
1062090jamesbamberVision Program (IOI19_vision)C++17
100 / 100
13 ms2084 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { vector<int> col, row; for(int i=0; i<H; i++){ vector<int> tmp; for(int j=0; j<W; j++) tmp.push_back(W*i + j); if(row.size()) tmp.push_back(row.back()); row.push_back(add_xor(tmp)); } for(int j=0; j<W; j++){ vector<int> tmp; for(int i=0; i<H; i++) tmp.push_back(W*i + j); if(col.size()) tmp.push_back(col.back()); col.push_back(add_xor(tmp)); } auto sum = [&](vector<int> num, int add){ vector<int> ans; int carry = add; for(int i=0; i<num.size(); i++){ ans.push_back(add_xor({num[i], carry})); carry = add_and({num[i], carry}); } return ans; }; vector<int> gridsus(H*W); iota(gridsus.begin(), gridsus.end(), 0); int zero = add_xor(gridsus); int bits = 9; vector<int> tot; for(int i=0; i<bits; i++) tot.push_back(add_and({zero})); for(int x: col) tot = sum(tot, x); for(int x: row) tot = sum(tot, x); vector<int> target; for(int i=0; i<bits; i++){ if(K & (1<<i)) target.push_back(add_not(zero)); else target.push_back(add_and({zero})); } vector<int> check; for(int i=0; i<bits; i++) check.push_back(add_xor({target[i], tot[i]})); int ans = add_or(check); add_not(ans); }

Compilation message (stderr)

vision.cpp: In lambda function:
vision.cpp:25:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   for(int i=0; i<num.size(); i++){
      |                ~^~~~~~~~~~~
#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...