Xellos's blog

By Xellos, history, 9 years ago, In English

Hello everyone!

CF round #333 (both divisions) is going to take place today. The authors of this round are me and Baklazan.

By total coincidence, I'm the author of even-indexed problems and Baklazan the author of odd-indexed problems. Now I'm going to let you wonder if it's 0-based or 1-based :D.

As usual, thanks to GlebsHP for his help (in particular, helping us not overkill the problems), MikeMirzayanov for CF and Polygon, Delinur for problem statement translations and our testers: misof, Mimino, AlexFetisov and winger.

I wish good results and rating changes to those who earn it, as well as a zero-sum rating update to everyone.

Score distribution:

Div. 2: 500-1000-1500-2250-2250

Div. 1: 500-1250-1250-2000-2500

Winrars:

Div. 1

  1. jqdai0815

  2. JoeyWheeler

  3. rng_58

  4. PavelKunyavskiy

  5. mnbvmar

Div. 2

  1. liuyibo

  2. Mi_Sawa

  3. HeartBeats

  4. marian.darius

  5. EasyRed29

(homogeneous colours :D)

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

| Write comment?
»
9 years ago, # |
  Vote: I like it +71 Vote: I do not like it

A contest authored by Xellos! I bet the statements will be really funny!

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

"as well as a zero-sum rating update to everyone"?

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

    you can take this blog as an example. The amount of positive vote Xellos gets here is proportional to downvotes other get. so, the amount of all downvotes here including yours + the amount of upvote Xellos get is almost zero. Hope this helps.

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

the soonest announcement.

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

what do you mean of posting a programmer cat photo?

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

I think you have to swap links of (animated version, original)

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

    No, I don't. It's correct the way it is.

»
9 years ago, # |
Rev. 14   Vote: I like it +115 Vote: I do not like it

You have also changed the screen of the laptop...:D

»
9 years ago, # |
Rev. 6   Vote: I like it -40 Vote: I do not like it

Deleted

»
9 years ago, # |
Rev. 7   Vote: I like it -108 Vote: I do not like it

Xellos write:

"I'm the author of even-indexed problems and Baklazan the author of odd-indexed problems"

So,The the index of the problems start with 0 or 1?(In other words,A Div2 indexed by 0 or 1?)

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

    Yes.

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

      Yes? :-/ What yes? :-/

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

        The the index of the problems start with 0 or 1?

        Yes, with 0 or 1.

        • »
          »
          »
          »
          »
          9 years ago, # ^ |
          Rev. 2   Vote: I like it -88 Vote: I do not like it

          No,I say Which problem indexed by 0?(A div2,C div2,... or B div2,D div2). It seems that A div2,C div2,... are indexed by 0.(by reading you last answer.).Is it right?

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

            Why would you even consider the possibility of B div2 and above being indexed by 0? That would mean A div2 indexed by a negative number.

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

              if we indexed A by 1,B by 2 and ... ,problem B div2 ,D div2 and ... are even-indexed but if we indexed A by 0,B by 1 and ... ,problem A div2 ,C div2 and ... are odd-indexed.Is it out of mind?

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

                Is it out of mind?

                Yes — it's on screen.

                I can keep this up longer than you :D

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  9 years ago, # ^ |
                  Rev. 2   Vote: I like it -38 Vote: I do not like it

                  Holy heck, you guys are pricks. The guys was asking a genuine question and all you do is downvote him. I mean, yeah sure it's fun messing around with someone for quite a while, but you know... You could just answer his question in one of the comments.

                  Oh and in case you're in the "hurr durr i is veri smart cant read broken englando"-zone, he asks:
                  "Since you are the author of even problems and Baklazan is the author of odd problems, does the indexation of problems begin with 0 or 1? In other words, which problems did you design: A, C, E, Div1 E or B, D, Div1 D?"

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

                  Why it's so hard to read the post?

                  I'm the author of even-indexed problems and Baklazan the author of odd-indexed problems. Now I'm going to let you wonder if it's 0-based or 1-based :D.

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

                  Oh, what a horrible thing I did! FYI I don't want to reveal it yet, so that people could read the problems in arbitrary/strategic order.

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

                  Since the debate reached its maximum indentation level, not sure who you guys talking to :p

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

                  In the comment headers, there are ^ and # links. Have you ever wondered what they mean?

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

                  No. I have better things to wonder, because.

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

