結果

問題 No.482 あなたの名は
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-02-11 14:10:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 30,148 KB
最終ジャッジ日時 2023-08-28 12:53:12
合計ジャッジ時間 3,201 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,864 KB
testcase_01 AC 16 ms
8,004 KB
testcase_02 AC 15 ms
7,940 KB
testcase_03 AC 15 ms
7,924 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 16 ms
7,984 KB
testcase_06 AC 16 ms
7,880 KB
testcase_07 AC 15 ms
8,020 KB
testcase_08 AC 15 ms
7,984 KB
testcase_09 AC 15 ms
7,860 KB
testcase_10 AC 15 ms
8,008 KB
testcase_11 AC 16 ms
7,992 KB
testcase_12 AC 16 ms
7,956 KB
testcase_13 AC 16 ms
8,000 KB
testcase_14 WA -
testcase_15 AC 90 ms
30,060 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 91 ms
29,960 KB
testcase_19 AC 91 ms
30,100 KB
testcase_20 AC 91 ms
30,136 KB
testcase_21 AC 91 ms
30,084 KB
testcase_22 WA -
testcase_23 AC 90 ms
30,100 KB
testcase_24 AC 92 ms
30,084 KB
testcase_25 WA -
testcase_26 AC 92 ms
29,944 KB
testcase_27 WA -
testcase_28 AC 90 ms
30,004 KB
testcase_29 AC 92 ms
30,076 KB
testcase_30 AC 16 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

if __name__ == '__main__':
    n, k = map(int, input().split())
    ds = list(map(int, input().split()))

    cnt = sum(1 for i, d in enumerate(ds) if d != i + 1)
    t = math.ceil(cnt / 2)

    print("YES" if k >= t and (k - t) % 2 == 0 else "NO")

0