1559 - Nim

All about problems in Volume 15. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
bgcsaif
New poster
Posts: 38
Joined: Mon Sep 29, 2014 4:03 pm

Re: 1559 - Nim

Post by bgcsaif » Sat Jul 04, 2015 4:22 pm

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?

metaphysis
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

Re: 1559 - Nim

Post by metaphysis » Thu Jun 21, 2018 5:09 am

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;
}

Post Reply

Return to “Volume 15 (1500-1599)”