Submission #1044463

#TimeUsernameProblemLanguageResultExecution timeMemory
1044463fv3Paint By Numbers (IOI16_paint)C++14
7 / 100
0 ms440 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; int N, M; string solve_puzzle(string s, vector<int> c) { N = s.size(); M = c.size(); vector<int> preSum(M + 1); vector<int> sufSum(M + 1, N); for (int i = 0; i < M; i++) preSum[i+1] = preSum[i] + c[i] + 1; for (int i = M - 1; i >= 0; i--) sufSum[i] -= (N - sufSum[i+1]) + c[i] + (int)(i != M - 1); string res(N, '?'); for (int i = 0; i < M; i++) { for (int j = sufSum[i]; j < preSum[i] + c[i]; j++) res[j] = 'X'; } return res; }
#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...