Nerevar's blog

By Nerevar, 12 years ago, translation, In English

Hello everybody.

On the 8th and on the 9th of December there will be local two-stage school competition in Saratov. We decided that it will be interesting to allow everybody to solve problems from it. So I am glad to announce that this weekend there will be two Div2 rounds.

The first round — Codeforces Round #154 (Div. 2) — will start at 14:00 MSK on the 8th of December.

The second round — Codeforces Round #155 (Div. 2) — will start at 14:00 MSK on the 9th of December.

Rounds will be held under usual CF rules, with one condition:

Problems will require file I/O: you have to read data from input.txt and write data to output.txt.

Score distribution will be announced just before the beginning of each round.

Participants from Div1 can take part in rounds out of competition.

UPD Here are links to solutions with file I/O in some languages:

UPD2 Score distribution in round 155 will be standard: 500-1000-1500-2000-2500.

UPD3 Tutorial is available for round 154.

UPD4 Unfortunately, in the first half of the contest, it was found that the task C checker does not check the lexicographically minimality of the answer. We offer our apologies for this error. So we adjusted checker. We conducted an investigation and found that the change has affected 53 members from the second division. We believe that a completely fair to make this competition for such participants unrated. This inaccuracy had absolutely no effect to all other.

UPD5 Tutorial is available for round 155.

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

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

a typical comment:

wish you all luck !!

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

Two contests on two days :D. I and a part of CF Users will have two sleepless nights :D

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

    Haha, but I have enjoyed those two contests in the daytime, cool enough!

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

I am happy to hear it. Thanks for your kindness!

»
12 years ago, # |
  Vote: I like it -6 Vote: I do not like it

Why At This Time ? That's Too Bad

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

    Any time you choose for contest will be good for some people and bad for other. And there is no way to do something with that.

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

Will these rounds be rated?

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

    yeah it will be rated

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

      div1?

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

        read the post completely and then ask your questions :)

        Participants from Div1 can take part in rounds out of competition.

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

          For the others div2-contests, participants from div1 can take part too, but as non official (non rated). The question is still valid. I would be interested by an official answer.

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

            Oups, sorry, double fail. Didn't seen the end of the sentence ><

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

at this time i have math :(

»
12 years ago, # |
Rev. 3   Vote: I like it -21 Vote: I do not like it

Time of the contest is too bad! Couldn't it be taken place at usual CF rounds' time(19:30)?

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

    It is a school contest so the online contest has to be at the exactly same time.By the way,I think it isn't a bad time,at least for Eastern Asian constants,who have to stay up midnight for contests at usual time.

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

    I can't agree with you more

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

By the way, I'm the only who likes the time of these contests? :)

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

and exactly after finishing Codeforces Round 154 we should switch to UVA for ACM ICPC:: Dhaka Regional Semilive! what a busy days, full of contests and programming! but i like being exhausted by contest-based days !

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

Wouldn't be a good idea to put sample A+B problem at least for C++ an Java languages, for those who are not familiar with I/O from files?

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

    On C++ just add this code

    freopen("input.txt", "r", stdin); //redirect input stream from stdin to input.txt
    freopen("output.txt", "w", stdour); //redirect output stream from stdout to output.txt
    

    and after that you can use you favorite read/write methods (cin/scanf, cout/printf)

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

      I think you made mistake "stdout" in second line

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

    #include <fstream>
    #include <iostream>

    using namespace std;

    int main()
    {
    ifstream in("input.txt");
    ofstream out("output.txt");
    int A,B;
    in>>A>>B;
    out<<A+B<<endl;
    return 0;
    }

»
12 years ago, # |
  Vote: I like it -51 Vote: I do not like it

Russians should practice English a more lot. 30% WAs are due to their problem statements in English. They should check the statements by a native English man.

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

    We will be very happy to have such an opportunity. But I also think that some green coders from Bangladesh should practice solving programming tasks a lot more. The rest 70% WAs are due to their poor skills.

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

      Well this was offensive from both of you. It is not good to have such situations on programming competition site.

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

I join this site because hear about this contest... :)

and the example code of I/O is very helpful, thanks...

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

In c++ freopen's are allowed but everytime i was sending a code in java with

System.setIn(new FileInputStream("input.txt")); System.setOut(new PrintStream("output.txt"));

runtime error was coming everytime! Why is that not allowed in Java?

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

Contest is over, help me, please, with problem C. Did anybody wrote something besides BFS?

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

    Yes

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

    The idea is: Go from r1 to some intermediate row i and then go from that intermediate row i to r2 (using ups or downs), after that get to the right column(using lefts or rights).

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

Enormous speed of system testing makes me happy :D

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

    Also very good problems

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

      Yeah, really good problems. But much more difficult than the same school olympiad in Novosibirsk :)

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

