Hello!
Only few hours left before Codeforces Round # 135 (Div. 2). We are preparing the round in Petrozavodsk where traditional training camp for ACM-ICPC is going now. Today is a day of rest here, many participants gone to a trip to Kizhi. The main contest authors are me and Gerald. Special thanks to Aksenov239 who tested the round. Thank Delinur for translation.
The problems will be sorted by expected difficulty, the scores are dynamic.
Wish you fun round!
I got report on my email about this round and there was writen that contest was held by rules of codeforces not dynamic scoring.
Good luck everybody! May the best will win! Let's hope for an interesting problem set and a lot of hacks!
hints for problem D needed :D please help :)
Dfs from any vertex, then ansver for vertex is number of edges goes up in path from root to it + all other edges, that goes down
1) At start find the result for the first node using bfs. 2) Again, using bfs for all neighbor nodes result differs always in 1 (+ or — depending on direction of the edge) -> count result 3) After you counted result for all nodes I believe it's obvious
How to solve E?
Use a heap to maintain all the gap each time we pop the longest gap
You are so clever ... I use segment tree to update the longest gap ...
STL is a better choice for C++.The maintain of segment tree is very complex.
+1
Hi all , I have solved 4 problems (A,B,C,D), but i have spent about an hour for task B ,so couldn't get enough points: It will be fine ,that for counting points we use the time participant has spent ( counting from his/her first opening that task) , and not to use the time counted from begining the contest : Sorry for bad English :D
It's not good for system because now you can read the task and not solve it, and return to this task later.
I think systest is so slow today. Maybe it causes from to many testcase on problem B
I think the problem E should solve via Interval Tree. For each node in the tree, we store min parked space, max parked space, max interval length without parking and that maximum interval.
Slow system :(
Indeed..
Now we must wait for rating. .
I used abs() function in my C++ code in problem B where it should get the absolute value between to long longs, but actually this caused a Wrong Answer in the final tests. When I removed the abs() and made it manually, it got accepted in the practice! How come something like this happen?
BTW, labs() don’t work too.
according to this site: http://www.cplusplus.com/reference/clibrary/cstdlib/labs/ labs takes a long int as a parameter, while you use long long ints. So does abs
long ints are 32 bits long, while long long ints are 64 bits
That is correct only for a certain set of compilers (including both compilers supported by codeforces), but in general this statement is not always true. 64-bit g++, for instance, has 64 bit long
long
s.When you submit C++, write in C++: 2060835
Oh I see, thanks a lot! :)
Here is my submission to problem B: 2054290. It gives correct output on my system as well as ideone (8JSXv). But it fails on codeforces judge (for test case 11). Is there some problem with my code ? Comments are welcomed!!
The problem is in using of pow() with integers. Try the following code in custom test:
in problem B, it says--
what does that mean??
output should >= (p-d) and <= p
or >= (p-d) and <p
confusing!!
>= (p-d) and <= p
i am getting TLE for Problem C.
here is my try: http://mirror.codeforces.com/contest/219/submission/2067867
i am trying to solve it with DP..
any suggestions to optimize it ???
The problem is your DP complexity. It is 100000 * 26 * 26 ~= 10^8 in the worst case. One good point to think is "Do you really need a DP for all testcases?"
Add this to the start of your code. Here is my submission which ran on 1934ms : 78488193