Submission #427043

#TimeUsernameProblemLanguageResultExecution timeMemory
427043vincentpikachu20Paint By Numbers (IOI16_paint)C++17
32 / 100
1 ms204 KiB
#include "paint.h" #include <bits/stdc++.h> #define int long long using namespace std; string solve_puzzle(string s, vector<signed> c) { int n = s.size(), k = c.size(); string ans = ""; int csum = accumulate(c.begin(), c.end(), (int)0); if(n == csum + k - 1) ans = string(n,'_'); else ans = string(n,'?'); vector<int> l(k),r(k); int p = 0; for(int i = 0; i < k; i ++){ l[i] = p + n - (csum + k - 1); r[i] = p + c[i]; p += c[i] + 1; } for(int i = 0; i < k; i ++){ for(int j = l[i]; j < r[i]; j ++) ans[j] = '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...