QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#645919 | #9350. Fixing Banners | qky | RE | 0ms | 0kb | C++17 | 1.1kb | 2024-10-16 20:28:00 | 2024-10-16 20:28:00 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool check(char c,int s[][7],int i) {
if(c=='h')s[i][1]=1;
if(c=='a')s[i][2]=1;
if(c=='r')s[i][3]=1;
if(c=='b')s[i][4]=1;
if(c=='i')s[i][5]=1;
if(c=='n')s[i][6]=1;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t;
cin >> t;
while (t--) {
int s[7][7];
for(int i=1;i<=6;i++){
string t;cin>>t;
for(int j=0;j<t.size();j++){
check(t[j],s,i);
}
}
int a[7],b[7];
for(int i=1;i<=6;i++){
for(int j=1;j<=6;j++){
if(s[i][j]==1){
a[i]++;
}
if(s[j][i]==1){
b[i]++;
}
}
}
int judge=1;
for(int i=1;i<=6;i++){
if(a[i]==0||b[i]==0){
judge=0;
break;
}
}
if(judge==1){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
2 welcome toparticipate inthe ccpccontest inharbin inoctober harvest belong ninja reset amazing intriguing