QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#785693 | #9726. AUS | xyggzsf# | WA | 0ms | 3648kb | C++14 | 1.6kb | 2024-11-26 18:50:04 | 2024-11-26 18:50:07 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
#define int long long
typedef pair<int, int>pii;
typedef pair<char, int>pci;
typedef pair<int, pii>piii;
const int mod = 998244353;
const int N = 5e5 + 100;
int ksm(int a, int b) { if (a == 0 && b == 0)return 1; int ans = 1; while (b) { if (b % 2)ans = (ans * a) % mod; a = (a * a) % mod; b >>= 1; }return ans; }
int sqrtt(int x) { int l = 0, r = 3e9; while (l < r) { int mid = (l + r + 1) >> 1; if (mid * mid == x)return mid; else if (mid * mid > x)r = mid - 1; else l = mid; }return l; }
void solve()
{
string a, b, c; cin >> a >> b >> c;
if (a.size() != b.size())cout << "NO" << endl;
else
{
if (a.size() != c.size())
{
cout << "YES" << endl;
return;
}
map<char, char>ct;
for (int i = 0; i < a.size(); i++)
{
if (ct.count(a[i]))
{
if (ct[a[i]] != b[i])
{
cout << "NO" << endl;
return;
}
}
else
{
ct[a[i]] = b[i];
}
}
for(int i=0;i<c.size();i++)
{
if (ct.count(c[i]))
{
c[i] = ct[c[i]];
}
}
if (c == b)
{
cout << "NO" << endl;
return;
}
cout << "YES" << endl;
}
}
signed main()
{
ios::sync_with_stdio(0); cout.tie(0); cin.tie(0);
int t = 1;
cin >> t;
while (t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
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: 3524kb
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: 0ms
memory: 3648kb
input:
100 dntfvviytogwqljvoksaovstrqwpovkncxvmytnvcaoikctmgukaxlivmwahenydtswyowpdvggeeyzykdiojltpxuzzwphdqfsh anbbtriynochhmrtsmjifvatlfsmwiimvxbmyoavcmfiioxatckaxcikmwazenjmdleyjwndvggqkazikdeofaqpbuzkupshfhgh anbflviytfylqlpvvmjaovajllwpoukmvwemgtivvaonkoxagukaxriyuvmypnymtdqyocpdvcgqkazykrihjbipxquzup...
output:
YES NO NO NO NO NO NO NO NO YES NO NO NO NO NO NO NO NO YES NO NO NO YES NO YES NO NO NO NO NO NO NO NO NO NO YES NO NO NO NO NO NO NO NO NO NO NO NO NO YES NO NO YES NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO YES NO NO ...
result:
wrong answer 2nd lines differ - expected: 'YES', found: 'NO'