Submission #598837

#TimeUsernameProblemLanguageResultExecution timeMemory
598837promaPaint By Numbers (IOI16_paint)C++17
32 / 100
1 ms212 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; string solve_puzzle(string s, vector<int> c) { int n = c.size(); int m = s.size(); vector <int> pos(n); pos[0] = 0; for (int i = 1; i < n; i ++) { pos[i] = pos[i-1] + c[i-1] + 1; } int rem = m - pos[n-1] - c[n-1]; for (int i = 0; i < m; i ++) { if (!rem) s[i] = '_'; else s[i] = '?'; } for (int i = 0; i < n; i ++) { for (int j = pos[i] + rem; j < pos[i] + c[i]; j ++) { s[j] = 'X'; } } 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...