結果

問題 No.2254 Reverse Only
ユーザー sotanishysotanishy
提出日時 2023-03-24 21:48:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 114,856 KB
最終ジャッジ日時 2023-10-18 20:58:14
合計ジャッジ時間 7,563 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,452 KB
testcase_01 AC 38 ms
53,452 KB
testcase_02 AC 38 ms
53,452 KB
testcase_03 AC 37 ms
53,452 KB
testcase_04 AC 38 ms
53,452 KB
testcase_05 AC 38 ms
53,452 KB
testcase_06 AC 38 ms
53,452 KB
testcase_07 AC 38 ms
53,452 KB
testcase_08 AC 196 ms
113,276 KB
testcase_09 WA -
testcase_10 AC 125 ms
110,236 KB
testcase_11 AC 194 ms
113,292 KB
testcase_12 AC 190 ms
113,668 KB
testcase_13 AC 201 ms
113,232 KB
testcase_14 AC 197 ms
113,860 KB
testcase_15 AC 202 ms
114,856 KB
testcase_16 AC 195 ms
112,060 KB
testcase_17 AC 194 ms
113,888 KB
testcase_18 AC 190 ms
113,860 KB
testcase_19 AC 174 ms
113,448 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 133 ms
110,252 KB
testcase_25 AC 136 ms
111,408 KB
testcase_26 AC 135 ms
111,408 KB
testcase_27 AC 44 ms
61,496 KB
testcase_28 AC 70 ms
79,632 KB
testcase_29 AC 115 ms
103,372 KB
testcase_30 AC 103 ms
97,204 KB
testcase_31 AC 74 ms
81,344 KB
testcase_32 AC 79 ms
85,472 KB
testcase_33 AC 56 ms
70,964 KB
testcase_34 AC 135 ms
105,108 KB
testcase_35 AC 97 ms
95,456 KB
testcase_36 AC 172 ms
106,704 KB
testcase_37 AC 182 ms
107,544 KB
testcase_38 AC 65 ms
75,820 KB
testcase_39 AC 162 ms
103,148 KB
testcase_40 AC 45 ms
61,496 KB
testcase_41 AC 91 ms
91,184 KB
testcase_42 AC 68 ms
78,052 KB
testcase_43 AC 140 ms
102,840 KB
testcase_44 AC 188 ms
111,788 KB
testcase_45 AC 130 ms
101,936 KB
testcase_46 AC 43 ms
61,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

if sorted(A) != sorted(B):
    print("No")
elif A == B:
    print("Yes")
elif k > N:
    print("No")
elif k <= N-1:
    # rotation + swap
    print("Yes")
else:
    # k == N
    print("Yes" if A[::-1] == B else "No")
0