結果

問題 No.806 木を道に
ユーザー onakaT_TitaionakaT_Titai
提出日時 2019-03-22 22:28:32
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 55,672 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 09:45:50
合計ジャッジ時間 2,291 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 13 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 50 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 50 ms
4,348 KB
testcase_16 AC 18 ms
4,348 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 14 ms
4,348 KB
testcase_20 AC 42 ms
4,348 KB
testcase_21 AC 25 ms
4,348 KB
testcase_22 AC 57 ms
4,348 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int v[100005];

int main(void){
    int N; cin >> N;
    for (int i = 0; i < N; i++){
        int a, b; cin >> a >> b;
        v[a]++;
        v[b]++;
    }
    int ans = 0;
    for (int i = 1; i <= N; i++){
        if (v[i] == 1) ans++;
    }
    cout << ans-2 << endl;
}
0