# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960255 | irmuun | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 600 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"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
string solve_puzzle(string s,vector<int>c){
int n=s.size(),mn=0;
for(int i=0;i<c.size();i++){
mn+=c[i];
}
mn+=(int)c.size()-1;
vector<int>a(n,-1),b(n,-1);
int j=0;
for(int i=0;i<c.size();i++){
for(int k=0;k<c[i];k++){
a[j++]=i;
}
j++;
}
j=n-1;
for(int i=c.size()-1;i>=0;i--){
for(int k=0;k<c[i];k++){
b[j--]=i;
}
j--;
}
for(int i=0;i<n;i++){
if(a[i]==-1||b[i]==-1){
s[i]='?';
if(mn==n){
s[i]='_';
}
}
else if(a[i]==b[i]){
s[i]='X';
}
else{
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... |