# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830328 | Warinchai | Paint By Numbers (IOI16_paint) | C++14 | 1 ms | 308 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 "paint.h"
#include<bits/stdc++.h>
using namespace std;
int ar[105];
int hb[105];
int db[105];
int pre[105];
std::string solve_puzzle(string s,vector<int> c) {
int sz=s.size();
int sum=0;
for(int i=0;i<c.size();i++){
sum+=c[i];
pre[i+1]=sum;
}
int left=sz-sum-(c.size()-1);
for(int i=0;i<c.size();i++){
int x=c[i];
int st=pre[i]+i;
for(int j=st;j<=st+x-1+left;j++){
hb[j]=1;
}
for(int j=st+left;j<=st+x-1;j++){
db[j]=1;
}
}
string ans="";
for(int i=0;i<sz;i++){
if(db[i]==1){
ans=ans+'X';
}else if(hb[i]==1){
ans=ans+'?';
}else{
ans=ans+'_';
}
}
return ans;
}
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... |