結果
問題 | No.778 クリスマスツリー |
ユーザー |
![]() |
提出日時 | 2018-12-25 00:22:51 |
言語 | cLay (20241019-1) |
結果 |
AC
|
実行時間 | 73 ms / 2,000 ms |
コード長 | 233 bytes |
コンパイル時間 | 2,430 ms |
コンパイル使用メモリ | 174,856 KB |
実行使用メモリ | 30,976 KB |
最終ジャッジ日時 | 2024-07-05 13:16:31 |
合計ジャッジ時間 | 4,221 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
ll n,a[2d5],r;vector<ll> l[2d5];fenwick<ll> t;void f(ll i){t.add(i,1);r+=t.get(i-1);for(ll c:l[i]){f(c);}t.add(i,-1);}{rd(n,a(n-1));rep(i,1,n)l[a[i-1]].push_back(i);t.malloc(n);t.init(n);f(0);wt(r);}