# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
195627 | juanmartinez111 | Paint By Numbers (IOI16_paint) | C++14 | 6 ms | 424 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 <cstdlib>
using namespace std;
int visi[104];
int minimo=0;
long long cx=0,n;
vector<int>paredes,posible;
string nw="";
std::string solve_puzzle(std::string s, std::vector<int> c) {
string a="",hay="",nw="",b="";
for(int i=0;i<s.size();i++)visi[i]=-1;
for(int i=0;i<c.size();i++){
for(int j=0;j<c[i];j++)hay+='X';
if(i+1<c.size())hay+='_';
}
for(int i=0;i<s.size();i++){
if(b.size()+hay.size()>s.size())break;
nw="";
nw+=b;
nw+=hay;
while(nw.size()<s.size())nw+='.';
for(int j=0;j<nw.size();j++){
if(visi[j]==-1){
if(nw[j]=='_')visi[j]=1;
else if(nw[j]=='X')visi[j]=2;
else visi[j]=0;
}
else if(nw[j]=='.' and visi[j]!=0)visi[j]=3;
else if(nw[j]=='_' and visi[j]!=1)visi[j]=3;
else if(nw[j]=='X' and visi[j]!=2)visi[j]=3;
}
b+='.';
}
for(int i=0;i<s.size();i++){
if(visi[i]==3)a+='?';
else if(visi[i]==1)a+='_';
else if(visi[i]==2)a+='X';
else a+='.';
}
return a;
}
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... |