-
Notifications
You must be signed in to change notification settings - Fork 2
/
stonegame.c
39 lines (39 loc) · 844 Bytes
/
stonegame.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* =====================================================================================
*
* Filename: stonegame.c
*
* Description: Problem Stone game of Spoj
*
* Version: 1.0
* Created: 09/14/2012 07:19:57 PM
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization: Ubuntu
*
* =====================================================================================
*/
#include <stdio.h>
int main() {
int a[100];
int i, t, N, sum, x;
scanf("%d", &t);
while(t--) {
sum = 0;
scanf("%d", &N);
for(i = 0; i < N; i++){
scanf("%d", &a[i]);
}
for(i = 0; i < N; i++){
x = i + 1;
if(a[i] >= x)
sum += (a[i] / x);
}
if(sum % 2 == 0)
printf("BOB\n");
else
printf("ALICE\n");
}
}