# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331477 | Nayna | Paint By Numbers (IOI16_paint) | C++14 | 1 ms | 492 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "paint.h"
#include <cstdlib>
using namespace std;
string solve_puzzle(string s, vector<int> c) {
string ans;
int k = c.size();
int n = s.size();
int cur = 0;
for(int i = 0; i < n; i++) {
if(s[i]!='.') continue;
int cnt = 0, r = i;
while(r < n && cnt<c[cur]) {
if(s[r]=='_') break;
cnt++;
r++;
}
if(cnt==c[cur]) {
for(int r = i; r < i+c[cur]; r++) s[r] = 'X';
s[i+c[cur]] = '_';
cur++;
}
}
for(int i = 0; i < n; i++) {
if(s[i]=='.') s[i] = '_';
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |