Page 1 of 1

Re: 1559 - Nim

Posted: Sat Jul 04, 2015 4:22 pm
by bgcsaif
Is here anyone who solved the problem? I am not understanding the statements clearly. Can anyone help me describing the problem with respect to 3rd input output, plz?

Re: 1559 - Nim

Posted: Thu Jun 21, 2018 5:09 am
by metaphysis
Test data generator.

Code: Select all

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
    srand(time(NULL));
    
    for (int cs = 1; cs <= 100; cs++)
    {
        int N = rand() % 10 + 1;
        int S = rand() % ((1 << 13) - 1) + 1;
        cout << N << ' ' << S;
        for (int i = 0; i < 2 * N; i++)
            cout << ' ' << (rand() % 16 + 1);
        cout << '\n';
    }
    cout << "0\n";
    
    return 0;
}