Submission #1044494

#TimeUsernameProblemLanguageResultExecution timeMemory
1044494ZicrusPaint By Numbers (IOI16_paint)C++17
32 / 100
0 ms396 KiB
#include <bits/stdc++.h> #include "paint.h" using namespace std; typedef long long ll; string solve_puzzle(string s, vector<int> c) { ll n = s.size(), k = c.size(); ll minLen = k-1; for (auto &e : c) minLen += e; if (minLen == n) { string res = ""; for (int i = 0; i < k; i++) { for (int j = 0; j < c[i]; j++) { res += 'X'; } if (i < k-1) res += '_'; } return res; } ll play = n - minLen; ll pos = 0; for (int i = 0; i < k; i++) { for (int j = pos+play; j < pos+c[i]; j++) { s[j] = 'X'; } pos += c[i]+1; } for (auto &e : s) { if (e == '.') e = '?'; } return 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...