In the problem Stone Game <http://www.spoj.pl/problems/RESN04/> , I did the
following algorithm that was accepted by spoj:

#include<stdio.h>
int main(){

  int n,t,i,j,cont;

  scanf("%d",&t);

  while(t--){
    scanf("%d",&n);
    cont=0;
    for(i=1;i<=n;i++)
    {
      scanf("%d",&j);
      if(j>=i){
        cont+=j/i;
      }
    }

  if(cont%2==0)
    printf("BOB\n");
  else
     printf("ALICE\n");

}
return 0;
}


A friend of mine made ​​the following code, which was also accepted by spoj:

#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>

using namespace std;



int main(){
        int n;
        cin >> n;
        while(n--)
                cout << "ALICE" << endl;
        return 0;
}



I could not prove because Alice always wins. Does anyone know how to prove
this fact?





Wladimir Araujo Tavares
*Federal University of Ceará <http://lia.ufc.br/%7Ewladimir/>
Homepage <http://lia.ufc.br/%7Ewladimir/> |
Maratona<https://sites.google.com/site/quixadamaratona/>|
*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to