結果

問題 No.482 あなたの名は
ユーザー GrayCoderGrayCoder
提出日時 2018-06-24 20:28:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 31,360 KB
最終ジャッジ日時 2023-09-13 13:46:37
合計ジャッジ時間 3,081 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,792 KB
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 16 ms
7,716 KB
testcase_03 AC 15 ms
7,748 KB
testcase_04 AC 15 ms
7,776 KB
testcase_05 AC 15 ms
7,784 KB
testcase_06 AC 14 ms
7,784 KB
testcase_07 AC 16 ms
7,796 KB
testcase_08 AC 15 ms
7,824 KB
testcase_09 AC 15 ms
7,840 KB
testcase_10 AC 15 ms
7,716 KB
testcase_11 AC 15 ms
7,848 KB
testcase_12 AC 15 ms
7,776 KB
testcase_13 AC 15 ms
7,776 KB
testcase_14 WA -
testcase_15 AC 84 ms
31,220 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 85 ms
31,128 KB
testcase_19 AC 84 ms
31,300 KB
testcase_20 AC 85 ms
31,132 KB
testcase_21 AC 85 ms
31,204 KB
testcase_22 WA -
testcase_23 AC 84 ms
31,140 KB
testcase_24 AC 84 ms
31,136 KB
testcase_25 WA -
testcase_26 AC 85 ms
31,284 KB
testcase_27 WA -
testcase_28 AC 85 ms
31,240 KB
testcase_29 AC 85 ms
31,228 KB
testcase_30 AC 15 ms
7,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 = -(-diff // 2)
    if K >= ope and not (K - ope) % 2:
        write('YES\n')
    else:
        write('NO\n')

main()
0