Submission #169940

#TimeUsernameProblemLanguageResultExecution timeMemory
169940nandonathanielVision Program (IOI19_vision)C++14
0 / 100
3 ms632 KiB
#include "vision.h" #include "bits/stdc++.h" using namespace std; vector<int> sum(vector<int> v,int x){ vector<int> simpan; for(int i=0;i<9;i++){ simpan.push_back(add_xor({v[i],x})); x=add_and({v[i],x}); } return simpan; } vector<int> jumlah(vector<int> v,vector<int> u){ vector<int> ret; ret.push_back(add_and({0,add_not(0)})); for(int i=1;i<=8;i++)add_and({ret[0]}); for(auto isi : v)ret=sum(ret,isi); for(auto isi : u)ret=sum(ret,isi); return ret; } vector<int> baris(int h,int w){ vector<int> ret; for(int i=0;i<h;i++){ vector<int> v; for(int j=0;j<w;j++)v.push_back(i*w+j); ret.push_back(add_xor(v)); } return ret; } vector<int> kolom(int h,int w){ vector<int> ret; for(int j=0;j<w;j++){ vector<int> v; for(int i=0;i<h;i++)v.push_back(i*w+j); ret.push_back(add_xor(v)); } return ret; } void sama(vector<int> v,int k){ for(int i=0;i<9;i++){ if(!((1<<i) & k))v[i]=add_not(v[i]); } add_and(v); } void construct_network(int H, int W, int K) { sama(jumlah(baris(H,W),kolom(H,W)),K); }
#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...