結果
問題 |
No.2254 Reverse Only
|
ユーザー |
![]() |
提出日時 | 2025-04-15 22:57:31 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 608 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 82,004 KB |
実行使用メモリ | 150,136 KB |
最終ジャッジ日時 | 2025-04-15 22:59:02 |
合計ジャッジ時間 | 8,134 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 WA * 14 |
ソースコード
from collections import Counter n, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) if k == 1: if Counter(a) == Counter(b): print("Yes") else: print("No") else: if Counter(a) != Counter(b): print("No") else: if k % 2 == 0: print("Yes") else: if n >= k + 1: print("Yes") else: reversed_a = a[::-1] if b == a or b == reversed_a: print("Yes") else: print("No")