結果
問題 |
No.482 あなたの名は
|
ユーザー |
![]() |
提出日時 | 2021-02-14 23:02:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 98 ms / 2,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 111,104 KB |
最終ジャッジ日時 | 2024-07-22 10:56:03 |
合計ジャッジ時間 | 3,707 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n,k = map(int,input().split()) *a, = map(int,input().split()) for i in range(n): a[i] -= 1 c = 0 for i in range(n): if a[i] < 0: continue c += 1 while a[i] >= 0: ni = a[i] a[i] = -1 i = ni print("YES" if k >= n-c and (k-n+c)%2==0 else "NO")