Submission #58774364


Source Code Expand

#pragma GCC optimize ("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(b); i++)
#define FORD(i, a, b) for (int i=(a); i>(b); i--)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define PPC(x) __builtin_popcountll(x)
#define MSB(x) (63 - __builtin_clzll(x))
#define LSB(x) __builtin_ctz(x)
#define ARG(x, i) (get<i>(x))
#define LAST(x) std::prev(x.end())
#define ithBit(m, i) ((m) >> (i) & 1)
#define pb push_back
#define ft first
#define sd second
#define kw(a) ((a) * (a))
#define VLD(i, j) (0 <= (i) and (i) < n and 0 <= (j) and (j) < m)
#ifdef DEBUG
#include "debug.h"
#else
#define dbg(...) 0
#endif
	
using namespace std; 
template <typename T1, typename T2> inline void remin(T1& a, T2 b) { a = min(a, (T1)b);	}
template <typename T1, typename T2> inline void remax(T1& a, T2 b) { a = max(a, (T1)b);	}

const int maxN = 1 << 18;

int T[maxN];

void solve()
{
	int n, m;
	scanf ("%d%d", &n, &m);
	
	long long s = 1ll * n * n + n;
	long long x = s - n;
	
	bool bob = x % m == 0 or x % m > (s-1) % m;


	printf("%s\n", bob ? "Bob" : "Alice");
}

int main()
{
	int t = 1;
	scanf ("%d", &t);
	FOR(tid, 1, t+1)
	{
//		printf("Case #%d: ", tid);
		solve();
	}
	return 0;
}

Submission Info

Submission Time
Task A - mod M Game 2
User bgrm
Language C++ 20 (gcc 12.2)
Score 600
Code Size 1301 Byte
Status AC
Exec Time 23 ms
Memory 3724 KiB

Compile Error

Main.cpp: In function ‘void solve()’:
Main.cpp:36:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   36 |         scanf ("%d%d", &n, &m);
      |         ~~~~~~^~~~~~~~~~~~~~~~
Main.cpp: In function ‘int main()’:
Main.cpp:50:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   50 |         scanf ("%d", &t);
      |         ~~~~~~^~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 1
AC × 3
Set Name Test Cases
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_small_00.txt, 02_random_00.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3724 KiB
01_small_00.txt AC 12 ms 3704 KiB
02_random_00.txt AC 23 ms 3580 KiB