QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#732862#1644. Reverse GameLaVuna47#AC ✓0ms3856kbC++201.1kb2024-11-10 16:11:522024-11-10 16:11:52

Judging History

你现在查看的是最新测评结果

  • [2024-11-10 16:11:52]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3856kb
  • [2024-11-10 16:11:52]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define x first
#define y second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)

typedef long long ll;
typedef double db;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<db, db> pdd;


int solve()
{
	string s;
	if (!(cin >> s))
		return 1;
	ll cur = 0;
	ll sum = 0;
	RFOR(i,sz(s),0)
	{
		if(s[i]=='1')
		{
			sum+=cur;
		}
		else
			cur++;
	}
	if(sum%3==0)
		cout << "Bob" << endl;
	else
		cout << "Alice" << endl;
	
		
	return 0;
}

int32_t main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int TET = 1e9;
	//cin >> TET;
	for (int i = 1; i <= TET; i++)
	{
		if (solve())
		{
			break;
		}
		#ifdef ONPC
			cerr << "_________________________\n";
		#endif
	}
	#ifdef ONPC
		cerr << "\nfinished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
	#endif
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3852kb

input:

010

output:

Alice

result:

ok single line: 'Alice'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

1111

output:

Bob

result:

ok single line: 'Bob'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1010

output:

Bob

result:

ok single line: 'Bob'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

1010001011001

output:

Alice

result:

ok single line: 'Alice'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

0

output:

Bob

result:

ok single line: 'Bob'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

01

output:

Bob

result:

ok single line: 'Bob'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

000

output:

Bob

result:

ok single line: 'Bob'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

0000

output:

Bob

result:

ok single line: 'Bob'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

00000

output:

Bob

result:

ok single line: 'Bob'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

011110

output:

Alice

result:

ok single line: 'Alice'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

0111111

output:

Bob

result:

ok single line: 'Bob'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

00000000

output:

Bob

result:

ok single line: 'Bob'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

000001100

output:

Alice

result:

ok single line: 'Alice'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

1100010011

output:

Bob

result:

ok single line: 'Bob'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

10100110110

output:

Bob

result:

ok single line: 'Bob'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

101010100101

output:

Alice

result:

ok single line: 'Alice'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

1011110000110

output:

Alice

result:

ok single line: 'Alice'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

11010010101111

output:

Alice

result:

ok single line: 'Alice'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

110001101000101

output:

Alice

result:

ok single line: 'Alice'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1100110000001101

output:

Alice

result:

ok single line: 'Alice'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

10101010010010101

output:

Alice

result:

ok single line: 'Alice'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

101111001111000110

output:

Alice

result:

ok single line: 'Alice'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1111000011110110000

output:

Alice

result:

ok single line: 'Alice'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

11011111111011100100

output:

Bob

result:

ok single line: 'Bob'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

11000000001111010011100101100001001010100011110010110010100000111010000001101111000010110011110

output:

Alice

result:

ok single line: 'Alice'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

111101001100101010101010110100001000110110011110110100100110110101001010000110010000001101110010

output:

Bob

result:

ok single line: 'Bob'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

1011101001000101101000010110001000101100011000101001101110000010001100001001011110001010101001001

output:

Alice

result:

ok single line: 'Alice'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

10101000011001100111000010111111111110101100100010000111011001001001001100110001101000001000100011

output:

Alice

result:

ok single line: 'Alice'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

110001001111000101101111000011110101011100111000111011101001101001111001100101110110100101010110101

output:

Alice

result:

ok single line: 'Alice'