結果
問題 |
No.806 木を道に
|
ユーザー |
|
提出日時 | 2022-02-19 18:09:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 1,493 ms |
コンパイル使用メモリ | 168,292 KB |
実行使用メモリ | 8,972 KB |
最終ジャッジ日時 | 2024-06-29 10:35:05 |
合計ジャッジ時間 | 3,692 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; vector<int>G[101010]; int main(){ int N; cin>>N; int V=N; int E=N-1; for(int i=1;i<=E;i++){ int A,B; cin>>A>>B; G[A].push_back(B); G[B].push_back(A); } int answer=0; for(int i=1;i<=E;i++){ if(G[i].size()-2>=0)answer=answer+G[i].size()-2; } cout<<answer; }