Hi Xellos,

You did not mention Maria Belova (Delinur) in your round announcement. I'm guessing she did not do problem statement translations?

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

    Not yet, since the problem statements aren't ready yet. Mystery of the Early Announcement...

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

      I volunteer for problem statement translation, whenever they're ready.

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

        From English to English?

        • »
          »
          »
          »
          »
          9 years ago, # ^ |
          Rev. 2   Vote: I like it -29 Vote: I do not like it

          What proof do you have that I am not Russian? Or, say, that I don't understand Russian?

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

            tu russian nahi Xellos ka kutta hay :D

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

              He's abusing Xellos, calling him dog. Google translate.

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

                So, I_love_Captain_America is Indian. But, Guys he is such an evil. Google can never translate any of my words: Click for Proof. The real translation is:

                "tu russian nahi" — means, you are not russian

                "Xellos ka kutta hay" — means, you are a bitch of Xellos

                I didn't abuse any dog calling Xellos.

                @Bullspeck, Why did you mislead a whole community against me? Learn to respect your own country. People like you are a shame to its own nation.

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

                  People here are not idiots. The link you gave doesn't translate shit. I translated words, not the whole rubbish you wrote.

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

                  I didn't abuse any dog calling Xellos.

                  Shame on you.

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

                  After he mentioned India, I translated using some Indian languages, and this is the result click

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

                  viesis, calling any human a dog is disrespectful. Did I_love_Captain_America/Xellos say anything disrespectful to you before you posted that? btw, the translation is wrong.

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

                  @ruhan, I think calling that I_love_Captain_America as bulldog would be fine. but if you think it is disrespectful to the dog-species then let's call this user ass whole, would it be ok?

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

                  Whatever, I have no interest to talk with you anymore.

                  If that is true, then why did you tag me in your next comment? I got an unnecessary mail in my inbox drawing my attention to your nonsense comments and forcing me to give you one final reply.

                  You illiterate dipshit dont you know how to use Google translate? There are many languages in the options as source language, and you uneducated shit using both source and destination as English facepalm

                  I used almost all the languages in drop down menu to come to the realization that the word means dog. I kept changing language till the word didn't translate to the word itself. Took 5-10 minutes that's all.I didn't know it was Indian language at the time, I just figured out what it meant.

                  I am not Russian, and I was shitposting about translating to Russian, for fun. But I am not Xellos' dog, you little twat-faced bitch. I will not respond to any more of your cum ments so GET THE F*** OUTTA HERE YOU BASTARD.

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

I don't know how to post gifs, but you can post this instead...

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

>contest will take place in a few days
>proceeds to schedule the contest in 16 days from the announcement

I'm calling shenanigans

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

    The "16 days" is when I made a template with pretty much nothing. Blog post "publishing" times can be misleading.

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

From now on, all(or most of) the contests are held in 'unusual' time, right? A 300000-millisecond-delay!

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

What's even-indexed problem if our eyes aren't real?

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

Cat. Keyboard. #include <string>?

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

So the main character of this round will be Pusheen? :D

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

negative votes please :)

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

Hey, why do you have to conduct all of your competitions on Tuesdays? I can neither participate in round #333 nor #334, because of a Tuesday schedule conflict. Can't you reschedule #334 on another day?

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

    There was a blog post about a week ago saying all competitions have been on Wednesdays and Thursdays (or Fridays?) recently. Actually, the statistics of standard CF rounds for the past 2 months including the upcoming contests is:

    • Monday — 1
    • Tuesday — 2
    • Wednesdays — 2
    • Thursday — 0
    • Friday — 3
    • Saturday — 1
    • Sunday — 3
    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it -23 Vote: I do not like it

      Well, at the very least it would be nice to not have two competitions on the same day of the week (Tuesday) in two CONSECUTIVE weeks, like the case is now... Is there a way to suggest this to admins?

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

        Is there a way to suggest this to admins?

        Yes, you can write to them.

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

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

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

