結果
| 問題 |
No.2346 Replace!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-09 22:58:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 276 bytes |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2025-01-02 04:50:54 |
| 合計ジャッジ時間 | 5,355 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 WA * 48 |
ソースコード
T=int(input())
for i in range(T):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
cnt=0
for j in range(N):
if A[j]!=B[j]:
#print(i,A[A[j]])
if A[A[j]-1]!=B[j]:
cnt+=1
else:
A[j]=B[j]
print("Yes" if cnt==0 else "No")