I_Love_Tina's blog

By I_Love_Tina, history, 8 years ago, In English

Hi everyone!

I want to present you the Codeforces Round #361 (Div. 2) that will take place on the 6th of July at 19:35 MSK. The contest was prepared by Gabriel I_Love_Tina Cojocaru and Mihail ThatMathGuy Tarigradschi.

I'd like to thank Dan danilka.pro Sagunov and Gleb GlebsHP Evstropov for their help in preparing the round and for making the round possible,Mike MikeMirzayanov Mirzayanov for the great Codeforces and Polygon platforms.

Good luck in the contest!!

UPD1.In this round you will help our hero Mike solve tasks he encounters every day.

UPD2. Editorial

UPD3.Congratulations to the winners of the round.

Div 1:

1.Um_nik

2.cgy4ever

3.anta

4.HellKitsune

5.ksun48

6.waterfall

7.Kaban-5

8.I_love_Tanya_Romanova

9.I_love_tigersugar

10.RomeoFantastik

Div 2:

1.Sky4teen

2.TudorMiclovan

3.darius.marian

4.Hirasawa_Yui

5.Chloe_fan

6.AnonymousBunny

7.fenchen

8.Grandpa

9.6eJIa9IzZzTeHb

10.raiders7

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

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

Wow ! everyone got a "middle" name :) ;)

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

Yah i'll try to do better than past.

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

Wow really short announcement... I hope problem statements will be the same ;)

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

For all muslims, this time we're gonna participate with our stomachs filled.

Eid Mubarak :D

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

we are eagerly waiting for this :)

»
8 years ago, # |
Rev. 3   Vote: I like it +57 Vote: I do not like it

Eid Mubarak Everyone :)

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

The next day of contest will be Eid Day. Eid Mubarak everyone. Wish you'll have a nice Eid Day.

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

What's better than a round at the beginning of the summer vacation :)

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

I have two questions. Where is Delinur? I haven't seen that handle in announcements for a long time. And who translates problems now?

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

    Sad but true. Delinur left Codeforces. I believe the translations are made by authors if they do not give any credits to other people. Or by someone else, by occasion.

    Some info from Mike, by the way.

»
8 years ago, # |
Rev. 2   Vote: I like it -63 Vote: I do not like it

plz no more down votes:'(

»
8 years ago, # |
Rev. 2   Vote: I like it -62 Vote: I do not like it

no down votes plz! i will never comment again:'(

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

So, After a complete cycle(360 degree), this gonna be the first round in the first quadrant.

Codeforces Round #(360+1) (Div. 2)

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

Hope the problems will be as real as your handle, I_Love_Tina, unlike something as "The family has 100,000 men give presents to each other."

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

Oh no, ThatMathGuy! I am never forget a problem on analytic and algebraic topology of locally Euclidean metrization of infinitely differentiable Riemannian manifolds!!!!

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

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

The time for this contest is too bad for us! Because it's 00:35 in China. What's worse is that I have lessons tomorrow morning,so my mother doesn't allow me to take part in this contest.I think i must take part in the contest secretly.But,if my mother find me doing this,I think my mom will clapperclaw me.How miserable i am ! Bless me not to be found,codeforces!

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

    An addictive competitive programming is one which you cannot stop taking once you have started

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

Contest just before Eid. It'll be interesting! Eid Mubarak everyone.

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

Those who have summer vacation, Happy summer vacation and Eid Mubarak to everyone wish you a happy, prosperous and AC life ;)

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

Good luck Guys

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

Hoping to see some good problems and ratings up. All the best to all.

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

Recently I can't open submission code of old problems(Rounds before about 100), including my own submission. Anyone has any idea about this problem? Thanks.

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

This round and every other round hero. Thanks to mike for the great Codeforces and Polygon platforms

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

Does anybody feel that the A problem is a lot harder than usual ???

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

Is it just me who thinks this round is scary difficult?

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

My dream to become Cyan has been destroyed :(

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

I think this round is too hard. :'(

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

This round has really made me take a I_Love_Tina check. ;_;

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

How to solve B? Dijkstra?

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

    i solved with bfs

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

    Simple BFS would do. Just think how you can make graph unweighted.

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

    BFS

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

    ad-hoc or dp like

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

    BFS ! AS all cost are +1 for each node bfs to a[i],i-1 and i+1

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

    Just add edges [i — 1, i], [i, i + 1], [i, a[i]] and find shortest path from 1 to i.

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

    Simple BFS should do the trick. Keep an array storing the minimum distance from 1 to each node and initialize all values to inf and dist[1] = 0. Then, from each state, you can reach the node to your left and right with time=1. As well, you can reach the state which has a shortcut to in distance[1]. Only visit a state that you have never been to before and update the dist[] array as you go.

    **Edit, when I wrote this, there were no replies. Guess everyone wanted to help!

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

    yeah I used Djikstra.

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

Really nice round) Many thanks

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

How did you guys solve D?

