khokho's blog

By khokho, history, 8 years ago, In English

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

  • Vote: I like it
  • +62
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it +74 Vote: I do not like it

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.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      8 years ago, # ^ |
      Rev. 2   Vote: I like it +29 Vote: I do not like it

      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.

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
8 years ago, # |
  Vote: I like it +59 Vote: I do not like it

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

»
8 years ago, # |
  Vote: I like it +17 Vote: I do not like it

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