📜 ⬆️ ⬇️

Cunning

In connection with the post, I recalled a small life story.

image

He participated in the Kiev Olympiad in Informatics. There were 4 tasks, 2 I quickly decided how I could, and 2 didn’t go at all.
')
But I paid attention to the conditions of checking the tasks ... the bottom line was that for each data entry your program should produce a certain amount. The success of the participant is determined solely by the coincidence of these numbers with the reference, the program itself is not checked. If you do not see that you knew the test tasks in advance, everything else is OK.

So, in the third task, it was clear that for most of the inputs the correct answer would be 0. All my program turned out to be write (“0”); :)

The fourth answer could be 1, 2 or some big number. The third is rare, but what will be more, 1 or 2 - it was not clear. My program is here: write (random (1, 2)); became ( clarification ) :)

Honestly, I could not even believe that such a brazen approach would work ... and it worked, 2nd place, an invitation to the selection for the All-Ukrainian Olympiad :)

Source: https://habr.com/ru/post/58145/


All Articles