結果
| 問題 | No.3798 algo to goal |
| ユーザー |
sig
|
| 提出日時 | 2026-11-13 23:00:32 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 991 bytes |
| 記録 | |
| コンパイル時間 | 106 ms |
| コンパイル使用メモリ | 64,512 KB |
| 実行使用メモリ | 69,376 KB |
| 最終ジャッジ日時 | 2026-11-13 23:00:49 |
| 合計ジャッジ時間 | 14,245 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 32 |
ソースコード
q = 1
q = int(input())
for _ in range(q):
s = input()
t = input()
n = len(s)
cou = [0]*26
for i in s:
cou[ord(i) - ord('a')] += 1
for i in t:
cou[ord(i) - ord('a')] -= 1
tf = False
for i in range(26):
if cou[i]:
tf = True
break
if n%2:
c1 = [0]*26
c2 = [0]*26
for i in range(n):
if i%2 == 0:
c1[ord(s[i]) - ord('a')] += 1
c1[ord(t[i]) - ord('a')] -= 1
else:
c2[ord(s[i]) - ord('a')] += 1
c2[ord(t[i]) - ord('a')] -= 1
for i in range(26):
if c1[i]:
tf = True
break
if c2[i]:
tf = True
break
else:
c = [0]*676
for i in range(0,n,2):
c11 = ord(s[i]) - ord('a')
c12 = ord(s[i+1]) - ord('a')
c21 = ord(t[i]) - ord('a')
c22 = ord(t[i+1]) - ord('a')
c[c11*26+c12] += 1
c[c21*26+c22] -= 1
for i in c:
if i:
tf = True
break
if tf:
print("No")
else:
print("Yes")
sig