I got pretests passed with binary searching, for every index, the segment that has the same min/max, and answering min/max queries in intervals in O(1) with RMQ.

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

    I think it can be done using 2 pointer two... But the implementation might be complex(IDK).

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

    n = 200000 and sequence is fill with same digit

    what time complexity in your solution?

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

    Can you please explain how you used binary search?

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

      Let's count how many intervals are "good" beginning with i:

      It will be some segment [l, r>, i <= l <= r <= n

      The max_a(i, l) is an increasing function, and min_b(i, l) is a decreasing function, so with binary search you can find the first index l where max_a(i, l) >= min_b(i, l), and then with another binary you can find R, so that max_a(i, r) == min_b(i, r) for every i < r <= R

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

      max(x , R ) is increasing with decreasing x. min(x , R ) is decreasing with decreasing x.
      Now find lower and upper points where max(x,R)>min(x,R) and max(y,R)<min(y,R) . add y-x+1 for every R

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

O(N * logN * logN) gives TL on D :( . I was way more stuck on such an easy solution of B!

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

    Same here ! Got fooled into doing dijikstras ! :(

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

    i used RMQ to answer min/maq queries in O(1), that didn't TLE

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

    Yes. I thought that my solution with Segment Tree would pass. But I got TL 7 and rewrited it using sparse table.

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

    My code has also O(n * log2(n)) time complexity. But it gets AC with 1419ms time. I used segment tree with binary search for all i (1 <  = i <  = n). Here is my submission. BTW I recommend RMQ solution with O(nlog(n)) time complexity for this problem (because of the tight time limits).

    PS: The funny thing is that I couldn't solve it at the contest time because I thought both Mike and !Mike can tell the Maximum value. Didn't read the problem statement well. If they can tell the Maximum value what will be the solution then? Anyone have any idea?

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

      If they both compute maximums, they will always output the same number. Just print n*(n+1)/2.

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

        That's not true. For this case:
        3
        1 2 3
        4 5 6
        The answer is 0

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

      Vhai in your solution how these two line works ?? I mean what is the logic behind this ?? when (p.fs-p.sc>0) lo=mid+1; ans else hi=mid-1; how the direction of binary search is selected ?

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

        If we go to left then maxa will increase or remain same and minb will decrease or remain same. Now there can be 3 type of cases.
        1. maxa = minb
        2. maxa > minb
        3. maxa < minb
        For second case we have to go to the right side because we want maxa to be equal to minb. For third case we have to go to the left. For first case if we want the lower bound then we go to the left. For upper bound we go to the right.

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

Nice round. How to solve C? Many people solved it very fast! I hope many A fail. :P

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

    Binary search for least value of n that satisfies no of ways greater then or equal to m. At the end you need to check if this value is actually equal to given m or not.

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

      what Right limit did u start with ? And how did u calculate it ?

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

        i actually manually checked what value could give answer till 10**15. it was around 10**16.

        EDIT: Screw this, damn i did checked this in a loop but since i coded binary search function first and then checked for this value, i forgot to update to 10**16. So it will fail final tests most likely :(

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

          Srry for spoiling your party before sys tests :P

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

        I just used 8 * 1015 since M is at most 1015.

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

        Long.MAX_VALUE should be a safe bet I think.

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

    binary search to find n

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

I think that problem A has too week pretests. I hacked 5 solution and I will fail the system test(.

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

    same thing but 2 solutions only hacked :D

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

    Was fun finding the logic in different peoples A solutions ! Remarkable !

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

What was the hacking test cases in div2 A ?

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

    4 9394

    3 349

    3 167

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

      What would be the faulty logic in these cases?

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

        for example, i thought only about this pairs: 1&0, 2&0, 3&0, 1&7, 3&9. My solution passed pretests and got WA69

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

    I hacked one solution with 5 36984

    Even my solution fails on this but unfortunately I cannot hack mine :(

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

      You are really a hell_hacker if you want to hack your own solution XD

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

    I hacked a 02

    MAybe 40 also was missed

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

    183 got a lot of people as it used the full 3x3 square but could be moved down to 460.

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

    4 2469

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

hardest round ever!

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

finished coding D less than 1 minute after the contest ended

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

For me round was very interesting and one of the best in last time ! Thanks !

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

Before 30 seconds the end, i submit div2E and got WA Because i print with I64D, not I64d...

my input : 3 1 1 2 2 3 3 4

output : D

I'm really sad...

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

In Div 2 A,

What was wrong in this

if there is a 1,2,3 and 7,9,0 in the string, then YES

otherwise NO.

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

very bad statement

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

    I had to read E for 10 minutes before I understood the problem statement.

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

This really freaks me out!

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

wrong answer on test case # 4 :):):)

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

    You probably forgot the backwards paths from point i to point i-1. I had the same mistake :)

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

      i forgot this and costed me 3 WA but realised it later and got AC

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

solve 3 and 2 fail maintest...

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

    I thought this would make me rank 2000+, surprisingly rank 800+ by just solving B :)

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

My Problem A fails for n=1.
Careless mistake sucks!

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

    same with me forgot to put else before if in a condition and got A missed :(

»
8 years ago, # |
Rev. 2   Vote: I like it -35 Vote: I do not like it

Shittiest contest ever !!!

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

    Tasks were fine by me, maybe A harder than usual, that's it o.o

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

    Actually it was one of the best I ever gave....

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

the worst round i have ever seen

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

Can someone explain why I'm missing these two questions B: 18932534 edit : oops didnt read question

then just check c edit: ok i guess my lower bound is incorrect C: 18935173

»
8 years ago, # |
Rev. 2   Vote: I like it -33 Vote: I do not like it

That was the bad contest I have ever seen

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

I think many people run when they saw Div2A.

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

I can't find mistake in my D. Anyone? :) http://codeforces.com/contest/689/submission/18935532

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

    well first and foremost it's O(n log^2 n), which TLEs on systests

    there must be a bug in your binary search, it's easy to get it sometimes wrong by +-1 or < instead of <=, etc.

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

I think that this contest is the worst only for people who solved only A. So you should study programming better. I liked this contest because of problems C and D. So thank you, I_Love_Tina and ThatMathGuy, for the round.

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

    Well, I think all problem was great. but some description was too hard to understand.

    Really thanks for problem setter.

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

A and B didn't pass, I lost an hour for them... But C and D are easy

»
8 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it
»
8 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Sky4Teen???? A fake Account + Shitty Naming Sense!!! :/

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

What is wrong in my soltion of Div2B: My solution

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

    A subsection of your output: 15 1 2 After a shortcut you can go both right and left.

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

      Didn't get you. Could you be a bit more elaborate? Also , I have changed my solution a bit but I am still getting a WA

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

        Not sure, why, but if I add if (a[start] == end) return 1; after if (start == end) return 0;, it works for testcase 6. However it is still way too slow.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    6
    6 6 6 6 6 6
    Answer
    0 1 2 3 2 1
    
  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think you don't cover the case where it's optimal to get to some node by jumping to it from a previous one and then going backwards

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

Made a typo in A (used brute force and forgot that there are 4 rows and not 3) and failed A on systests. :D

But I still solved B and C so I have this going for me which is nice. By "this" I mean remaining in Div.2 for eternity of course.

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

Rating changes, come on :D

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

One of the best rounds I have done, was freaked out initially after seeing Div2 A though!

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

Good problems, thanks authors!

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

Hardest round ever.

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

Can anyone help me explain this 18922000 solution? And how to develop ideas like this?

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

I thought the contest was rated

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

people saying EID mubarak are getting too much downvotes.Guys they are people like us and celebrate festivals like us .If somebody would have said happy christmas he would have recieved like 1000 upvotes. seriously didnt expect the coding community to be so immature.

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

    No, if 10 people had already said "Happy Christmas!" and more people still leave comments saying just that, then they would definitely not get 1000 upvotes, they would be downvoted. Eid Mubarak is no different. It's just repetitive and adds nothing to the conversation.

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

    they mostly have only upvotes o_o

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

Nice round (although A was more difficult than expected) after being away for a while. Fast system testing and rating changes. Finally pretests weren't weak.

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

    Pretests for A were REALLY weak. So many solutions were hacked :)

    I agree that it was a nice round

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

      Yes, for A I may be wrong, but not for C and D. Problem A doesn't have some non-obvious cases if you implement it straightforward.

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

        n = 1 was a non-obvious case for A :P

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

          No? It was an easy case not being different from the others.

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

            Easy test case — Yes
            Not different from others — No
            wa-submission
            ac-submission

            PS — both submissions were after the contest

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

              OK, I partially agree. It depends on the implementation (for example in my code there wasn't needed to be checked for that case: 18922236). But it's a good advice to always check your solution with a test with the minimum constraints and a test with the maximum constraints.

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

              For my code it wasn't a special case

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

Guys, let me teach you how to write 1000000000 properly. It is (int)1e9 (works with (long long)1e18 too). I was tired counting zeroes while hacking.

And thanks for the round, problems were good (maybe, A was hard for A and E was easy for E).

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

    Since the font size are same, you can tear a piece of paper to make a ruler, or take screenshot and compare the length of them in software like mspaint.

    Task A is probably too complicated for Div2-A, but it is a nice task for Div1 player (many ways to fail it). :P

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it
      1. my variant is shorter
      2. there is no way to press '0' 10 times instead of 9
»
8 years ago, # |
  Vote: I like it -8 Vote: I do not like it

For problem D I submitted a O(nlog^2n) solution and got TLE. I resubmitted the exact same code and got AC with 1716 ms. Is the Codeforces grader usually this inconsistent?

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

    That should be impossible, because CF checks and says something like "You have submitted exactly the same code before."

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

      I added an empty line that won't affect the code.

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

    Why can't I see any submissions for problem-D in your submission history?

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

      Maybe you forgot to click show unofficial.

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

Small Doubt:

In problem A, for testcase:

4
1468

One solution can be 4790. Please correct me if this is wrong. Thanks in advance.18957061

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

    Yep, it's your code answering YES while answer is NO.

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

Please fix the link to the editorial in the contest page, since it links to this post and not to the actual tutorial. Thanks for reading.