Gif is working :O

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

Is it rated?

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

MikeMirzayanov would be wrong to expect 333 coderforces t-shirt ( one extra for me to draw attention about it ) for this 333 round :D As 333 round comes only once in a codeforce life time we can expect 333 codeforces t-shirt :D

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

    I thought 333 comes once again after N, as other numbers do :)

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

In the email CF sent
Attention! Unusual start time: the round starts on Tuesday, November, 24, 2015 16:35 (UTC).
but this is the usual time :D

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

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

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

Nice Russian translation :D.

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

I am afraid of this contest :(((((

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

Автори -> Авторы

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

Wow. The number of "This comment is hidden because of too negative feedback" comments is way too high for this blog post.

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

I've been shit-posting a lot for the last couple of months, hardly did any competitions, and hated solving problems altogether. I didn't realize that the reason I started hating it is because I've already solved the easy problems and the difficult ones are left. Today I got a real nice kick to think my actions over, and so, after this one, no more shit-posting, only learning and competing and repeat.

_< (So mad at myself)

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

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

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

The Contest starts with Score distribution announcement :D

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

    lool Decoded it using ubuntu :D
    will be revealed right before the contest

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

It's funny that ubuntu base64 couldn't decode ZDJsc2JDQmlaU0J5WlhabFlXeGxaQ0J5YVdkb2RDQmlaV1p2Y21VZ2RHaGxJR052Ym5SbGMzUWdL R0ZqWTI5eVpHbHVaeUIwYnlCMApjbUZrYVhScGIyNHBDZz09Cg==, but Mac base64 could.

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

ZDJsc2JDQmlaU0J5WlhabFlXeGxaQ0J5YVdkb2RDQmlaV1p2Y21VZ2RHaGxJR052Ym5SbGMzUWdL R0ZqWTI5eVpHbHVaeUIwYnlCMApjbUZrYVhScGIyNHBDZz09Cg==

Base64-decoded it ...

d2lsbCBiZSByZXZlYWxlZCByaWdodCBiZWZvcmUgdGhlIGNvbnRlc3QgKGFjY29yZGluZyB0byB0 cmFkaXRpb24pCg==

Base64-decoded it again ....

will be revealed right before the contest (according to tradition)

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

downvote me

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

if you are too lazy to double decode, here's the score distribution : Div. 1: 500-1250-1250-2000-2500 Div. 2: 500-1000-1500-2250-2250 glhf!

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

В определеннии константы Липшица подразумевается целая часть? Округляем вверх или вниз?

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

    As you asked in the English site, I'll answer in English: it's the ceiling function, rounding up.

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

      Sorry, my bad. Thank you.

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

Codeforces was down for me almost all the contest, I couldn't load the page at all, did this happen to anyone else?

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

    Codeforces was up for me almost all the contest, I could load the page without any trouble at all, did this happen to anyone else?

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

      I ask because this is the first time this happens to me, I tried with various internet connections, It took me over an hour to get to the front page.

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

Submitted solution of B in last 3 seconds and pretests passed! Phew, that was close!

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

    How did you solve it? Could you, please, explain? :)

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

      Div 2 B was DP . dp[i][0] = longest sequence such that its last element is a[i] and it is the smallest element in the sequence Similarly, for dp[i][1] (if a[i] is the largest element in the sequence) Transitions are : 1 . a[i+1] — a[i] = 1 : dp[i+1][1] = dp[i][0] + 1 2. a[i] — a[i+1] = 1 : dp[i+1][0] = dp[i][1] + 1 3. a[i] = a[i+1] : dp[i+1][j] = dp[i][j]+1

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

        I also have a solution without dp.We can deal with the initial array a to a new array p so that the continous same element will combine.Then for each p[i] we find left_max and right_max and judge whether they can be combined.But this solution is n^2 , we can use a array v to mark the element we have dealed . Because once it was dealed , we dont have to deal it twice. By this trick,it will be a O(n) solution.And thank you for your solution, you know i am not good at dp:) I will deal it with dp tonight:)

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

      It's two pointer approach question. We start from i=0 and left=0 and keep track of minimum and maximum elements while traversing and we stop when abs(a[i]-minimum)>1 or abs(a[i]-maximum)>1. Then if(abs(a[i]-minimum)>1) we put left=minimum index + 1 and if(abs(a[i]-maximum)>1) we put left = maximum index + 1. Then again we start traversing with i and these steps repeat until i!=n.

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

    It looks like the pretests are very weak. I submitted two solutions to C that had a bug in them and passed the pretests.

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

      That is the point of the hacking bro :)

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

jqdai0815 solved from E to A, like in a div.2 round :'(

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

    Good tactic if you can usually solve E reasonably quickly. Relatively easiest to relatively hardest :D

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

    It seems my solution to D will fail system test. I find it's wrong right after the contest.

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

      What do you think is wrong there?

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

        Size of array is too small. I use a stack to store trash nodes. But I forget to add the trash nodes to the stack. So it required space.

        I think I should test my code instead of playing game. (>_<

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

          Game name please

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

          The worst-case memory should be ints. If you're not allocating memory in very a stupid way, it shouldn't be a problem.

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

        Oops, my solution passed system test. I don't know what happened. >_<

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

    Why are you so young and so red?

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

That sudden realization 5 minutes before end of contest, that if first city doesn't have a road to the target city, means it has a railroad to that city. So it's a one-dimensional BFS then...

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

    These slow Estonians...

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

    Holy crap you just ruined my whole day

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

    Oh... I didn't realize that! How can I not figure it out??

»
9 years ago, # |
Rev. 4   Vote: I like it +5 Vote: I do not like it

Div-2 A: I think many forgot the fact that pow(x,y) != ceil(pow(x,y)) Hacked 6 in my room with

3 5
1 0 0
2 24
1 0
  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How? it should be a simple if(25>24) — I used manual powers tho.

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

      25 > 24, but pow(5,2) will return 24.9x, so if you store it as long long, it will get stored as 24.

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

        on my compiler long long x = pow(5,2) returns x = 25

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

          You can try this :

          for(i=2;i<=40;++i){
              for(j=0;j<=10;++j){
                  if( ((long long)ceil(pow(i,j)) - (long long)pow(i,j)) !=0 ){
                      cout<<i<<" "<<j<<"\n";
                  }
              }
          }
          
          • »
            »
            »
            »
            »
            »
            9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I am unable to understand why could that happen. I tried this on my system, as well as on ideone — link. Both terminate without any output.

            Could you provide an insight on why would pow(5,2) be 24.9 and not exactly 25?

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

              Because pow accepts it as a double and double being a floating point type has precision issues. http://www.cplusplus.com/reference/cmath/pow/

              Kind of similar why one cannot compare doubles precisely.

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

                But same thing runs fine on my system as well as on online compilers. Why should that behave differently on codeforces?

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

              I don't know the exact reason. The output depends on the compiler I guess. I use Codeblocks and I got (long long)pow(5,2) = 24

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

                Codeblocks doesn't use g++. It uses a variation of it.

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

That was really tough I tried to solve problem A by converting all values to base 10 and then comparing them,like this,but I kept getting the sum as 0,don't know why,could anyone help?

int power = 0;
int  sum = 0;
int s = n - 1;
for(int s; s <= 0 ;s--){
    int l = x[s] * pow(bx,power);
    cout << l;
    int sum = sum + l;

    power++;
}
cout << sum;
  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Why do you set int s = n-1 outside the loop then make a new variable with the same name inside it?

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

    You're declaring a new variable called sum inside the loop. Change int sum = sum + l; -> sum = sum + l; so that it updates the outer scope's sum.

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

      I updated it to this I still get 0 as sum

      int power = 0;
      int  sum = 0;
      for(int s = n - 1; s <= 0 ;s--){
          int l = x[s] * pow(bx,power);
          cout << l;
          sum = sum + l;
          cout << sum;
      
          power++;
      }
      cout << sum;
      
      • »
        »
        »
        »
        9 years ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        In the for loop 's' is initialised to n-1 but the check is s <= 0. Shouldn't it be s >= 0 ? In the present code, the for loop is not getting executed.

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

    Why are you declaring int s inside for loop??

    Should it not be ~~~~~ for(s; s <= 0 ;s--) ~~~~~

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

i started contest 40 minutes late but it was fantastic!

thanks Xellos ! :D

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

Div2D can be reduced to finding sum of max (a[i]..a[j]) with l <= i <= j <= r.

Again, headshot-ed by D. Even O(N log N*Q) solution get TLE. Is there a way to solve D in O(N*Q)?

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

Could someone tell me what the hell is wrong with my code??? http://codeforces.net/contest/602/submission/14455186

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

    Phew finally found it. Try this

    7

    1 1 2 2 3 3 3

    Your code gives 4 but answer is 5.

    PS — You need to update the value of maxVal and minVal as you traverse through input that's where the problem lies.

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

Nice contest. I wish i hadn't wasted much time on B though and moved to C directly :\ I am not even sure for B but C was sure if i could submit in time :\ So yeah i was right, 5 more minute would have made it for me :( http://codeforces.net/problemset/problem/602/C --> http://codeforces.net/contest/602/submission/14457506

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

I was very close to do an unsuccessful hack because of this pearl:

#define int long long

I guess it helps some coders to not even think about overflow cases but I can imagine many people have fallen for it and failed their hacks. What do you guys think?

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

    Right at the same time I complained about the same subject !

    And unfortunately this trap screwed me in hacking :[

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

    I made the exact same mistake last contest. A smart idea actually since ratings is a zero-sum game.

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

4 unsuccessful hacking attempts !

2 of them defined int as long long on A, what's wrong with you people ?

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

For problem C, suppose that the condition that "all pairs of nodes without a railroad connecting them must have a road connecting them" was removed. How then could we solve this problem?

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

    2D BFS (my actual solution without realizing the condition you mentioned, probably failed)

    In a node of a BFS you save position of the bus and the train. Then when you dequeue it, you add all the nodes where bus can go * where train can go, except if their destionations equal.

    So, if the state is (2,3) it means bus is at the 2nd node and train is at the 3rd node. Then you look where bus can go: for each destionation you look where train can go (except the same destinations) and add them to the queue if they are not visited.

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

      We can just do it with bfs. Train or bus will get to the city n in 1 hour for sure, because the edge (1,n) belong to bus or to train. For transport, that can't do it, we can just do bfs.

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

        The user I answered to asked what if the condition that train or bus will have a road to the target city would be removed, meaning what if there would be pairs of cities without any roads inbetween.

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

A new legendary grandmaster is born...

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

It took me 15min to pass pretests on Div1 B, and then I spent over an hour trying to get an idea of Div1 C, even though they were valued the same :\ . What did I miss? What's the approach for Div1 C?

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

    There are 2 steps here:

    1. Use linearity of expectation --> you only need to care about 1 opponent.
    2. Use DP to calculate the probability that the opponent has better score
    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'm not sure I understand. So what if I find the probability that one opponents has better score? How does it scale to M opponents?

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

        E(# participants with better score)

        = (M-1) * E(1 participant has better score)

        = (M-1) * (probability that 1 participant has better score).

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

      I got to step 2, knew it was DP but couldn't figure out how to do it. Looking through the solutions, I see something with prefix sums and a DP table of dp[processed races][current sum], but still don't know how it works :(

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

Really sorry for them whom are getting WA on 45 in DIV2 A.....I think many of you don't know pow function doesn't work appropriately in codeforces.

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

    The problem is not in codeforces, but in c++.

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

      Can you Explain,pls?I was sometimes ago getting wa while upsolving a problem.In a test case my code was showing different output for my compiler and the judge compiler.Then somebody tell me pow function doesn't work appropriately in codeforces.But I really confused that time,Can u pls tell the real reason

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

What's the solution of Div1 B?

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

What may be the reason of WA40 in div1A?

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

    Maybe you use pow in c++, which is incorrect. Try this test:

    10 10
    9 9 9 9 9 9 9 9 9 9
    9 16
    2 5 4 0 11 14 3 15 15
    

    Answer: =.

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

    Using an stl function pow.

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

    Seems we fail if the parity is wrong and there are no cycles to fix it or something. I don't have the edge n->n so it has to go away and return.

    e.g.

    I give 3 for

    3 1
    1 3
    

    The method has no observation about one takes 1->n immediately, just does a BFS on the state (train at, truck at, who moved last).

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

      Here was irrelevant message about other problem. Thanks for downvoting instead of simply explaining it.

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

i have solved problem C with O(n^3)! will it get TL?

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

How to solve Div 2 C. Is it some kind of 2D BFS ? Can anyone share the approach ?

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

    if there is an edge from 1 -> N then we can do a bfs for road system and report the distance of N from 1 , if there is no edge from 1 -> N , there is a road from 1 -> N so we can use that and find distance from 1 to N in rail network and print the distance of N from 1 using rail.

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

      Thanks! I missed the observation that edge 1->N exists either for rail or for road network.

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

    No, it is simple 1D BFS, you just need the observation that the there is a road or railway from city 1 to N that will take one hour that is only available for one vehicle and you just need to compute the shortest path of the vehicle that didn't have this edge.

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

    I realized only afterward that if the traintrack isn't directly connected to the end position, then a road MUST be. So the Min time for either the train or the bus is 1. Then, from there on it's a straight up BFS over all the positions and the min number of steps to get to the end is the answer. I still solved it, just rather stupidly...

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

How to solve Div2 B? What is the main idea?

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

    Idea of simplification was to add 1 to all odd numbers of array, then find longest consequence of same elements. And repeat the same with even numbers.

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

      How did you come up with that? Did you solve a similar problem before?

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

          Thank you so much!

          This is like a fishing rod instead of a fish. Much more valuable than just knowing the solution :)

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

          Could you help me out to realize what's wrong with this sliding window approach?

          http://codeforces.net/contest/602/submission/14458195

          I'm just increasing the size of my window whenever I can do it and then decreasing when there are more than 2 different numbers inside the window, what means that the difference between max and min should be at least 2.

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

            You might run into something like 1 2 1 3 where you would run into 2 mins before hitting a max.

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

            Try this test case

            6

            5 4 5 6 4 5

            ans is 3 but your code is giving 4.

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

          Hi can you help me understand why this doesn't work ?

          http://codeforces.net/contest/602/submission/14498228

          My idea is to keep low and high and when the difference of either low-high or high-low becomes >= 2 then I move the low or high value to the right until it becomes a valid value.

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

            Input

            9

            4 5 4 5 6 6 6 6 6

            Correct output — 6

            Your code is giving 8. Why? Because when it first encounters 6 then it increments lind to index 1 but it should have incremented to index 3.

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

      Thx) Also I saw another versions of solution, someone uses RMQ, dichotomy... So variative)

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

        What is RMQ and how dichotomy can be used for that problem? :)

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

      I tried a similar approach.Finding the longest sequence of two or less numbers:14460365

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

    Even O(n^2) are passing.Its sad.

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

very good contest!thank you a lot!

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

In this round fest and Shadow are cheaters.

Here are their solutions for B:

14455597

14455707

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

    Check their ranks in Round 322 -> 276 and 277

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

    yeah, their codes are identical. Any idea why their run-times differ? (One is 202ms and the other 187ms)

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

    It's out of competition though right? Is that still considered cheating?

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

Could you explain what does the name of div1D mean? In Russian it's pretty nonsense not related to the problem (or I'm too dumb to notice it).

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

    It has no connection to the problem other than what a tree with any letters is in chemistry. (Organic chemistry really has a letter for everything — R stands for "anything", for example.)

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

