結果

問題 No.2346 Replace!!
ユーザー satousatou
提出日時 2023-06-09 23:35:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 1,054 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 9,124 KB
最終ジャッジ日時 2023-08-30 14:44:27
合計ジャッジ時間 5,196 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,948 KB
testcase_01 AC 65 ms
7,944 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 17 ms
7,992 KB
testcase_29 AC 18 ms
8,516 KB
testcase_30 AC 18 ms
8,324 KB
testcase_31 AC 22 ms
8,852 KB
testcase_32 AC 19 ms
8,952 KB
testcase_33 AC 21 ms
8,880 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 19 ms
8,920 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 19 ms
8,724 KB
testcase_41 AC 20 ms
8,992 KB
testcase_42 AC 20 ms
8,924 KB
testcase_43 AC 21 ms
8,876 KB
testcase_44 AC 21 ms
9,008 KB
testcase_45 AC 19 ms
8,912 KB
testcase_46 AC 19 ms
8,928 KB
testcase_47 AC 19 ms
9,012 KB
testcase_48 AC 19 ms
8,964 KB
testcase_49 AC 19 ms
9,012 KB
testcase_50 AC 19 ms
8,760 KB
testcase_51 AC 21 ms
8,748 KB
testcase_52 AC 20 ms
8,752 KB
testcase_53 AC 18 ms
8,536 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 AC 21 ms
8,876 KB
testcase_58 AC 19 ms
9,016 KB
testcase_59 WA -
testcase_60 AC 20 ms
8,952 KB
testcase_61 AC 21 ms
8,996 KB
testcase_62 AC 19 ms
9,036 KB
testcase_63 WA -
testcase_64 AC 21 ms
8,976 KB
testcase_65 WA -
testcase_66 AC 22 ms
9,012 KB
testcase_67 AC 21 ms
8,976 KB
testcase_68 AC 21 ms
9,028 KB
testcase_69 AC 21 ms
9,068 KB
testcase_70 AC 22 ms
9,032 KB
testcase_71 AC 21 ms
8,984 KB
testcase_72 AC 21 ms
8,732 KB
testcase_73 AC 21 ms
8,940 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]:
					if B[A[j]-1]!=B[j]:
						cnt+=1
			#else:
		#		A[j]=B[j]
	print("Yes" if cnt==0 else "No")
	
0