結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,800 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 16 ms
7,928 KB
testcase_04 AC 15 ms
7,888 KB
testcase_05 AC 15 ms
7,968 KB
testcase_06 AC 15 ms
7,876 KB
testcase_07 AC 15 ms
7,832 KB
testcase_08 AC 16 ms
7,800 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 16 ms
7,836 KB
testcase_12 AC 15 ms
7,932 KB
testcase_13 AC 16 ms
7,876 KB
testcase_14 WA -
testcase_15 AC 89 ms
30,004 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 91 ms
29,988 KB
testcase_19 AC 91 ms
30,072 KB
testcase_20 AC 90 ms
30,032 KB
testcase_21 AC 90 ms
30,044 KB
testcase_22 WA -
testcase_23 AC 90 ms
29,864 KB
testcase_24 AC 90 ms
30,052 KB
testcase_25 WA -
testcase_26 AC 90 ms
29,856 KB
testcase_27 WA -
testcase_28 AC 91 ms
29,924 KB
testcase_29 AC 93 ms
29,904 KB
testcase_30 AC 16 ms
7,932 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) % 2 == 0 else "NO")

0