I'm actually stunned of how test cases are so strong for problem C and weak for problem B. If you want to know what I mean look at this submission. http://codeforces.net/contest/602/submission/14448575 and got Accepted! with complexity O(n^2)

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

    Wow, so there was no need for dp. Now this really looks like a div2B problem.

    I need to adjust my assumptions about the speed of codeforces machines, so maybe next time I'll do better in the contest :)

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

      Why would it need a dp :| You can do it in O(n) without the need of dp anyways.

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

        I didn't understand that when I wrote that comment.
        Now I know that there is a very beautiful solution described here :)

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

I enjoyed all problems so thank you for a round Baklazan and Xellos.

Though I don't like your editorial. Hints are better than no editorial at all but I would prefer to be able to decide if I want to read whole solution immediately.

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

    I would prefer to be able to format everything properly immediately. But we don't always get what we want.

    This is still better than waiting for everything at once.

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

    Where is the editorial?

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

I am getting correct answer on my PC but WA in CF: http://codeforces.net/contest/602/submission/14455593

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

    During Educational Codeforces Round 1 hacking, I found distinct answer for a same code ran in my PC and CF. However, I didn't know why.

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

      Maybe the precision of double

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

        But I have not used floats or doubles anywhere in my code.

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

          the function queryInternal doesn't return anything. Whether it goes wrong?

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

            Thank you for helping. I corrected it and it got accepted. non-void function not returning a value is undefined behavior.

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

