結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,744 KB
testcase_01 AC 15 ms
7,904 KB
testcase_02 AC 15 ms
7,916 KB
testcase_03 AC 14 ms
7,732 KB
testcase_04 AC 15 ms
7,788 KB
testcase_05 AC 14 ms
7,852 KB
testcase_06 AC 16 ms
7,764 KB
testcase_07 WA -
testcase_08 AC 14 ms
7,908 KB
testcase_09 WA -
testcase_10 AC 15 ms
7,916 KB
testcase_11 AC 15 ms
7,752 KB
testcase_12 WA -
testcase_13 AC 15 ms
7,900 KB
testcase_14 AC 15 ms
7,764 KB
testcase_15 WA -
testcase_16 AC 108 ms
29,944 KB
testcase_17 AC 107 ms
29,916 KB
testcase_18 AC 108 ms
29,836 KB
testcase_19 WA -
testcase_20 AC 106 ms
29,840 KB
testcase_21 WA -
testcase_22 AC 108 ms
30,012 KB
testcase_23 WA -
testcase_24 AC 107 ms
29,920 KB
testcase_25 WA -
testcase_26 AC 107 ms
29,836 KB
testcase_27 WA -
testcase_28 AC 107 ms
30,032 KB
testcase_29 AC 106 ms
29,840 KB
testcase_30 AC 15 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]

def count(d):
    cnt = 0
    for i in range(len(d)):
        if d[i] == i + 1:
            cnt += 1
    return cnt

cnt = count(d)
rcnt = count(list(reversed(d)))
l = len(d)
tmp = 0
if cnt == l:
    tmp = 0
elif rcnt == l:
    tmp = len(d) // 2
else:
    tmp = len(d) - 1 - cnt

if (k - tmp) % 2 == 0:
    print('YES')
else:
    print('NO')
0