結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー CleyLCleyL
提出日時 2020-01-31 21:28:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 70,148 KB
実行使用メモリ 9,248 KB
最終ジャッジ日時 2023-10-17 08:43:20
合計ジャッジ時間 2,236 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,012 KB
testcase_01 AC 4 ms
6,072 KB
testcase_02 AC 4 ms
6,072 KB
testcase_03 AC 4 ms
6,072 KB
testcase_04 AC 4 ms
6,072 KB
testcase_05 AC 4 ms
6,076 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 4 ms
6,076 KB
testcase_09 AC 4 ms
6,076 KB
testcase_10 AC 4 ms
6,076 KB
testcase_11 AC 4 ms
6,076 KB
testcase_12 AC 4 ms
6,076 KB
testcase_13 WA -
testcase_14 AC 10 ms
6,352 KB
testcase_15 AC 10 ms
6,352 KB
testcase_16 WA -
testcase_17 AC 11 ms
6,388 KB
testcase_18 WA -
testcase_19 AC 27 ms
7,012 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 99 ms
9,244 KB
testcase_24 AC 84 ms
9,248 KB
testcase_25 AC 90 ms
9,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n;cin>>n;
  vector<int> A[100000];
  for(int i = 0; n-1 > i; i++){
    int a,b;cin>>a>>b;
    A[a].push_back(b);
    A[b].push_back(a);
  }
  int nw = 0;
  bool z = false;
  for(int i = 0; n > i; i++){
    if(0 == A[i].size()){
      nw++;
    }else if(1 == A[i].size()){
      z = true;
    }
  }
  if(nw+z > 1){
    cout << "Alice" << endl;
  }else{
    cout << "Bob" << endl;
  }
}
0