Nerevar's blog

By Nerevar, 13 years ago, translation, In English

Greetings to everybody.

Today is an unusual day on Codeforces: two contests a day with quite small gap between them. The reason is that today the IX Regional team school programming contest is held in Saratov, and it was decided to use the tasks from it for Codeforces rounds.

That's why there are many authors of today's tasks. I would like to thank the whole jury of the school contest for their excellent job. The following people are on the jury: Artem Rakhov, Nickolay Kuznetsov, Natalia Bondarenko, Gerald Agapov, Polina Bondarenko, Ivan Fefer, Edvard Davtyan, Igor Kudryashov, Pavel Kholkin and me. I believe that you know all these people as Codeforces problemsetters.

Let me draw your attention to the fact that today all problems have file IO. But generators for the hacks should output to stdout as usual.

Special thanks to Maria Belova and Julia Satushina for translating problem statements into English.

Good luck at the contests!

UPD: Results of the 35th round. We congratulate the winner, Naginchik, on his impressive debut!

UPD: Results of the 36th round.

Links to problem tutorials: A, B, C, D, E.

Announcement of Codeforces Beta Round 36
  • Vote: I like it
  • +27
  • Vote: I do not like it

| Write comment?
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I don't understand what would be the difference if all problems have file IO?? can anyone please explain??
  • 13 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it
    It means that you should read input data from the input file and write output data to the output file. Names of the files will be in problem statements, I think
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      i havnt seen these replies of you guys and had plenty of idleness limit exceed during contest :(( and many coders had the same problem too. 
      I think it should have been explained before :(

      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        By the way thanks for the explanations :D
  • 13 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it
    You should read and write from and to files input.txt and output.txt.

    So, for exaple, in C++ you should have something like
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    at the beginning of your solution.
    And usually you should not.
13 years ago, # |
Rev. 3   Vote: I like it +16 Vote: I do not like it

For those who are not familiar with file IO, there are several solutions of "A*B" problem in some popular programming languages:

Pascal / Delphi:

var
    a, b: longint;
begin
    assign(input, 'input.txt');
    assign(output, 'output.txt');
    reset(input);
    rewrite(output);
    read(a, b);
    writeln(a * b);
    close(input);
    close(output);
end.
C/C++:
#include <stdio.h>
int main() { int a, b; freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); scanf("%d %d", &a, &b); printf("%d\n", a * b); return 0; }
Java:
import java.io.*;
import java.util.*;

public class Solution {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(new File("input.txt"));
        int a = s.nextInt();
        int b = s.nextInt();
        s.close();

        PrintWriter writer = new PrintWriter("output.txt");
        writer.println(a * b);
        writer.close();
    }
}
13 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
edit: I had misunderstood the problem
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Can contestants from division 1 find out their rating in this contest if they were in div. 2?
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
What is test 13 for problem D? (Round 36)
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I got this error : Idleness limit exceeded on test 1, what does that mean? This was for problem A (round 36)
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    If you dont take the input from input.txt file (which is added just for today's contests)then it shows that error.
13 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it
 
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Please tell me how to solve problem D of round 36(new game with chess piece).
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    make some table with with some small k, then find the pattern.
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
what is test 22 on prob E?  (round 35)
»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Your problem statements are pathetic