結果
問題 |
No.806 木を道に
|
ユーザー |
![]() |
提出日時 | 2019-11-10 17:25:52 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 284 bytes |
コンパイル時間 | 1,298 ms |
コンパイル使用メモリ | 28,800 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 05:01:54 |
合計ジャッジ時間 | 2,031 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
#include <stdio.h> int n, a[100001], x, y, ans, i; int main() { scanf("%d", &n); for(i = 0; i < n - 1; ++i) { scanf("%d%d", &x, &y); a[x-1]++; a[y-1]++; } for(i = 0; i < n; ++i) { if (a[i] > 2)ans += a[i] - 2; } printf("%d\n", ans); }