UVA 12293 - Box Game

UVA Sep 01, 2020

Problem PDF

Solution:

/*#include
int main()
{
    long long  n;
    while(scanf("%lld",&n)==1)
    {
        if(n==0)
        break;
        else
        {
            int p=1;
            while(p
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 

#define MP make_pair
#define PB push_back
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin(); e!=x.end(); ++ e)
using namespace std;

typedef pair PII;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

int N;
char buf[20];

void solve()
{
	scanf("%d%s", &N, buf);
	if (buf[0] == 'A') {
		-- N;
		if (N % 3 == 0)
			puts("Bob");
		else
			puts("Alice");
	} else {
		if (N % 3 == 0)
			puts("Alice");
		else
			puts("Bob");
	}
}

int main()
{
	int T; scanf("%d", &T);
	for(int i = 1; i <= T; ++ i) {
		printf("Case %d: ", i);
		solve();
	}
	return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12293/12293.cpp

Tags

Shipu Ahamed

CSPO® | Partly Product, Project Manager and Partly Software Engineer.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.