結果

問題 No.482 あなたの名は
ユーザー maguroguma
提出日時 2017-08-17 18:51:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 30,280 KB
最終ジャッジ日時 2024-10-14 13:54:56
合計ジャッジ時間 4,417 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N,K = map(int, input().split())
D = list(map(int, input().split()))

c1 = 0
c2 = 0
for i,d in zip(range(1,N+1), D):
    if i!=d:
        if i!=D[d-1]:
            c1 += 1
        else:
            c2 += 1
total = c1 + c2//2

if (K-total)%2==0:
    print('YES')
else:
    print('NO')
0