|
|
#include <iostream> int main() { int n; std::cin >> n; n = n % 4; if (n == 2 || n == 1) { std::cout << "grimy"; } else { std::cout << "black"; } } only amount of odd numbers matters and it changes every 2 numbers so for 1, 2 - 1 odd for 3, 4 - 2 odd numbers and so on no matter who plays first and which sign is between numbers Do I uderstand it right, that numbers are placed in increasing order, there's nothing said about it??? Правильно понимаю, что числа должны быть в порядке возрастания? Yes, they are in ascending order. Edited by author 02.10.2018 10:05 Други, кто-нибудь знает что это за несчастный тест? Проверил программу ВРУЧНУЮ в экселе для всех 50 значений "n", и всё сошлось. What's the problem? [code deleted] Edited by moderator 19.11.2019 22:58 Use properties of arithmetic progression You can use DFS find the tips as this. [code deleted] Edited by moderator 19.11.2019 22:57 Edited by author 18.03.2013 20:26 Edited by author 18.03.2013 20:26 Edited by author 18.03.2013 20:26 Yes, it obvious Hint V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V Try each way to play the game on 3 and 4 numbers on paper, than you will find what's the best strategy. Edited by author 01.11.2012 14:44 Edited by author 01.11.2012 14:45 |
|
|