제출 #308983

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3089832020-10-02 14:01:28vipghn2003Paint By Numbers (IOI16_paint)C++14
7 / 100
1 ms384 KiB
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int n,k,sum[N],f[N];
bool pref[N][105],suf[N][105];
bool canWhite[N],canBlack[N];
string solve_puzzle(string s,vector<int> cc)
{
n=s.size();
s="."+s;
for(int i=1;i<=n;i++) sum[i]=sum[i-1]+(s[i]=='_');
k=cc.size();
vector<int>c(k+1);
for(int i=0;i<k;i++) c[i+1]=cc[i];
pref[0][0]=true;
for(int i=1;i<=n;i++)
{
for(int j=0;j<=k;j++)
{
if(s[i]=='_') pref[i][j]=pref[i-1][j];
else if(s[i]=='X')
{
if(j!=0&&i>=c[j]&&sum[i]-sum[i-c[j]]==0&&s[i-c[j]]!='X')
{
if(i==c[j]) pref[i][j]=pref[i-c[j]][j-1];
else pref[i][j]=pref[i][j]=pref[i-c[j]-1][j-1];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:29:36: warning: operation on 'pref[i][j]' may be undefined [-Wsequence-point]
   29 |                     else pref[i][j]=pref[i][j]=pref[i-c[j]-1][j-1];
      |                          ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paint.cpp:38:36: warning: operation on 'pref[i][j]' may be undefined [-Wsequence-point]
   38 |                     else pref[i][j]=pref[i][j]=pref[i-c[j]-1][j-1];
      |                          ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...