Good day, friends!

Today another Codeforces round for Div2 participants will be. As the last Div2 only round, this round has been prepared by a team of three people: NALP, Polichka and Gerald. Traditionally, we express our gratitude for their help to Artem Rakhov (RAD), Maria Belova(Delinur) and Mike Mirzayanov (MikeMirzayanov).

Score distribution:

**500-1000-1500-2000-2500**Good luck and have fun of solving problems! :)

**UPD**: Problem analysis

hApPy CoDiNg !!

can anyone tell me where can i get the pretests input.?

i don't knw why my output is wrong.

1. I don't know what are the pretests, so that puts me at a disadvantage when hacking. People often use kludges to get their code working, which is usually not visible.

2. The number of solutions that can be hacked are reduced considerably.

I would like to know the possible reasons for including pretests that are not known to the contestants.

If there's no pretest, one could easily create tons of account --> there would be a few of his accounts in his room. For the fake accounts just give only outputs for example tests, submit, and use the main account to hack his own fake accounts. After hacking himself, he repeats again and again, thus gaining thousands of points :)

But, it was hurtful to see that many people in my room had 2-3 WA's before submitting problem A.

I got TLE while using it but it passed when I wrote my own hypot.

bad luck!

Apply Dijkstra to get the "key" (shortest distance) to each vertex.If key ==L then c++;. Then examine each edge.if starting vertex of this edge key is less than "L" and st.key+edge weight >L then there exist a point in this edge with distance exactly L,so c++.Similarly if end.key <L and end.key+edge weight>L then another point provided st.key!=end.key because then you would be adding the same point on the edge twice.Simply run this for all edges .

Can anyone provide me link where I can get java implementations of all important and useful algorithms .It will be very useful during contests

actually your logic is slightly wrong , it should be-

st.key + edge weight > l && end.key + distance to Point from end > L

where, distance to Point from end = edge weight — (L — st.key)

So time is O((|T| - |S|) * Aplhabet) = O(|S| * Alphabet).

Will pass in 2s.

The bruteforce solution of problem B is 8,000,000 as I think.

However, I've failed in test #27 (TLE).

Can any body check it for me please? It's so simple and straightforward.

http://codeforces.com/contest/144/submission/1077198

Thanks

hypot() is slow. That's a useful information.

Cool contest!

And I realized that I should learn how to read, because I was trying to solve different problems! :(

I am still wondering, what is the best way to solve slightly modified version of task B: let's assume that generals are sitting not only on the border, but also inside rect?

Agree.

can anyone pls provide acorner test case for problem A of Codeforces Round #103 (Div. 2);getting wa;m just a noob started practising on codeforces thnks in advance

What is the correct output for

I think it should be 3 but AC codes gave 2.Am I wrong?

UPD : Got it misunderstood the question.