QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#859349#9726. AUSChief_NingWA 1ms3712kbC++141.9kb2025-01-17 17:43:212025-01-17 17:43:22

Judging History

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

  • [2025-01-17 17:43:22]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3712kb
  • [2025-01-17 17:43:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl "\n"
#define For(l,r) for(int i=l;i<r;i++)
#define pq priority_queue<int>
#define yes void(cout << "YES" << endl)
#define no void(cout << "NO" << endl)
#define rep(i,a,n) for(int i=a;i<n;i++)
#define debug(x) cerr<<#x<<"="<<(x)<<"\n";
#define all(x) (x).begin(), (x).end()
const int INF = 0x3f3f3f3f;//无穷大
const int inf = 0xc0c0c0c0;//无穷小
const int MOD = 1;
const int N = 1;
inline int nxt() {
    int x;
    cin >> x;
    return x;
}
/*
 ________  ___  ___  ___  _______   ________ ________   ___  ________   ________
|\   ____\|\  \|\  \|\  \|\  ___ \ |\  _____\\   ___  \|\  \|\   ___  \|\   ____\
\ \  \___|\ \  \\\  \ \  \ \   __/|\ \  \__/\ \  \\ \  \ \  \ \  \\ \  \ \  \___|
 \ \  \    \ \   __  \ \  \ \  \_|/_\ \   __\\ \  \\ \  \ \  \ \  \\ \  \ \  \  ___
  \ \  \____\ \  \ \  \ \  \ \  \_|\ \ \  \_| \ \  \\ \  \ \  \ \  \\ \  \ \  \|\  \
   \ \_______\ \__\ \__\ \__\ \_______\ \__\   \ \__\\ \__\ \__\ \__\\ \__\ \_______\
    \|_______|\|__|\|__|\|__|\|_______|\|__|    \|__| \|__|\|__|\|__| \|__|\|_______|
                                                                                     */



void ChiefNing()
{
    string s1,s2,s3;
    //1==2!=3
    cin>>s1>>s2>>s3;
    int n1=s1.size(),n2=s2.size(),n3=s3.size();
    if(n1==n2&&n1!=n3){
        yes;
        return ;
    }
    if(n1!=n2){
        no;
        return ;
    }
    if(s1==s2&&s1!=s3){
        yes;
        return ;
    }
    map<char,char> mp;
    for(char i='a';i<='z';i++)mp[i]=i;
    for(int i=0;i<n1;i++){
        if(s1[i]!=s2[i]){
            mp[s1[i]]=s2[i];
        }
    }
    for(auto &t:s3){
        t=mp[t];
    }
    if(s2==s3)no;
    else yes;
}
signed main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int _;
    cin>>_;
    while(_--)
        ChiefNing();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
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: 1ms
memory: 3712kb

input:

10
ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES

result:

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