QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#857272#9726. AUSWzy#WA 1ms3712kbC++14849b2025-01-15 14:46:492025-01-15 14:46:53

Judging History

This is the latest submission verdict.

  • [2025-01-15 14:46:53]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3712kb
  • [2025-01-15 14:46:49]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> PII;
const int N=5e5+10,M=2*N;
//const int mod=998244353;
const LL mod=1e9+7;
const LL INF=1e18+7;
//LL h[N],e[M],ne[M],idx



void solve(){
    string s1,s2,s3;
    cin>>s1>>s2>>s3;

    if(s1.size()!=s2.size()){
        cout<<"NO"<<endl;
        return;
    }


    if(s2.size()!=s3.size()){
        cout<<"YES"<<endl;
        return;
    }


    bool sg=false;


    for(int i=0;i<s1.size();i++){
        if(s1[i]==s3[i]) continue;
        if(s2[i]==s3[i]) continue;


        sg=true;
    }


    if(sg) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
 
 
 int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int T=1;
    cin>>T;
    
    while(T--) solve();
 
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3712kb

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

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

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