Submission #1965788
Source Code Expand
//Be Name Khoda #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma optimize O3 using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long int LL; typedef LL ll; typedef long double ld; typedef string str; typedef pair<ll,ll> pll; typedef vector<ll> vll; typedef stringstream strs; #define X first #define Y second #define PB push_back #define For(i,a,b) for (int i=a;i<b;i++) #define Ford(i,a,b) for (int i=a;i>=b;i--) #define smax(a,b) a=max(a,b) #define smin(a,b) a=min(a,b) #define SZ(a) ((ll)a.size()) #define ER(a) cout << #a << ' ' << a << endl #define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a)) #define RET(x) { cout << x; exit(0); } #define RETD(x) { cout << fixed << setprecision(15) << x; exit(0); } const ll M=2e5+5,LG=32,SM=600+5,inf=1e18+5; ll mod=1e9+7; ll n; vll g[M]; ll dfs(ll x,ll p) { ll w=0,l=0; for (ll y:g[x]) { if (y==p) continue; if (dfs(y,x)) w^=1; else l^=1; } return w||l; } int main() { ios::sync_with_stdio(0); cin >> n; For(i,1,n) { ll x,y; cin >> x >> y; x--; y--; g[x].PB(y); g[y].PB(x); } if (dfs(0,0)) RET("Alice"); RET("Bob"); }
Submission Info
Submission Time | |
---|---|
Task | D - Game on Tree |
User | hamid_k |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1602 Byte |
Status | WA |
Exec Time | 46 ms |
Memory | 14336 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1100 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt, sample4.txt |
All | sample1.txt, sample2.txt, sample3.txt, sample4.txt, a1.txt, a10.txt, a11.txt, a12.txt, a13.txt, a14.txt, a15.txt, a16.txt, a17.txt, a18.txt, a19.txt, a2.txt, a20.txt, a21.txt, a22.txt, a23.txt, a24.txt, a25.txt, a26.txt, a27.txt, a28.txt, a29.txt, a3.txt, a30.txt, a4.txt, a5.txt, a6.txt, a7.txt, a8.txt, a9.txt, b1.txt, b2.txt, b3.txt, b4.txt, b5.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a1.txt | AC | 3 ms | 4992 KB |
a10.txt | WA | 6 ms | 5504 KB |
a11.txt | AC | 6 ms | 5504 KB |
a12.txt | AC | 6 ms | 5504 KB |
a13.txt | AC | 38 ms | 8704 KB |
a14.txt | AC | 38 ms | 8704 KB |
a15.txt | WA | 31 ms | 7936 KB |
a16.txt | WA | 39 ms | 8960 KB |
a17.txt | AC | 39 ms | 8960 KB |
a18.txt | AC | 42 ms | 8960 KB |
a19.txt | WA | 38 ms | 9856 KB |
a2.txt | WA | 4 ms | 4992 KB |
a20.txt | AC | 40 ms | 10112 KB |
a21.txt | WA | 32 ms | 9088 KB |
a22.txt | WA | 38 ms | 8704 KB |
a23.txt | WA | 42 ms | 8704 KB |
a24.txt | WA | 32 ms | 7936 KB |
a25.txt | WA | 39 ms | 8960 KB |
a26.txt | AC | 39 ms | 8960 KB |
a27.txt | AC | 38 ms | 8960 KB |
a28.txt | WA | 39 ms | 9856 KB |
a29.txt | AC | 42 ms | 10112 KB |
a3.txt | AC | 5 ms | 5120 KB |
a30.txt | AC | 33 ms | 9088 KB |
a4.txt | AC | 6 ms | 5376 KB |
a5.txt | WA | 6 ms | 5376 KB |
a6.txt | AC | 6 ms | 5376 KB |
a7.txt | AC | 6 ms | 5376 KB |
a8.txt | WA | 6 ms | 5376 KB |
a9.txt | WA | 6 ms | 5376 KB |
b1.txt | AC | 41 ms | 14336 KB |
b2.txt | AC | 40 ms | 11264 KB |
b3.txt | AC | 42 ms | 14336 KB |
b4.txt | WA | 46 ms | 11264 KB |
b5.txt | AC | 41 ms | 11264 KB |
sample1.txt | AC | 3 ms | 4992 KB |
sample2.txt | AC | 3 ms | 4992 KB |
sample3.txt | AC | 3 ms | 4992 KB |
sample4.txt | AC | 3 ms | 4992 KB |