제출 #381014

#제출 시각아이디문제언어결과실행 시간메모리
381014BlancaHMPainting Squares (IOI20_squares)C++14
0 / 100
134 ms716 KiB
#include <iostream> #include <vector> #include <map> using namespace std; map<string, int> used; vector<int> squares = {4}; vector<int> paint(int n) { squares = vector<int>(n+1); squares[n] = 10; string window = "1111111111"; used.clear(); for (int i = 0; i < 10; i++) { if (i == n) break; squares[i] = 1; } used[window] = 0; for (int i = 10; i < n; i++) { window.erase(0, 1); window.push_back('0'); if (used.find(window) == used.end()) squares[i] = 0; else { squares[i] = 1; window[9] = '1'; } used[window] = i - 9; } return squares; } int find_location(int n, vector<int> c) { if (c[9] == -1) { int num = -1; while(num < 10 && c[num+1] != -1) num++; return n - (num+1); } if (squares[0] == 4) squares = paint(n); string s = ""; for (int i = 0; i < 10; i++) { if (c[i] == 0) s += "0"; else s += "1"; } return used[s]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...