結果
問題 |
No.806 木を道に
|
ユーザー |
👑 |
提出日時 | 2022-05-02 18:33:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 324 bytes |
コンパイル時間 | 678 ms |
コンパイル使用メモリ | 72,672 KB |
最終ジャッジ日時 | 2025-01-29 01:56:36 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 9 WA * 8 RE * 10 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int n;cin>>n; vector<int> B[n]; for(int i = 0; n-1 > i; i++){ int s,v;cin>>s>>v; B[s].push_back(v); B[v].push_back(s); } int ans = 0; for(int i = 0; n > i; i++){ ans += max(0,(int)B[i].size()-2); } cout << ans << endl; }