QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#751118#9726. AUSsdnuwy#WA 0ms3752kbC++201.0kb2024-11-15 17:09:182024-11-15 17:09:19

Judging History

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

  • [2024-11-15 17:09:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3752kb
  • [2024-11-15 17:09:18]
  • 提交

answer

//Think twice,code once.
#include<bits/stdc++.h>
#define endl '\n'
#define int long long
#define INF 0x3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define ff first
#define ss second
#define pii pair<int,int>
#define mem(i,n) memset(i,n,sizeof i)
#define dg(a) std::cout << #a << " = " << a << endl
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

void solve()
{
    string s1,s2,s3;
    cin >> s1 >> s2 >> s3;
    int n=s1.size();
    if(s2.size()!=n)
    {
        cout << "NO" << endl;
        return;
    }
    if(s3.size()!=n)
    {
        cout << "YES" << endl;
        return;
    }
    for(int i=0;i<n;i++)
    {
        if(s3[i]!=s1[i]&&s3[i]!=s2[i])
        {
            cout << "YES" << endl;
            return;
        }
    }
    cout << "NO" << endl;
}

int32_t main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int t = 1;
    std::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: 3752kb

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

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

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