Rating: 2150->2205

[A] : I inserted assertion to my code in order to assure that "

*It is guaranteed that there is exactly one leader in the room*", but unfortunately it behaved wrong.- int main() {
- int N;
- while (cin>>N) {
- int mmpts=-1<<29; string res="{";
- REP(j, N) {
- string name;
- int p,m,a,b,c,d,e; cin>>name>>p>>m>>a>>b>>c>>d>>e;
- int pts=p*100-50*m+a+b+c+d+e;
- assert(mmpts != pts); // <- !!!This is wrong!!!: "3 a 0..0 b 0..0 c 999...999" can cause RE.
- if (mmpts < pts) mmpts=pts, res=name;
- }
- cout<<res<<endl;
- }
- }

[B] : The statement was very long, so I skipped and went to C.

[C] : The statement was short in contrast to B, so I read it.

Considering the top row of the board is OK, so the problem is just counting the number of the connected components. (Assume two cells (1,

*i*) and (1,*j*) are connected if (1,*i*) can beat (1,*j*).)...But the mathematical part was a bit hard to me, so it took a bit long time.

It is surprising that this problem can be solved by only

*gcd*.[B(again)] : The statement looked very long at first, but it was actually not so long.

This problem was a kind of simulation (a bit hard!), and I made 2WAs. I felt C was easier than B, but it is perhaps because of individual difference.

[D]: Inserting points to a line is done by simulation with a few data structures (I used <set> and <map>). Answering queries in online looked to me very hard, but after thinking for a while, I found that it can be done by coordinate compression + BIT.

[E]: I did not have time to read E at all during the contest, so I solved this after the contest.

In this problem, finding the way to swap two adjacent cells is enough. Really constructive problem.