結果
問題 |
No.977 アリス仕掛けの摩天楼
|
ユーザー |
![]() |
提出日時 | 2020-03-20 05:46:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,218 bytes |
コンパイル時間 | 1,779 ms |
コンパイル使用メモリ | 167,756 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 03:58:01 |
合計ジャッジ時間 | 2,824 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() const ll MOD = 1000000007ll; #define FIX(a) ((a)%MOD+MOD)%MOD const int N = 10e4+5; int n; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>n; int bridges[N]={}; REP(i,n-1){ int u,v; cin>>u>>v; bridges[u]++; bridges[v]++; } bool flg = false; int cnt = 0; REP(i,n){ if(!flg&&bridges[i]==1){ flg=true; cnt++; } else if(bridges[i]==0){ cnt++; } if(cnt>=2){ cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; return 0; }