QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#527404 | #1644. Reverse Game | Kevin5307# | AC ✓ | 0ms | 3896kb | C++23 | 935b | 2024-08-22 14:58:32 | 2024-08-22 14:58:32 |
Judging History
answer
//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
cin>>s;
int cnt=0;
ll tot=0;
for(auto ch:s)
if(ch&1)
cnt++;
else
tot+=cnt;
if(tot%3==0)
cout<<"Bob";
else
cout<<"Alice";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
010
output:
Alice
result:
ok single line: 'Alice'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1111
output:
Bob
result:
ok single line: 'Bob'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
1010
output:
Bob
result:
ok single line: 'Bob'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
1010001011001
output:
Alice
result:
ok single line: 'Alice'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
0
output:
Bob
result:
ok single line: 'Bob'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
01
output:
Bob
result:
ok single line: 'Bob'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
000
output:
Bob
result:
ok single line: 'Bob'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
0000
output:
Bob
result:
ok single line: 'Bob'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
00000
output:
Bob
result:
ok single line: 'Bob'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
011110
output:
Alice
result:
ok single line: 'Alice'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
0111111
output:
Bob
result:
ok single line: 'Bob'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
00000000
output:
Bob
result:
ok single line: 'Bob'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
000001100
output:
Alice
result:
ok single line: 'Alice'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
1100010011
output:
Bob
result:
ok single line: 'Bob'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
10100110110
output:
Bob
result:
ok single line: 'Bob'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
101010100101
output:
Alice
result:
ok single line: 'Alice'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
1011110000110
output:
Alice
result:
ok single line: 'Alice'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
11010010101111
output:
Alice
result:
ok single line: 'Alice'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
110001101000101
output:
Alice
result:
ok single line: 'Alice'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
1100110000001101
output:
Alice
result:
ok single line: 'Alice'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
10101010010010101
output:
Alice
result:
ok single line: 'Alice'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
101111001111000110
output:
Alice
result:
ok single line: 'Alice'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
1111000011110110000
output:
Alice
result:
ok single line: 'Alice'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
11011111111011100100
output:
Bob
result:
ok single line: 'Bob'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
11000000001111010011100101100001001010100011110010110010100000111010000001101111000010110011110
output:
Alice
result:
ok single line: 'Alice'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
111101001100101010101010110100001000110110011110110100100110110101001010000110010000001101110010
output:
Bob
result:
ok single line: 'Bob'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
1011101001000101101000010110001000101100011000101001101110000010001100001001011110001010101001001
output:
Alice
result:
ok single line: 'Alice'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
10101000011001100111000010111111111110101100100010000111011001001001001100110001101000001000100011
output:
Alice
result:
ok single line: 'Alice'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
110001001111000101101111000011110101011100111000111011101001101001111001100101110110100101010110101
output:
Alice
result:
ok single line: 'Alice'