QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#801125 | #9726. AUS | Proaes | WA | 1ms | 3840kb | C++11 | 778b | 2024-12-06 18:29:57 | 2024-12-06 18:29:58 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i=(a);i<=(b);i++)
const int N=1005;
char s1[N],s2[N],s3[N];
int bcj[26];
int ask(int x){return bcj[x]?bcj[x]=ask(bcj[x]):x;}
void Main()
{
scanf("%s",s1);
scanf("%s",s2);
scanf("%s",s3);
int n=strlen(s1),n2=strlen(s2),n3=strlen(s3);
if(n2!=n){printf("NO\n"); return;}
if(n3!=n){printf("YES\n"); return;}
fill(bcj,bcj+26,0);
For(i,0,n-1)
{
int x=ask(s1[i]-'a'),y=ask(s2[i]-'a');
if(x!=y)bcj[x]=y;
}
For(i,0,n-1)
if(ask(s1[i]-'a')!=ask(s3[i]-'a'))
{
printf("YES\n");
return;
}
printf("NO\n");
}
int main()
{
int t;
scanf("%d",&t);
while(t--)Main();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3840kb
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: 0
Accepted
time: 0ms
memory: 3780kb
input:
10 ekkzjwextuoazxsosiiiditwrjiztfvxtzaztmdfhxroaqkjcdgsgiitkfglcrtgjquspjyjtodyhxetldbhvxampcvbinzgksxkunduhvbddakqswurshbnuazthfnxmsuyypznmxmatsnvpqovscnkkcjphtcmcsqteeikwggnugskjjwttvlrxmmrkyltxjhfiqicttcfumurdrmiqauruywgdomxxpbeunliyvsutrneexoyckjflhnmmaaovxubnptlemptxbhrflbnfcowktydgbugdxvkvegza...
output:
NO NO NO NO NO NO NO NO NO NO
result:
ok 10 lines
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3836kb
input:
100 dntfvviytogwqljvoksaovstrqwpovkncxvmytnvcaoikctmgukaxlivmwahenydtswyowpdvggeeyzykdiojltpxuzzwphdqfsh anbbtriynochhmrtsmjifvatlfsmwiimvxbmyoavcmfiioxatckaxcikmwazenjmdleyjwndvggqkazikdeofaqpbuzkupshfhgh anbflviytfylqlpvvmjaovajllwpoukmvwemgtivvaonkoxagukaxriyuvmypnymtdqyocpdvcgqkazykrihjbipxquzup...
output:
YES YES NO NO NO YES NO NO NO YES NO NO YES NO YES NO YES YES YES YES YES NO YES NO YES NO NO NO NO NO YES NO NO NO NO YES NO YES NO NO YES NO YES NO NO YES NO YES YES YES NO NO YES NO NO YES NO NO NO YES NO NO YES NO NO YES YES NO YES NO NO NO YES YES NO NO YES YES YES NO YES NO NO YES NO YES NO NO...
result:
wrong answer 6th lines differ - expected: 'NO', found: 'YES'