ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#197304 | #3429. 双人博弈 | Zeardoe | 100 | 63ms | 2032kb | C++11 | 1.8kb | 2023-11-11 08:36:19 | 2023-11-11 13:00:42 |
answer
/*
[templates]:
duipai
spjdp
compre
addhis
floor_sum
treedfs
matrix
network_flow
polynomial
lca
bitset
valuesgt
fenwick
erbitree
*/
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//use ll instead of int.
#define f(i, a, b) for(int i = (a); i <= (b); i++)
#define cl(i, n) i.clear(),i.resize(n);
#define endl '\n'
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int inf = 1e18;
//#define cerr if(false)cerr
//#define freopen if(false)freopen
mt19937 rng(time(0));
int rnd(int l, int r) {return rng() % (r-l+1) + l; }
#define watch(x) cerr << (#x) << ' '<<'i'<<'s'<<' ' << x << endl
void pofe(int number, int bitnum) {
string s; f(i, 0, bitnum) {s += char(number & 1) + '0'; number >>= 1; }
reverse(s.begin(), s.end()); cerr << s << endl;
return;
}
template <typename TYP> void cmax(TYP &x, TYP y) {if(x < y) x = y;}
template <typename TYP> void cmin(TYP &x, TYP y) {if(x > y) x = y;}
//调不出来给我对拍!
//use std::array.
const int N = 200000;
int a[N + 10];
signed main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
//freopen();
//freopen();
//time_t start = clock();
//think twice,code once.
//think once,debug forever.
int n; cin >> n;
f(i, 1, n) cin >> a[i];
sort(a + 1, a + n + 1);
if(n & 1) {
cout << "Alice\n";
}
else {
bool pa = 1;
for(int i = 1; i < n; i += 2) {
if(a[i] != a[i + 1]) pa = 0;
}
cout << (pa == 1 ? "Bob" : "Alice") << endl;
}
//time_t finish = clock();
//cout << "time used:" << (finish-start) * 1.0 / CLOCKS_PER_SEC <<"s"<< endl;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 0ms
memory: 1236kb
input:
2 1 2
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 1236kb
input:
2 2 2
output:
Bob
result:
ok "Bob"
Test #3:
score: 0
Accepted
time: 0ms
memory: 1232kb
input:
2 2 4
output:
Alice
result:
ok "Alice"
Subtask #2:
score: 20
Accepted
Test #4:
score: 20
Accepted
time: 7ms
memory: 2028kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ...
output:
Alice
result:
ok "Alice"
Test #5:
score: 0
Accepted
time: 9ms
memory: 2032kb
input:
100000 4852 5063 39780 40806 48265 81218 96735 115329 117809 123175 125946 134012 138499 147184 1516...
output:
Alice
result:
ok "Alice"
Subtask #3:
score: 20
Accepted
Test #6:
score: 20
Accepted
time: 0ms
memory: 1236kb
input:
10 1 4 4 1 6 6 4 6 6 4
output:
Bob
result:
ok "Bob"
Test #7:
score: 0
Accepted
time: 0ms
memory: 1232kb
input:
10 1 4 4 1 6 6 4 6 6 3
output:
Alice
result:
ok "Alice"
Subtask #4:
score: 40
Accepted
Test #8:
score: 40
Accepted
time: 17ms
memory: 2028kb
input:
100000 816970941 205006355 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...
output:
Bob
result:
ok "Bob"
Test #9:
score: 0
Accepted
time: 17ms
memory: 2032kb
input:
100000 892035194 54971177 269410793 465533634 639684700 213114683 443540512 301413525 277593864 2548...
output:
Alice
result:
ok "Alice"
Test #10:
score: 0
Accepted
time: 13ms
memory: 2028kb
input:
100000 816970941 205006354 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...
output:
Alice
result:
ok "Alice"
Extra Test:
score: 0
Extra Test Passed