結果

問題 No.482 あなたの名は
ユーザー magurogumamaguroguma
提出日時 2017-08-17 18:51:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,280 KB
最終ジャッジ日時 2024-04-22 14:51:04
合計ジャッジ時間 4,377 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,880 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 WA -
testcase_06 AC 30 ms
10,752 KB
testcase_07 WA -
testcase_08 AC 30 ms
10,880 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 WA -
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 30 ms
10,752 KB
testcase_15 AC 161 ms
29,548 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 155 ms
29,420 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 156 ms
29,548 KB
testcase_23 WA -
testcase_24 AC 154 ms
29,420 KB
testcase_25 WA -
testcase_26 AC 154 ms
30,148 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 163 ms
30,280 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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