結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-02-14 23:02:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 2,000 ms |
| + 25µs | |
| コード長 | 280 bytes |
| 記録 | |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 95,976 KB |
| 実行使用メモリ | 119,384 KB |
| 最終ジャッジ日時 | 2026-08-23 05:52:09 |
| 合計ジャッジ時間 | 5,462 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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")
convexineq