Submission #208018

#TimeUsernameProblemLanguageResultExecution timeMemory
208018LawlietVision Program (IOI19_vision)C++17
44 / 100
93 ms2924 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; int n, m; int getCell(int i, int j) { return i*m + j; } void construct_network(int H, int W, int K) { n = H; m = W; vector< int > all; int curInd = H*W - 1; for(int curX = 0 ; curX < n ; curX++) { for(int curY = 0 ; curY < m ; curY++) { vector< int > q; for(int x = 0 ; x < n ; x++) { for(int y = 0 ; y < m ; y++) { int dx = abs( x - curX ); int dy = abs( y - curY ); if( dx + dy == K ) q.push_back( getCell( x , y ) ); } } q.push_back( getCell( curX , curY ) ); add_or( q );//curInd + 1 add_xor( q );//curInd + 2 q.pop_back(); if( q.empty() ) { vector< int > aux; aux.push_back( curInd + 1 ); aux.push_back( curInd + 2 ); add_xor( aux ); curInd += 3; continue; } add_xor( q );//curInd + 3 vector< int > aux; aux.push_back( curInd + 1 ); aux.push_back( curInd + 2 ); add_xor( aux );//curInd + 4 aux.clear(); aux.push_back( curInd + 3 ); aux.push_back( curInd + 4 ); add_and( aux );//curInd + 5 all.push_back( curInd + 5 ); curInd += 5; } } add_or( all ); }
#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...