結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,732 KB
testcase_01 AC 14 ms
7,876 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 AC 16 ms
7,764 KB
testcase_05 AC 15 ms
7,696 KB
testcase_06 AC 15 ms
7,700 KB
testcase_07 WA -
testcase_08 AC 15 ms
7,764 KB
testcase_09 AC 15 ms
7,732 KB
testcase_10 AC 16 ms
7,716 KB
testcase_11 AC 15 ms
7,760 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
7,928 KB
testcase_15 WA -
testcase_16 AC 83 ms
31,212 KB
testcase_17 AC 83 ms
31,360 KB
testcase_18 AC 84 ms
31,156 KB
testcase_19 WA -
testcase_20 AC 84 ms
31,380 KB
testcase_21 WA -
testcase_22 AC 84 ms
31,212 KB
testcase_23 WA -
testcase_24 AC 85 ms
31,332 KB
testcase_25 WA -
testcase_26 AC 86 ms
31,324 KB
testcase_27 WA -
testcase_28 AC 84 ms
31,216 KB
testcase_29 WA -
testcase_30 AC 15 ms
7,732 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 = max(0, diff - 1)
    if K >= ope and not (K - ope) % 2:
        write('YES\n')
    else:
        write('NO\n')

main()
0