QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#745513#9726. AUSPinkychowWA 1ms3640kbC++17698b2024-11-14 10:25:172024-11-14 10:25:17

Judging History

This is the latest submission verdict.

  • [2024-11-14 10:25:17]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3640kb
  • [2024-11-14 10:25:17]
  • Submitted

answer

#include<bits/stdc++.h>
#define endl '\n' 
using i64 = long long;
using namespace std;
signed main(){
    std::ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int T;
    cin >> T;
    while(T--){
        string a, b, c;
        cin >> a >> b >> c;
        if(a.size()!=b.size()){
            cout << "NO" << endl;
            continue;
        }
        if(a.size()!=c.size()){
            cout << "YES" << endl;
            continue;
        }
        int n = a.size();
        bool ok = 1;
        for (int i = 0; i < n;i++)
            if(c[i]!=a[i]&&c[i]!=b[i])
                ok = 0;
        cout << (!ok ? "YES" : "NO") << endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 1ms
memory: 3640kb

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

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