Блог пользователя khokho

Автор khokho, история, 7 лет назад, По-английски

This weekend I have IOI team selection tests, I should be able to get on the team, but I am still afraid because, if I'll fail a single problem there are these lower grade contestants who just suck out points off the problems without solving them ( We have outdated judge with no subtasks and partial points :/ ). I believe my main problem is that I often come up with wrong solutions, and I struggle hour or two until I find wrong case for it. Any tips how to avoid these type of problem? Is it right to always prove solution before typing? And on the other hand how do you spend last week/days before important contests?

BTW. I'm from Republic of Georgia.

Update 9 May. TRAINING IN LAST WEEK DOES MATTER !!!

I got a problem about a topic that I learned in this week, training in last week also helped me to be in good shape. But playing games on a last day did help as well ;)

AAAND NOW I AM FIRST CONTESTANT FROM GEORGIA!!! :D

  • Проголосовать: нравится
  • +62
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится +74 Проголосовать: не нравится

I recommend you to write a stupid bruteforce solution, preferably one that doesn't take any assumptions at all. Then write a random testcase generator and a bash script that would run a loop that generates tests, runs both solutions and then diff the output. That will likely help with overall correctness. You can also generate big random testcases and either check the output or just assume that if it didn't crash then it's fine.

I used to spend the last week before OI on doing nothing or playing video games. If you weren't good enough a week before the contest, you won't be good enough no matter how much you train during that week. And you will get tired instead.

This way I have advanced to IOI from Polish OI.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    It does take some time to write proper checker, but I guess it is definitely better than spending 3 hours looking at wrong solution :D I'll try make it my new rule to write checker if I can't fix code in ~10-15 minutes.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    BTW, how to write a bash script for linux (ubuntu)?

    • »
      »
      »
      7 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится +29 Проголосовать: не нравится

      Write a generator gen.cpp that uses the first argument as seed (i.e. it does srand(atoi(argv[1])) at the beginning). Then:

      # let's say we want to check 100 tests
      for((i=1;i<=100;i++)); do
      	echo $i # prints seed (you can remove this line)
      	./gen $i > in_tmp # create an input file
      	diff <(./prog1 < in_tmp) <(./prog2 < in_tmp) || break
      done
      

      The last line compares outputs of commands ./prog1 < in_tmp and ./prog2 < in_tmp. If there is a difference, it prints it and breaks the loop, thus terminating the script. In this case you have the interesting input file as in_tmp.

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by khokho (previous revision, new revision, compare).

»
7 лет назад, # |
  Проголосовать: нравится +59 Проголосовать: не нравится

Avoid being sleepy/tired or hungry during the contest, Apart from that, just chill out.

»
7 лет назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

I do only one thing ,, Collecting my material and everything i may use in the contest.