Submission #385593

#TimeUsernameProblemLanguageResultExecution timeMemory
385593taulantPainting Squares (IOI20_squares)C++17
100 / 100
135 ms588 KiB
#include "bits/stdc++.h" using namespace std; int ans[1024]; vector<int> paint(int n){ vector<int> ret(10), used(1024); int i = 0, idx = 0; while(!used[i]){ ans[i] = idx; used[i] = 1; ++idx; i = (i+i) & 1023; if(!used[i+1]) ++i; ret.push_back(i & 1); } ret.resize(n); ret.push_back(10); return ret; } int find_location(int n, vector<int> c){ if(!ans[1]) paint(0); if(c.back() < 0){ for(int i : c) if(i >= 0) --n; return n; } int x = 0; for(int i : c) x += x + i; return ans[x]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...