QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#660900 | #9350. Fixing Banners | ganking# | WA | 20ms | 3616kb | C++20 | 1.2kb | 2024-10-20 13:53:20 | 2024-10-20 13:53:21 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define db long double
#define mk make_pair
#define eb emplace_back
#define fo(i,a,b) for(ll (i)=(a);(i)<=(b);(i)++)
#define fd(i,a,b) for(ll (i)=(a);(i)>=(b);(i)--)
using namespace std;
const int N=1e5+10;
const int mo=1e9+7;
ll n,ans;
string s[10];
int mp[10][10],vis[10];
void dfs(int x){
if(ans==1) return ;
if(x==7){
ans=1;
return ;
}
fo(i,1,6) {
if(!vis[i] && mp[i][x]){
vis[i]=1;
dfs(x+1);
if(ans==1) return ;
vis[i]=0;
}
}
}
void solve(){
fo(i,1,6) {
cin>>s[i];
vis[i]=0;
fo(j,0,5) mp[i][j]=0;
fo(j,0,s[i].length()-1) {
if(s[i][j]=='h') mp[i][1]=1;
if(s[i][j]=='a') mp[i][2]=1;
if(s[i][j]=='r') mp[i][3]=1;
if(s[i][j]=='b') mp[i][4]=1;
if(s[i][j]=='i') mp[i][5]=1;
if(s[i][j]=='n') mp[i][6]=1;
}
}
dfs(1);
if(ans==1) cout<<"Yes\n";
else cout<<"No\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int T;
cin>>T;
while(T--) solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3608kb
input:
2 welcome toparticipate inthe ccpccontest inharbin inoctober harvest belong ninja reset amazing intriguing
output:
No Yes
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 20ms
memory: 3616kb
input:
50000 dwwfplbjd elulqfmsp whobggs kbnhtvzcs zllux ggye vtnqpmvi cgsplau gkuwhhmrio sp q utrefny tvdcequdjj klesyx esovlmdy x nywu gklfbqfb ysnaswszfq ouo tq r auvi copeabvz nruvawao cdv vdsk hboecpit s ewscbmb jeqp gel u htk fcoigxbux ylinyzut bnhrvoetf xa ehnbce keyk efvzoyba xan tvnlm tetpijfh blq...
output:
No No No No No No No No No No No No No No No No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Ye...
result:
wrong answer 20th lines differ - expected: 'No', found: 'Yes'