結果
| 問題 | No.2254 Reverse Only |
| コンテスト | |
| ユーザー |
sotanishy
|
| 提出日時 | 2023-03-24 21:48:20 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 362 bytes |
| 記録 | |
| コンパイル時間 | 334 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 138,240 KB |
| 最終ジャッジ日時 | 2026-04-06 18:14:04 |
| 合計ジャッジ時間 | 5,789 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 42 WA * 5 |
ソースコード
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")
sotanishy