yeputons's blog

By yeputons, 8 years ago, In English

Hello everyone.

Two years ago there was a post titled "Submitting IOI problems" and my comment there. I offered everyone to contact me via PM on Codeforces to get the access and be able to solve problems from past IOIs (starting with IOI 2003). What was important here is that PavelKunyavskiy and me took effort and made the system as similar to what was used on particular IOI as we could, including:

  1. Original tests from archives
  2. Tests grouping and correct subtasks scoring where applicable — you won't get 54 points if there are subtasks for 40 and 60 points — just like on IOI.
  3. Interactive problems with interactive I/O (say, "Aliens" from IOI 2007 or "Maintain" from IOI 2003)
  4. Partial scoring where you can get only a fraction of points per test, like "Reverse" from IOI 2003 or "Hotter Colder" from IOI 2010.
  5. "Encode-decode" problems, where your solution is executed several times in separate processes, like "Parrots" from IOI 2011.
  6. Open test problems where you submit answers only instead of solution, like "Forbidden subgraph" from IOI 2006 or "Maze" from IOI 2010.
  7. Graders like on IOI 2010 and further. Unfortunately, the "Black box" problem from IOI 2006 was also implemented as a problem with graders instead of running a real "black box" on our server which you can access remotely.
  8. "Odometer" problem from IOI 2012 where you had to submit a program on a specially invented language.

So far it was a closed judge available upon request only. As far as I remember, I've granted access to everyone who've asked — 150+ persons. Time flows and the judge eventually migrated to Yandex.Contest (the system used for Yandex.Algorithm) with help of lperovskaya. It still supports all of the above, but the registration is open for everyone and IOI 2015 is available there. Feel free to join!

Unfortunately, it's still a beta version and there are still some issues: no problem statements are visible in the interface, some labels may be in Russian only and graders for Pascal and Java may be non-working in some problems (C++ should work everywhere, though). Note that we use slightly different conventions for graders from what was on IOI (for the sake of consistency among all IOIs). You can download an archive with example solutions by clicking on the "Download" button right to the "Jury messages" link. If the button is not here, there is no archive with example solutions yet, but the format of graders should be very similar among all problems and we didn't change signatures of functions from IOI, so it should be fairly easy to "restore" the format.

I hope that will help all of you who are preparing for upcoming IOIs! By the way, if you have not advanced to IOI this year, I would highly recommend you to avoid reading several IOIs so you will have good problems preparing for IOI next year. It's hard to find good IOI-like problems.

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

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

The tests for Empodia (IOI 2004) are improved, but the change of constraints is not added in the English description (only visible in the Russian description).

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

Could someone explain how to submit a solution in a Makefile(I think that's what you're suppossed to do)?

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

    You just send the source code.

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

      Do I send the grader source code with my solution inside?

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

        No. You need to write your solution to an external file.

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

          I don't see how you can submit multiple files

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

            You only need to submit the file you had to edit. The grader files are available on the server. If you get problems trying to include certain header files, try removing those includes and it should work.

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

    You should implement all functions required by the problem in a single file and add #include "grader.h" in the beginning of your implementation to make use correct function signatures are used. This should be common for all problems regardless of what the problem statement says. E.g. it's always grader.h and it's always single file, even in problem "Parrots" from IOI 2011 where they originally asked for to separate encoding/decoding into two files.

    Afterwards, you should submit your file using "make2"/"Make"/"Makefile" language (it's the only language available) and it will determine the language based on file's extension. You should use "Send file", not "Type here" as the extension won't be available in the latter case.

    Say, you want to submit a solution for IOI 2012's "Last Supper" problem. This code, when submitted as some-sol.cpp, passes example test case and nothing more:

    #include "grader.h"
    #include <cassert>
    
    void ComputeAdvice(int *C, int N, int K, int M) {
        for (int i = 0; i < N; i++) {
            WriteAdvice(C[i]);
        }
    }
    
    void Assist(unsigned char *A, int N, int K, int R)
    {
        assert(GetRequest() == 2);
        PutBack(1);
        assert(GetRequest() == 0);
        assert(GetRequest() == 3);
        PutBack(2);
        assert(GetRequest() == 0);
    }
    

    You should not include any implementations of grader's functions, split your solution across several files, etc.

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

Hello, I think some bugs have arisen on the Yandex IOI judge. (2014 Holiday)

for a submission that has previously received points.

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

    I believe it's a temporary issue for all contests on Yandex.Contest right now (there are similar errors in Yandex.Algorithm mirror contest). I've notified those who are in response of the testing system, wait for an update.

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

Example solution for problem "parrots" from IOI 2011 is here. You should submit all required functions in a single file, header file is still single and it's called grader.h. Note that you still cannot pass any data from encode to decode

#include "grader.h"

void encode(int N, int M[]) {
    for (int i = 0; i < N; i++) {
        send(M[i]);
    }
}

void decode(int N, int L, int X[]) {
    for (int i = 0; i < L; i++) {
        output(X[i]);
    }
}
»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks for your website. But why do I always get CE when submitting problems? What should I pay attention to when submitting?

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

    The compiler error message should be visible if you receive "Compilation Error" outcome. Mind providing a link to your submission and/or the exact message of the compiler? It's better if the latter is uploaded to pastebin or something to avoid cluttering comments section on Codeforces.

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

      The link is here.

      The Compilation log is that:

      stdout:
      /bin/sh ./doit.sh
      
      
      stderr:
      /temp/compiling/a.cpp:1:20: fatal error: grader.h: No such file or directory
       #include<grader.h> 
                          ^
      compilation terminated.
      In file included from grader.cpp:1:0:
      graderlib.c:32:26: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
                   assert(scanf("%d%d"LLD, &P, &Q, &K) == 3);
                                ^
      make: *** [build] Error 1
      
      • »
        »
        »
        »
        7 years ago, # ^ |
          Vote: I like it +16 Vote: I do not like it

        grader.h should be in quotes, not in brackets.

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

          I tried #include "grader.h" and it got CE again..

          The Compilation log is that:

          stdout:
          '/temp/compiling/source' cannot be extracted via extract ()
          /bin/sh ./doit.sh
          No source file was found
          
          
          stderr:
          make: *** [build] Error 1
          
          • »
            »
            »
            »
            »
            »
            7 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            lperovskaya, PavelKunyavskiy, would you mind taking a look?

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

            All you need to do is to submit your solution as a file. I got exactly the same error when i copy/paste my code.

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

              right, disabled plaintext submit for this year and will work on others

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

              I tried to submit a file,but it got CE again...

              The Compilation log became:

              stdout:
              /bin/sh ./doit.sh
              
              
              stderr:
              In file included from grader.cpp:1:0:
              graderlib.c:32:26: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
                           assert(scanf("%d%d"LLD, &P, &Q, &K) == 3);
                                        ^
              ./ccqA1XoY.o: In function `main':
              grader.cpp:(.text.startup+0x1): undefined reference to `calculate'
              grader.cpp:(.text.startup+0x6): undefined reference to `update'
              grader.cpp:(.text.startup+0xb): undefined reference to `init'
              collect2: error: ld returned 1 exit status
              make: *** [build] Error 1
              
              • »
                »
                »
                »
                »
                »
                »
                »
                7 years ago, # ^ |
                  Vote: I like it +9 Vote: I do not like it

                You shouldn't mark your implementations as inline.

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

                  Well..Thank you for you help.

                  I have passed the tests..