結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー bachoppibachoppi
提出日時 2020-01-31 23:03:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 922 bytes
コンパイル時間 960 ms
コンパイル使用メモリ 99,488 KB
実行使用メモリ 9,208 KB
最終ジャッジ日時 2023-10-17 11:58:33
合計ジャッジ時間 2,487 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define PI 3.141592653589793

int main(){
  int N; cin >> N; vector<int> to[N];
  rep(i, N-1){
    int u, v; cin >> u >> v;
    to[u].push_back(v); to[v].push_back(u);
  }
  int one=0, two=0;
  rep(i, N){
    if(to[i].size()==1) one++;
    else if(to[i].size()==2) two++; 
  }
  bool can = false;
  if(one==2 && two==N-2) can = true;
  if(two==N-1) can=true;
  if(can) cout << "Bob" << endl;
  else cout << "Alice" << endl;
}
0