結果
| 問題 | No.806 木を道に |
| コンテスト | |
| ユーザー |
yuruhiya
|
| 提出日時 | 2019-11-10 17:22:45 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 274 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 38,844 KB |
| 最終ジャッジ日時 | 2026-02-24 01:04:18 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 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);
}
yuruhiya