QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#166906#6859. Alice GamePPP#AC ✓3ms3436kbC++171.2kb2023-09-06 20:33:172023-09-06 20:33:18

Judging History

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

  • [2023-09-06 20:33:18]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3436kb
  • [2023-09-06 20:33:17]
  • 提交

answer

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

const ll mod = 1000000007;

#define X first
#define Y second

ll pew(ll a, ll b)
{
    ll res = 1;
    while (b>0)
    {
        if (b&1) res = res*a%mod;
        b >>= 1;
        a = a*a%mod;
    }
}


vector<int> P(7);



void solve()
{
    int n, k;
    cin >> k >> n;
    /*vector<ll> dp(n+1);
    dp[0] = 0;
    for (ll i=1;i<=n;i++)
    {
        if (i<=k)
        {
            dp[i] = 1;
            continue;
        }
        vector<ll> was(100);
        for (ll j=1;j+k+1<=i;j++)
        {
            was[dp[j]^dp[i-j-k]] = 1;
        }
        while (was[dp[i]]) dp[i]++;
        if (dp[i]==0) cout << i << endl;
    }*/
    if (n==0)
    {
        cout << "Bob\n";
        return;
    }
    if (n%(4*k+2)==k+1) cout << "Bob\n";
    else cout << "Alice\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//#ifdef DEBUG
//    freopen("input.txt", "r", stdin);
//#endif
    int T = 1;
    cin >> T;
    while (T--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3436kb

input:

10000
215030 4437195
8215193 41075968
9100231 94335691
1846348 75360383
5022266 33559435
3346837 83705658
3209595 91853022
6760646 72650429
1861672 46541813
847955 91391745
6760979 91894780
8926014 2897123
8789221 17902247
2935002 27259386
6708849 33788122
2811931 29235487
1067245 624896
7134584 576...

output:

Alice
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
...

result:

ok 10000 lines