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 "paint.h"
#include <iostream>
#include <vector>
using namespace std;
int n,k;
string solve_puzzle(string s, vector<int>c){
n=s.size();
k=c.size();
int j=0,last=-1;
for(int i=0;i<=n;i++){
if(i==n || s[i]=='_'){
while(j<k && i-last-1>=c[j]){
for(int l=last+1;l<last+c[j]+1;l++) s[l]='X';
last=min(i,last+c[j]+1);
}
last=i;
}
}
for(int i=0;i<n;i++) s[i]=s[i]=='.'?'_':s[i];
return s;
}
# | 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... |