結果
| 問題 | No.1878 union-find の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-18 22:08:23 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 412 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 80,384 KB |
| 実行使用メモリ | 89,472 KB |
| 最終ジャッジ日時 | 2026-09-09 14:17:24 |
| 合計ジャッジ時間 | 1,879 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 13 |
ソースコード
import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd
input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())
mod = 998244353
N = int(input())
parent = [-1]
for _ in range(N-1):
p = int(input())
assert 1 <= p <= N
parent.append(p-1)