Submission #1023073

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10230732024-07-14 09:15:13amirhoseinfar1385Paint By Numbers (IOI16_paint)C++17
59 / 100
1 ms604 KiB
#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;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...