# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284659 | Pichon5 | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 288 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>
#include <cstdlib>
#define vi vector<int>
using namespace std;
string ss;
int atras,delante;
void f(int a,int b,int x){
a+=atras;
b-=delante;
int aux=b-a+1-x;
for(int i=a;aux>0;i++){
aux--;
ss[i]='?';
}
aux=b-a+1-x;
for(int i=b;aux>0;i--){
aux--;
ss[i]='?';
}
}
string solve_puzzle(string s,vector<int> c){
int a=0,b=s.size()-1;
ss.assign(s.size(),'X');
for(int i=0;i<c.size();i++){
b-=c[i];
}
atras=0;
delante=c.size()-1;
for(int i=0;i<c.size();i++){
b+=c[i];
f(a,b,c[i]);
a+=c[i];
atras++;
delante--;
}
return ss;
}
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... |