FAQs PROBLEMS

Have any doubts about the URI Online Judge? Here you can find the answers!

  • How do I submit problems of my own to the portal?

    First, follow the steps below:

    • Format your problem on URI Online Judge Builder (https://www.urionlinejudge.com.br/builder/);
    • The title should be CamelCase (first letters of each word capitalized);
    • Variables should be in bold in all text;
    • There should be two versions of the description, one in Portuguese and another in the English language (Spanish is optional). Without one of the two versions, your problem will not be published until be translated into the one or other language;
    • Download the generated files.

    After this, you need to create the inputs and outputs and a solution (in C or C ++) that should receive "Accepted".

    • Inputs are files with name xxx-a.in, where xxx is the name of the problem (if more files are required, should follow the nomenclature, like xxx-b.in);
    • Outputs are files with name xxx-a.sol(same rules of inputs, just different extension);
    • There have to be at least 10 test cases;
    • Each file must not surpass 10MB

    If you, as an author, want to limit the solution approach that should be adopted to the problem (for example, want to spend an n.log2n solution but do not want to pass a solution n2 or n3) should then send a second solution that should receive "time limit Exceeded" with the time given to the problem, so we can test whether the set time limit is correct and do the necessary adjustments. Remember to test the limits of the problem.

    All of these files must be added to a folder that should be referred to portal@urionlinejudge.com.br with the subject [New Problem] - Name of your problem. All problems pass through a check before being added to our repository, and new additions happen all Mondays.

  • May I suggest problems from other sources?

    Yes, since there is an explicit authorization of the author to use your problem on the portal URI Online Judge. Even so, the problem should be formatted in the Builder (https://www.urionlinejudge.com.br/builder/).

  • I am finding difficulties/doubts with a problem. Where can I find help?

    Unfortunately we do not have time to assist, through the feedback channel, our users find errors in their codes. But the URI Online Judge has its own Forum (urionlinejudge.com.br/forum) where you will find discussion topics to all UOJ problems and can post your questions.

  • I found a mistake in the description or IOs of a problem. How do I contact the team about it?

    To contact about an error in the description of a problem or report any probable input and output error, you can contact us through the feedback page, posing as the title of your message "Error XXXX problem description" or "Probable error in XXXX problem files."

  • What is an input that ends with EOF?

    In this kind of input, there is no specification about the number of test cases. It might be 1, 2 or more than 1 million.

    Usually an input file with 3 test cases could be presented as:

    7123
    32
    125
    

    In C++, this kind of input could be solved by using a program like this:

    int N;
    while (cin >> N) {
       ...
    }
    

    In Python, this kind of input could be solved by using a program like this:

    while True:
        try:
            ...
        except EOFError:
            break
    

    In C#, this kind of input could be solved by using a program like this:

    using System;
    
        class URI {
    
            static void Main(string[] args) {
    
                string line;
    
                while ((line = System.Console.ReadLine()) != null) {
                    ...
                }
    
            }
    
        }
    

    In Java, this kind of input could be solved by using a program like this:

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
     
    public class Main {
        public static void main(String[] args) throws IOException {
            InputStreamReader ir = new InputStreamReader(System.in);
            BufferedReader in = new BufferedReader(ir);
           
            while(in.ready()) {
                String str = in.readLine();
            }
        }    
    }
    

    This means that while there is an integer in the input file, it will be read the variable N.

  • Time Limit in Java

    If you keep receiving time limit in Java, make sure that your solution is using more optimized methods of input and output. As test cases can be large, if you use Scanner and System.out your solution will receive "Time Limit Exceeded". Only problems in the Beginner category will accept solutions with those methods.

  • If my code gets TLE, does that mean it is correct but takes too long?

    No, TLE (Time Limit Exceeded) simply means that your solution exceeded the limit amout of time determined for the problem. Your solution never finished running in time, so it was interruped. Thus, there is no way to tell if your code was correct or not.

  • I keep getting "Wrong Answer"! What is wrong?

    If you keep getting "Wrong Answer" and believe that your solution is correct, please check if your source code:

    • Is not printing nothing more than requested by the problem description, i.e. input messages, e.g. "Enter x:";
    • Is printing the last line of output followed by the end-of-line characted "\n";
  • Wrong Answer in simple problem using floating-point

    Try to use double instaed of float in C++. This is a common error due to the difference in precision between them.

  • Number of digits after the decimal point

    Using C++, this is one of the possible ways to format a number with 5 digits after the decimal point:

    #include <iomanip>

    In the main (before printing the output, in any place), use:

    cout << fixed << setprecision(5);
  • What is uDebug? How can I use this tool on the resolution of problems?

    The uDebug is a tool that you can verify if the way that you solved determined problem is correct. To do that, you has to solve the problem and compile your code with a input, and copy the output generated. On the uDebug page of the problem, you just need to paste the input and the output and the website will return if your output is correct or not.