結果

問題 No.2346 Replace!!
ユーザー satousatou
提出日時 2023-06-09 22:58:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 8,996 KB
最終ジャッジ日時 2023-08-30 14:09:50
合計ジャッジ時間 5,948 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,908 KB
testcase_01 AC 65 ms
7,876 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 16 ms
7,800 KB
testcase_29 AC 18 ms
8,540 KB
testcase_30 AC 17 ms
8,220 KB
testcase_31 WA -
testcase_32 AC 18 ms
8,728 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 19 ms
8,908 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 19 ms
8,756 KB
testcase_41 WA -
testcase_42 AC 20 ms
8,732 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 19 ms
8,736 KB
testcase_46 AC 18 ms
8,844 KB
testcase_47 AC 18 ms
8,780 KB
testcase_48 AC 19 ms
8,828 KB
testcase_49 AC 18 ms
8,784 KB
testcase_50 AC 19 ms
8,756 KB
testcase_51 AC 19 ms
8,812 KB
testcase_52 AC 19 ms
8,676 KB
testcase_53 AC 17 ms
8,516 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 18 ms
8,868 KB
testcase_59 WA -
testcase_60 AC 19 ms
8,896 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 AC 20 ms
8,812 KB
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 20 ms
8,832 KB
testcase_70 AC 20 ms
8,828 KB
testcase_71 AC 21 ms
8,784 KB
testcase_72 AC 20 ms
8,828 KB
testcase_73 AC 20 ms
8,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0