HACK数据

P1468 [USACO2.2] 派对灯 Party Lamps

@[chen_zhe](/space/show?uid=8457)
by 恶灬心 @ 2018-11-15 19:10:24


@[恶灬心](/space/show?uid=74598) 这个答案是啥?
by Wisbtsml @ 2019-01-23 16:10:20


impossible?
by Wisbtsml @ 2019-01-23 16:10:47


YES
by PrincessQi @ 2019-02-05 10:35:28


# 这个好像没问题 ```cpp #include<bits/stdc++.h> using namespace std; string p[9]={"","000000","000111","101010","101101","010010","010101","111000","111111"}; int step[9]={0,1,3,1,1,2,1,2,0}; int n,t; int a[7]; bool ans=0; int main() { memset(a,-1,sizeof(a)); cin>>n>>t; int b=0; while(b!=-1) { cin>>b; if(b==-1) break; a[b%6]=1; } b=0; while(b!=-1) { cin>>b; if(b==-1) break; if(a[b%6]==1) { cout<<"IMPOSSIBLE"; return 0; } a[b%6]=0; } for(int i=1;i<=8;i++) { bool f=1; for(int l=0;l<6;l++) { if((a[l]!=-1&&a[l]!=p[i][l]-'0')||step[i]+1==t||step[i]>t) { f=0; break; } } if(f) { for(int l=1;l<=n;l++) cout<<p[i][l%6]; cout<<endl; ans=1; } } if(ans==0) cout<<"IMPOSSIBLE"; return 0; } ```
by 45dino @ 2020-02-11 14:09:54


|