Admins Please take a note on this. Strange thing happened I don't know the reasong.
In my solution 14444210 to the Div 2: prob A. It says wrong answer to test case 45. I have tested with the same test case in my system as well as in ideone.com here and gives the correct output.
Please look into the matter. Thank You

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

    You used pow function which gives say pow(5,2) is 24.999999. So when you take the long long you actually get 24...

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

      but then why does it work on my pc (using g++ btw in linux system just in case) and also the online compilers. And that makes pow totally worthless!!

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

        I am not entirely sure, but once I put round() around my pow function, it worked.

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

          K... I had to implement my own pow function to get it accepted!! Btw thanks... I am not going to use pow again!! it was strange tho!!

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

Nice problems and nice day. But I still don't know why I get RE on pretest 8 in Problem B div.2 for my first solution.

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

What is the reasoning for not including any big tests to break single hashing in pretests?

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

    Well. Why would they want such a test in pretests?

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

      I mean, pretests should test basic correctness. If the solution is going to fail on most big tests, it seems to me pretests should check that.

      Most of the reasoning for weak pretests is for hacking. (right?) D's don't get hacked a lot and it's pretty risky to hack so it doesn't seem to serve this purpose. I guess this is mostly about the point of system testing, which I don't think is to make people fail.

      Well, anyway I guess I shouldn't assume that such tests are included next time and just double-hash to begin with :/

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

        I think you should estimate the probability of collision first. https://en.wikipedia.org/wiki/Birthday_problem

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

          You are absolutely right about checking probability. I mostly was thinking that pretests would catch bad solutions (as per CF's increasing tendency to have strong pretests, maxtests, etc.) Rather, I'm referring to what seems to me intentionally failing these tests in systests rather than pretests: (Also re: desert97)

          I was assuming that the authors let hashes pass pretests intentionally and fail later, not just randomly. This is based on statements like "which is why there are anti-hash tests :D" (which might be referring to abbabaab... instead), but also how almost all hashers failed test 13, even with different hash systems.

          If this is correct, this is the thing that seems kinda bad to me since it's just there to make people fail. I feel like that's what pretests are for and designed to do — make it so people don't think their solution is right when it actually has a big problem. Of course hacks lessen this problem, but who hacks on D? (oops rev1 was correct...)

          I'm also a little annoyed at dropping from 10th to 105th due to systests :/, but I think I would still think the same way if I passed. Pretests are something that have always been a bit strange, and I guess I would appreciate a bit more clarity and consistency on their purpose.

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

        I think the above thought process (referring to waterfalls's post) is not correct. Think about it this way:

        Say there are 10 pretests (standard) and 60 total tests. Say that there is a probability p that you get hash collisions. (One can compute p with some NT maybe...) Let's assume p is fairly small.

        The probability that you pass all pretests is: (1 - p)10. The probability that you pass all tests given that you pass pretests is

        (1 - (1 - p)50) ≈ (1 - p)10·(1 - (1 - 50p)) = 50p. So if p is something like 1 / 100,  you'll pass all pretests with something like 90% chance, but pass all final tests given that you passed pretests with only 50% chance. It could just be a probability thing. The 90% is probably even an overestimate given that most pretests are very small cases, so p ≈ 0 in those tests.

        If I did shitty math, please tell me.

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

      In problem B of division 2 O(N^2) is passing system testing

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

Good problemset I'd say.

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

My solution has been skipped ...

I do the Contest & solve the Problem for Upgrading my Rating ... then why this types of injustice ... Watch my submissions ... They didn't match to any others but any others submissions match to mine ... But why should I get the Penalty of rating loss?? what type of injustice is that ???

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

OMG, waiting for rate changing will kill me one time.

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

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

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

for problem(A): My code passed all pretests but was rejected in systesting on testcase#45. When I run this testcase in my pc its giving correct answer, u can see my code in my submissions.

Test: #45, time: 0 ms., memory: 0 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER Input 9 39 10 20 16 36 30 29 28 9 8 9 38 12 36 10 22 6 3 19 12 34 Output < Answer = Checker Log wrong answer 1st words differ — expected: '=', found: '<'

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

    dont use power function. your code power function does not work correctly.

    so, if a=2,and b=3; find a^b; for(int i=1;i<b;i++) { a=a*a;

    }

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

      where does it not wok properly? why its working on my pc and not on codeforces ? plz explain.

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

Now it is midnight,but still wait for rating. After brainstorming ,pain in the brain. So,plz give the rating as soon as possible.

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

It seems that many O(N^2) algorithm are passing system tests for test B. I think the solutions for atleast B should be rejudged.

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

    yeah, now today was surely a bad day I solved 2 problems within 50 mins and both of them was rejected during system testing and I dont't know why . for problem A if the power function doesn't work , then it should give wrong in my pc too but when i checked ,the answer is correct in my pc.for problem B its giving TLE after system testing. Is anybody having the same problem ? can anyone explain me why this mismatch is happening?

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

      Man i am saying that O(n^2) solutions are not bound to pass because n=100000 but i saw various problems in which it is passing in 1900ms

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

        Ok they have carefully applied n^2 breaking the inner for loop when required but the setter needs to create such cases where these solutions do not pass.

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

      fnf47 do you have wrong answer on test 45 on problem A?

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

        yes JustInCase in system testing it gives wrong but is fine when i run it on my pc.I read the above comments but still the concept behind this is not clear to me .There must be some valid logic behind this.

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

          Do you use pow function?

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

            yes,and now its accepted . I used ceil(pow()) instead of just pow(). But one thing is still bothering me , if pow(a,b) gives wrong result on codeforces for some a,b then why its correct on my system?

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

              The way that mathematical operations are done on each computer can be different as different processors can use slightly different algorithms for certain mathematical operations. If you went out and bought the exact computer they are working on and compiled with the same compiler, you would get the same result as on CF.

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

When will rating changes be updated?

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

http://codeforces.net/contest/602/submission/14446757

Guys, someone hacked my solution with TLE. Why isn't it passing, it's O(N^2) on 10e6 max

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

    O(N^2) = 10^6 * 10^6 = 10^12 so TLE

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

      It's 10^5 actually  100 000

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

        so, O(N^2) = (10^5)^2 = 100000 * 100000 = 10000000000

        Is it ok???

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

          10^5 with O(N^2) passes in the tasks i solved.

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

            No, only with some smart optimizations (breaks).

            O(n^2) cannot pass all tests.

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

Editorial...

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

I had the problem after the contest finished: the judge skip my 2 solutions for A and B. I have taken part in more than 100 contests of Codeforces and although I didn't do it well, I never cheat or do something like this. I don't know why. :(

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

I tried Div2 B in Java during the contest : link

and got TLE in test case #22 in the main tests

Then, I tried submitting the same code in C++ : link

I've used the same logic for both the solutions, yet the C++ solution actually gives TLE only on test case #31.

Why is the solution time not adjusted depending on the languages? :/

Well, yes, this time it didn't make any difference, but some other time, maybe it would?

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

А где разбор?

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

What a likeness!!!
(602B - Approximating a Constant Range)=((6E - Exposition)-(cout<<b<<endl;))
It was enough to copy and paste someones code to get accept in this task.
Just read both problems.