結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-24 20:24:19 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 375 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 34,376 KB |
| 最終ジャッジ日時 | 2026-03-21 09:40:42 |
| 合計ジャッジ時間 | 6,599 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 10 |
ソースコード
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write
def main():
N, K = map(int, input().split())
D = tuple(map(int, input().split()))
diff = 0
for i, d in enumerate(D, start=1):
if i != d:
diff += 1
ope = max(0, diff - 1)
if K >= ope and not (K - ope) % 2:
write('YES\n')
else:
write('NO\n')
main()