結果

問題 No.482 あなたの名は
ユーザー k-mats
提出日時 2017-02-10 23:49:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 29,700 KB
最終ジャッジ日時 2024-12-29 07:40:32
合計ジャッジ時間 4,392 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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