Submission #773419

#TimeUsernameProblemLanguageResultExecution timeMemory
773419JomnoiPaint By Numbers (IOI16_paint)C++17
7 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "paint.h" using namespace std; const int MAX_N = 2e5 + 5; int qs[MAX_N]; string ans; string solve_puzzle(string s, vector <int> c) { int N = s.size(), k = c.size(); for (int i = 0; i < N; i++) ans.push_back('?'); for (int i = 1; i <= k; i++) qs[i] = qs[i - 1] + c[i - 1]; for (int i = 1; i <= k; i++) { int l = qs[i - 1] + i; int r = N - (qs[k] - qs[i]) - (k - i); for (int j = r - c[i - 1] + 1; j <= l + c[i - 1] - 1; j++) ans[j - 1] = 'X'; } return ans; }
#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...