ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#197337 | #3429. 双人博弈 | smwtcat | 100 | 68ms | 1628kb | C++11 | 1.8kb | 2023-11-11 11:38:51 | 2023-11-11 13:02:52 |
answer
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef array<int, 3> ai3;
const int inf = 0x3f3f3f3f;
const int Mod = 998244353;
const int inv2 = (Mod+1) / 2;
inline int sign(int a){ return (a&1) ? (Mod-1) : 1; }
inline void uadd(int &a, int b){ a += b-Mod; a += (a>>31) & Mod; }
inline void usub(int &a, int b){ a -= b, a += (a>>31) & Mod; }
inline void umul(int &a, int b){ a = (int)(1ll * a * b % Mod); }
inline int add(int a, int b){ a += b-Mod; a += (a>>31) & Mod; return a; }
inline int sub(int a, int b){ a -= b, a += (a>>31) & Mod; return a; }
inline int mul(int a, int b){ a = (int)(1ll * a * b % Mod); return a; }
int qpow(int b, int p){ int ret = 1; while(p){ if(p&1) umul(ret, b); umul(b, b), p >>= 1; } return ret; }
const int fN = 111;
int fact[fN], invfact[fN], pw2[fN], invpw2[fN];
void initfact(int n){
pw2[0] = 1; for(int i = 1; i <= n; ++i) pw2[i] = mul(pw2[i-1], 2);
invpw2[0] = 1; for(int i = 1; i <= n; ++i) invpw2[i] = mul(invpw2[i-1], (Mod+1) / 2);
fact[0] = 1; for(int i = 1; i <= n; ++i) fact[i] = mul(fact[i-1], i);
invfact[n] = qpow(fact[n], Mod-2); for(int i = n; i > 0; --i) invfact[i-1] = mul(invfact[i], i);
}
int binom(int n, int m){ return (m < 0 || m > n) ? 0 : mul(fact[n], mul(invfact[m], invfact[n-m])); }
const double pi = acos(-1);
inline void chmax(ll &a, ll b){ (b>a) ? (a=b) : 0; }
inline void chmin(ll &a, ll b){ (b<a) ? (a=b) : 0; }
int n, a[100100];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
rep(i, n) cin >> a[i];
sort(a, a+n);
bool ok = (n % 2 == 1);
for(int i = 0; i < n; i += 2) ok |= (a[i] != a[i+1]);
cout << (ok ? "Alice" : "Bob") << "\n";
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 0ms
memory: 1228kb
input:
2 1 2
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 1228kb
input:
2 2 2
output:
Bob
result:
ok "Bob"
Test #3:
score: 0
Accepted
time: 0ms
memory: 1228kb
input:
2 2 4
output:
Alice
result:
ok "Alice"
Subtask #2:
score: 20
Accepted
Test #4:
score: 20
Accepted
time: 9ms
memory: 1628kb
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: 12ms
memory: 1628kb
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: 1ms
memory: 1224kb
input:
10 1 4 4 1 6 6 4 6 6 4
output:
Bob
result:
ok "Bob"
Test #7:
score: 0
Accepted
time: 1ms
memory: 1224kb
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: 16ms
memory: 1624kb
input:
100000 816970941 205006355 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...
output:
Bob
result:
ok "Bob"
Test #9:
score: 0
Accepted
time: 16ms
memory: 1628kb
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: 1628kb
input:
100000 816970941 205006354 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...
output:
Alice
result:
ok "Alice"
Extra Test:
score: 0
Extra Test Passed