QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#750318#9726. AUShhdhh#WA 0ms3624kbC++23848b2024-11-15 14:04:402024-11-15 14:04:40

Judging History

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

  • [2024-11-15 14:04:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-11-15 14:04:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define per(i, a, b) for(int i = (a); i >= (b); i--)
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
typedef pair<ll, ll> pll;

void solve()
{
    string a, b, c;
    cin >> a >> b >> c;
    bool f = 1;
    rep(i, 0, sz(c) - 1) {
        if(c[i] != a[i] && c[i] != b[i]) {
            f = 0;
            break;
        }
    }
    if((sz(a) != sz(b)) || (f && sz(c) == sz(a))) {
        cout << "NO" << endl;
    }
    else {
        cout << "YES" << endl;
    }
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3624kb

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

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