結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-10 23:21:09 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 398 bytes |
| 記録 | |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 15,376 KB |
| 最終ジャッジ日時 | 2026-06-03 00:43:59 |
| 合計ジャッジ時間 | 5,821 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 1 -- * 15 |
ソースコード
n, k = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]
def sort(d, k):
cnt = 0
for i in range(len(d)):
if d[i] == i + 1:
continue
j = d.index(min(d[i:]))
d[i], d[j] = d[j], d[i]
cnt += 1
if cnt > k:
return False
return (k - cnt) % 2 == 0
if sort(d, k):
print('YES')
else:
print('NO')