QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#645927#9350. Fixing BannersqkyWA 0ms3848kbC++171.1kb2024-10-16 20:29:182024-10-16 20:29:20

Judging History

你现在查看的是最新测评结果

  • [2024-10-16 20:29:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3848kb
  • [2024-10-16 20:29:18]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void 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
Wrong Answer
time: 0ms
memory: 3848kb

input:

2
welcome
toparticipate
inthe
ccpccontest
inharbin
inoctober
harvest
belong
ninja
reset
amazing
intriguing

output:

Yes
Yes

result:

wrong answer 1st lines differ - expected: 'No', found: 'Yes'