Nerevar's blog

By Nerevar, 11 years ago, translation, In English

Greetings to the Codeforces community!

I'm glad to announce that we again decided to introduce a round based on one of the programming olympiads for schoolchidren in Saratov. This time it is a round for participants from Division II. Round will start at unusual time for Codeforces: 12:00 MSK.

The problems were prepared by MikeMirzayanov and me, while Fefer_Ivan and Gerald helped us with writing alternative solutions.

Members of the first division can participate out of competition, as usual.

Scoring distribution is standard: 500-1000-1500-2000-2500.

UPD: tutorial can be found here.

UPD 2: The model solution for problem E (unfortunately, there were only one model solution) was incorrect. But, the answers for all pretests were correct. After the round we fixed the solution. All submits for problem E were rejudged.

UPD 3: Results are final, ratings are updated.

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

| Write comment?
»
11 years ago, # |
Rev. 2   Vote: I like it -16 Vote: I do not like it

Why the contest is only for div 2?

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

It is a contest for singles~~~~november 11th~round 211...Monday...So many "one"!

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

What's the meaning of schoolchildren? Which ages does it contain?

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

    This olympiad is for students from 8th to 11th grades of Russian school.

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

E was a nice problem.

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

Happiness is

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

Can someone give the approach to solve problem D : Rent Bike ? Thanks in advance...

  • »
    »
    11 years ago, # ^ |
      Vote: I like it +2 Vote: I do not like it
    • first make n equals to m : if (n>m) take only the richest m boys, if (n<m) take only the cheapest n prices.
    • use binary search to search r , store the total amount spent by boys s everytime you check the condition in binary search. The answer for s is the last true condition in binary search check (that is, the largest possible r we found).
    • To check the condition in binary search, check it greedily : let's say you want to check for the answer X, then choose X richest boys and X cheapest bikes. Pair them respectively and see if it's possible for those X boys to buy those X bikes.

    Sorry for my English :)

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

Ohh , why did I sleep through this contest :( . It looks like I missed a cool codeforces round :) .

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

can someone explain me the reason why this solution did not passed?

  • »
    »
    11 years ago, # ^ |
    Rev. 2   Vote: I like it +6 Vote: I do not like it
    t+=s[0];
    t+=s[1];
    

    t contains 2 chars now, but in answer there is only one (s[0]).

    s[1] does not exist at all, actually, so that I wonder why it is not runtime error :)

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

      and what will change then in string t after this? t is same as answer,

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

        What is s[1] ? You think that it is empty?

        You read string in s, but its length is 1, so that you didn't determine what is s[1]. The only character will be written in s[0], so that s[1] is undetermined.

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

      Thanks! My solution failed because of this too!

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

      I think that s[s.size()]='\0', got AC using printf("%s",t.c_str()); 5066622

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

Problems were very interesting. Thanks to Authors...!!!

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

    Same thing happened to me! My Submission fails on test 15:

    Input
    zz
    Output
    zz
    Answer
    zz
    Checker comment
    wrong answer Result is not a subsequence: 'zz' not in 'zz'

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

    it maybe due to this piece of code

    ans += s[0];
    ans += s[1];
    

    u are adding 2 characters to ans, when there is only one character in input.

    EDIT: but what i dont know is why this resulted in Wrong Answer rather than Runtime Error. also, i agree with you that the Checker Log is contradicting itself!

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

      Yes. Thanks. It should add an extra '\0' to the output string. Removing it, it gets AC. But, I wonder why would an extra null cause checker program to fail.

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

        printf("%c",'\0') or cout<<'\0' will print a space.

        string str(10,'\0');

        cout<<str; will print 10 spaces while printf will stop at the first '\0'.

        -- MS C++!

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

.

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

In problem B , I solved in notebook using val += h[i] — h[g]; and unknowingly missed the + sign during coding 5061002 ,as the pretest passed i did not go through the code once :(

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

I got WA in Problem C (test 15) while my program gives the correct answer!

Here's my Submission

Can anyone tell me why this happened?

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

    This part is causing the problem : ~~~~~ if(s[0] == s[1] && s[1] == s[2]){ index = 2; }else{ s1[2] = s[2]; index = 3; }

    ~~~~~

    For the given case "zz", s[2] does not exist, thereby the control goes to the else condition and index is set to 3. So you are actually printing extra space along with your answer, which is invalid.

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

      in this case...s[2]='\0',it can't be printed...and the '\0'(0) is not the ' '(32)....in ascii...

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

    yes, my bad ... :( it is '\0' and shouldn't be printed. So the reason which I gave you, regarding your control going to the else condition is correct, whereas you are printing '\0'. Thanks for correcting me mathlover :)

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

Problem E is very nice, but nobody got E accepted during the contest... When will the solution be published?

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

    It's weird that I and several people got the same output for test 20. Is there something tricky in the problem that we possibly misunderstood?

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

How is the standings is computed? Through the submission is accepted, but the standings is so low:(. Can someone explain for me, 3kq.

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

Can anyone tell.why my this solution failed? 5062164

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

    Ok.Null charachter was the issue. But i want to know.Why did WA came on 52nd test case when i did not put null charachter in the Output string and printed using %s.

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

Test: #6, time: 0 ms., memory: 792 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER Input aaa Output aa Answer aa Checker Log wrong answer Result is not a subsequence: 'aa' not in 'aaa'

why aa is not in aaa?? http://mirror.codeforces.com/contest/363/submission/5062051

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

This contest was much easier with comparison to the previous ones...

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

    but the E... only one person ac it in the last minute...

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

Please !!! Update the rating !!! :( Eagerly waiting for that .....

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

How to get the test datas?

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

while trying to submit solutions in practice for today's contest, i got a message saying "Practice is allowed only for finished and unfrozen contests".

can anybody help me with this? thanks.

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

Interesting. Why am I the Candidate Master with rating 1699?

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

    I'm Master with rating 1408 :) I think they rollback rating because of some problems related to problem "E"

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

    It seems the rating change for this match has been reverted due to an issue of problem E,but they forgot to update the handle colour.....

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

Can you provide an official information of whether the contest will be rated or less?

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

When will we have the Final standings?

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

The editorial for problem E seems like brute force...What a strong test server...

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

This was my 100th rated contest on codeforces. After the contest, I have my highest score in an individual contest(4076) , my best rank in a contest (31), my highest rating so far (1742).

PS — How many people have 100+ contest on codeforces. Who has the highest number of matches? I know Egor with 111 rated contest. Anyone higher ?