NOI - PH 2017 Training Week 9: Kevin Charles Atienza
NOI - PH 2017 Training Week 9: Kevin Charles Atienza
NOI - PH 2017 Training Week 9: Kevin Charles Atienza
April 2017
Contents
1 Introduction 2
1.1 Scoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1
1 Introduction
The in-house training and the selection exam are fast approaching! It would be best to focus
the last few days consolidating and applying what you’ve learned. This week, we will prepare you
for the in-house training which will consist mostly of practice/real contests.
I painstakingly compiled 8 four-problem sets, requiring the topics we’ve covered, for you to
practice on this week. I tried to evenly distribute the difficulty and topics, although don’t expect it
to be perfect; some problem sets are probably more data-structure-heavy, others more trick-based,
and some sets are probably easier than others.
Although you may solve the problems in any order you want, it is recommended to solve them
per problem set, and to solve each problem set as a group.
1.1 Scoring
Each problem is worth 1 point, regardless of difficulty. Completing a problem set nets you an
additional 1 point. Completing a problem within its target date nets you some bonus.
The score for this week is determined by the number of points over max(30, maxscore), where
maxscore is the maximum score of any participant, not counting the target bonus.
Please don’t waste these prepared problem sets; use them as real practice. Your goal is to
maximize your chances to get a medal in the IOI!
1.2 Recommendation
Each set is roughly equivalent to a short contest: 3-5 hours. Although you don’t have to follow
that strictly, I recommend trying out each set as a single round on its own and timing yourself. (If
you do this, please let us know, and also please tell us how you did!) This will give you a rough
estimate on how well you could do at the IOI: note that the problems in the IOI will be harder on
average. But if you don’t meet your set target time, please continue trying to solve them anyway
to get points; remember that a full set gives you an extra point.
I highly recommend being ahead by 2 or 3 problem sets every day, so if you don’t finish a problem
set, you’ll have time to spare to (maybe) try to get that 3rd or 4th problem (and thus the extra
Author: kevinsogo 2
point) by the target date.
Feel free to ask for advice or hints. (Yes, I’ll give hints for some problems.)
Author: kevinsogo 3
2 The problem sets
1. Lighthouses: https://www.codechef.com/problems/LIGHTHSE
2. Xor-tree: http://codeforces.com/contest/429/problem/A
Author: kevinsogo 4
2.4 Problem set KS
1. Superinteger: https://projecteuler.net/problem=467
2
“Expected value”, in this case, is simply the average. For example, the expected value of throwing a dice is the
average across all events, i.e., 1+2+3+4+5+6
6 = 3.5. This works because all events are equally likely; in other cases,
you should weigh the events by their probability.
Author: kevinsogo 5
2.7 Problem set TR
4. Tree: https://www.codechef.com/problems/RRTREE
2.9 Notes
For Project Euler problems, consider your code accepted if it can compute the answer in less
than 10 seconds, and by that, I mean actually computing the answer, not just hardcoding + printing
it (or something of similar “cheaty” flavor).
For problems with subtasks, partial solutions will get partial points, although you’ll only get the
extra 1 point per set if you get full points for all 4.
Author: kevinsogo 6