Skip to content
← Back to Community
can somebody make this an sent to me on language C++
Profile icon
baqar1234

andro idadzes daebada akhali tamashis idea ori motamashisatvis. tamashisatvis sak’marisia tsartsi da dapa. dapaze ts’eren N (2≤N≤20) tsal mtel dadebit ritskhvs. titoeuli ritskhvis mnishvneloba ar aghemat’eba 1,000,000-s. motamasheebi rig-rigobit ak’eteben svlebs da q’ovel svlaze upleba akvt, dapidan ts’ashalon mkholod erti ritskhvi da mis adgilas chats’eron dapaze darchenili ritskhvebidan ert-erti, romelits autsileblad nak’lebi unda iq’os ts’ashlil ritskhvze. magalitad, vtkvat dapaze ts’eria sami ritskhvebi – 1, 3 da 5. am sit’uatsiashi shesadzlebelia 3 ganskhvavebuli svla:

1) 3-iani shevtsvalot 1-it. miigheba 1, 1 da 5; 2) 5-iani shevtsvalot 3-it. miigheba 1, 3 da 3; 3) 5-iani shevtsvalot 1-it. miigheba 1, 3 da 1. motamashe, romelits svlis gak’etebas veghar moakherkhebs, damartskhebulad itvleba. andros aint’eresebs, q’oveltvis moigebs tu ara p’irveli svlis gak’etebis shemtkhvevashi. dats’eret p’rograma, romelits motsemuli ritskhvebisatvis daadgens arsebobs tu ara momgebiani st’rat’egia im motamashisatvis, romelits its’q’ebs tamashs. shemavali monatsemebi: shemavali pailis p’irvel st’rikonshi motsemulia erti mteli ritskhvi N – dapaze dats’erili ritskhvebis raodenoba. meore st’rikonshi motsemulia harit gaq’opili N tsali mteli dadebiti ritskhvi 1-dan miliardamde. gamomavali monatsemebi: gamomavali pailis ertaderti st’rikoni unda sheitsavdes ert mtel ritskhvs: 1-s an 0-s. 1 unda gamoit’anot im shemtkhvevashi, tuk’i arsebobs momgebiani st’rat’egia p’irveli svlis gamk’etebeli motamashisatvis, kholo tuk’i aseti st’rat’egia ar arsebobs – gamoit’anet 0.

Show more
1475/5000
Andro Idadze came up with a new game idea for two players. Chalk and board are enough for the game. On the board write N (2≤N≤20) a single positive integer. The value of each number does not exceed 1,000,000. Players make moves in a row and are allowed to delete only one number from each board and enter one of the remaining numbers on the board, which must be less than the number deleted. For example, say on the board three numbers - 1, 3 and 5. In this situation there are 3 different steps:

1) Change 3s to 1s. Received 1, 1 and 5; 2) Change 5's to 3's. Received 1, 3 and 3; 3) Change 5s to 1s. 1, 3 and 1 are obtained. A player who is unable to make the move is considered a loser. Andros wonders if he always wins if he makes the first move. Write a program that will determine if there is a winning strategy for the player who starts the game for the given numbers. Input: The first row of the input file contains one integer number of numbers written on the N-board. The second row gives the integer N of the positive integers from 1 to billion. Output data: The only line in the output file should contain one integer: 1 or 0. You must score 1 if there is a winning strategy for the first move player, and if there is no strategy - score 0.
Voters
Profile icon
shufflecarrot
Profile icon
baqar1234
Comments
hotnewtop
Profile icon
Vandesm14

What have you tried so far? We can't do your homework for you.