# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023073 | amirhoseinfar1385 | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 604 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;
const int maxn=200000+10,maxk=200;
int n,k,dpps[maxn][maxk],dpsuf[maxn][maxk],vas[maxn],ted1[maxn],ted2[maxn],hey[maxn];
std::string solve_puzzle(std::string s, std::vector<int> c) {
n=(int)s.size();
k=(int)c.size();
s.push_back('.');
for(int i=1;i<=n;i++){
ted1[i]+=ted1[i-1];
ted2[i]+=ted2[i-1];
ted1[i]+=(s[i-1]=='X');
ted2[i]+=(s[i-1]=='_');
}
dpps[0][0]=1;
dpsuf[n+1][k+1]=dpsuf[n+2][k+1]=1;
for(int i=1;i<=n;i++){
if(s[i-1]!='X'){
dpps[i][0]|=dpps[i-1][0];
}
for(int j=1;j<=k;j++){
if(s[i-1]!='X'){
dpps[i][j]|=dpps[i-1][j];
}
if(i>=c[j-1]+(j>1)&&ted2[i]-ted2[i-c[j-1]]==0){
if(i-c[j-1]-1>=0&&s[i-c[j-1]-1]=='X'){
continue;
}
# | 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... |