I got Runtime error in system test, but I can get the right answer in custom test.... why can this thing happened?

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

    While。。。 It's my fault, I haven't seen that the data was read from input.txt....:-(

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

I sent the first problem, got TLE (because I used no file) and lost rating. I was thinking failing in test case 1 didn't count as a submission, so I abandoned the contest. :\

EDIT: I would like to ask someone why this happened, since from contest rules:

"If the result of the judging is Compilation Error, Denial of judgement (or similar) or if the solution didn't pass the first pretest, then this solution won't be considered in calculating results."

Did I get it wrong?

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

    You do not get -50 for such submission, but it still counts as participation.

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

Only integer and int64, and I have failed problem D :(

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

2724941 :D somebody solved D using 2000ms

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

Looking at the constraints, i thought BFS would TLE for Problem C but i got AC'ed in practice ( 234ms ) :(

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

I am getting TLE in div2 C with bfs. Can anybody tell why? Here's the link to my solution — http://www.codeforces.com/contest/253/submission/2728384

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

    HashSet? ArrayDeque? Point? Objects, objects everywhere! Of course, it's TLE!

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

    I think your skill isn't good because i got AC in 468 ms

    2724998

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

      ok! we've all understood that your programming is very good!

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

    finally AC, had forgotten to override hashcode()!!

»
12 years ago, # |
  Vote: I like it -19 Vote: I do not like it

Why File I/O style was used in this match? I think that the unusual format only mislead people. Please tell me the reason.

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

    I think, all school olympiads testing systems use file I/O, but, I afraid, the reason of this is unknown

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

Is it possible to get some more specific details about Compilation Error? My code compiles well locally, but when I try it here it gives Compilation Error without any good explanation of what could've mistaken.

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

    Me too. I tried to submit "Boys and Girls" (#154 Div.2 A) just now. I got 2 "Runtime exceeded" on Test #1 and 1 "Compilation Error". But I put those 3 codes onto the "custom test" provided and input the test case #1 (3 3). It is ok. Can anyone tell me what mistakes I have made?

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

      oh. I have understood already. Because I haven't read the instructions of this contest. Sorry.

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

Please somebody tell m why i am getting time limit exceeded in the following code,while i could run the exact same code on code::blocks, http://mirror.codeforces.com/contest/253/submission/2723001

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

    "Problems will require file I/O: you have to read data from input.txt and write data to output.txt"

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

The score distribution for the round #155 will be the same with #154 ?

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

System testing isn't going to show us surprising speed today :)

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

I'm wondering why the system testing hasn't begun yet? thx~

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

Can anyone tell me how to solve 155 problem C? I stuck in that problem..

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

    Although I did not participated in the contest, But for me solution seems like this.

    First you can decide that minimum no of changes part easily. So if you fix min no of changes. Let call it z.

    Then for the lexicographic part , Go from sorted order of characters in t , and try doing the change in corresponding character in s , If you can do the change , Then do it. Continue this until you have done z changes.

    Although things explained are very high level , But you should try to go into more depth yourself.

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

Just saw my ranking go down from 304 -> 252 even before systests has started.

What happened?

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

There is a typo in UPD5.

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

Nice editorial, I had the idea of E but didn't implement it, I went to hack 4 people instead.

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

UPD4 Does it mean that this competition should be unrated for me? Bad luck... I solved four problems.

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

    Once again — you didn't solve problem C. Actually you had wrong answer on pretest 9, but system told you invalid response that the solution passed it. It affected only 53 participants (including you).

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

      Oh...Sorry...Next time I will check my solutions more carefully...Thank you...

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

Challenge Master

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

Why I'm out of competition?

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

" UPD5 Tutorial is available for round 154. " Shouldn't it be round 155? Or i make a mistake?

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

Why I am out of contest? I register the contest before and solved 3 problem during the contest.

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

I'd still have managed a rating increase inspite of the Problem C issue. Bad luck! :D

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

My rating went up and then dropped back to the previous value, however my color has not changed? What happened?

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

    Ok it seems it is back to normal now, thank you! sorry about that.

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

Can somebody help me, please?

I am div 1, and i send sources for problems A and C at round 155. For both of em i get WA1.

Now i send the solutions again, and i can't see my answer .. This is my sol for A .. http://mirror.codeforces.com/contest/254/submission/2742588

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

    you have to use files instead of standart input\output

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

    You are using iostream You need to read from a file (input.txt) and output to a text file (output.txt) I suggest you use fstream, comment iostream and just add the following lines: ifstream cin("input.txt"); ofstream cout("output.txt");

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

    Ohh .. i just saw the input and the output :(

    Sorry .. I thought that was just like in the older CF-s .. with stdin.

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

    I think 28th line isn't funny.

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

the test# 4 in problem E my output is : 17 3 1 3 4 0 5 1 6 8 5 1 6 8 2 7 4 1 6 7 5

i calculate it by hand is correct , but the check log said "wrong answer impossible to feed friend 5 at day number 3."

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

Why a submission is judged TLE in a test case that passed in the Pretests?

See: 2735059 Passed pretest 9 --> TLE in test 9

Are the same input data?

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

    The exact TLE output depends on the load on the server as well as your code. You should be safe if you actually go for the intended complexity bound of the solution. In this case it is O(n) and yours I presume is O(nlogn). Here luck plays some role.

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

in round 155 (Div 2) for the problem B why is the greedy algorithm wrong ??

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

    How did you use the greedy algorithm? It's just the maximum number of jurors that have to work at one time.

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

I got WA in the problem D on the test 57 but I don't know why, and the test data is too huge.. Here is my code 2745258 . :D

Thanks.

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

    Oh..I find my mistake in the "bfs2"... I'm curious about that the code can pass 56 test datas :P

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

hey why was the server down again???????!I don't wanna waste my time seeing the home page again & again.

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

I have solved the Physics question and I'm getting the right answer even when I run it under the "Custom Test" tab.. However, I'm getting a run time error or wrong answer error when I submit the solution. What is wrong?

http://mirror.codeforces.com/contest/253/submission/2822370

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

    Note the trap: input.txt, output.txt.