Submission #145652

#TimeUsernameProblemLanguageResultExecution timeMemory
145652XylofoVision Program (IOI19_vision)C++14
100 / 100
16 ms1780 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() #define eb emplace_back typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; void construct_network(int H, int W, int K) { auto at = [&](int x, int y){ return x*W + y; }; vi rows(H), cols(W); rep(x,0,H) { vi a; rep(y,0,W) a.eb(at(x,y)); if(x != 0) a.eb(rows[x-1]); rows[x] = add_xor(a); } rep(y,0,W) { vi a; rep(x,0,H) a.eb(at(x,y)); if(y != 0) a.eb(cols[y-1]); cols[y] = add_xor(a); } vi Q = rows; Q.insert(Q.end(), all(cols)); int F = add_xor({0,0}), T = add_not(F), t; const int bits = 9; vi n(bits, F); for(int x : Q) { rep(b,0,bits) { // n_b = n_b ^ x // x = n_b & x t = add_xor({x, n[b]}); x = add_and({x, n[b]}); n[b] = t; } } vi good(bits); rep(b,0,bits) { good[b] = add_xor({n[b], (K & 1) ? F : T}); K /= 2; } int ans = add_and(good); }

Compilation message (stderr)

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