QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#792423#9726. AUSshengZzzWA 0ms3588kbC++20747b2024-11-29 10:06:482024-11-29 10:06:51

Judging History

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

  • [2024-11-29 10:06:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3588kb
  • [2024-11-29 10:06:48]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
using namespace std;

void solve(){
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    int len1=s1.length(),len2=s2.length(),len3=s3.length();
    if(len1!=len2){
        cout<<"NO"<<"\n";
        return;
    }
    if(len3!=len1){
        cout<<"YES"<<"\n";
        return;
    }
    int cnt=0;
    for(int i=0;i<len1;i++){
        if(s3[i]==s1[i] || s3[i]==s2[i]) ++cnt;
    }
    if(cnt==len1) cout<<"NO"<<"\n";
    else cout<<"YES"<<"\n";

}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T=1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}

/*
 2
 4 2
 3 6
 1 3
 2 7
 5 6
 2 5
 2 4
 6 8

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

4
abab
cdcd
abce
abab
cdcd
abcd
abab
cdcd
abc
x
yz
def

output:

YES
NO
YES
NO

result:

ok 4 lines

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3536kb

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

wrong answer 1st lines differ - expected: 'NO', found: 'YES'