Jul 02, 2016, 01:30 PM UTC (UTC) - Jul 02, 2016, 07:30 PM UTC (UTC)
Database | Version |
MySQL | MySQL 5.6 |
PostgreSQL | PostgreSQL 9.5 |
SQL Server | SQL Server 2014 |
Legend | Explanation | Icons |
RE | Execution Failed/Runtime Error | |
CV | Constraints Violated |
When you submit your query, We setup a new database, create tables, load data specified in the test case. Then, We execute your query on the freshly set up database and compare the result with expected output. If it matches, It is an Accepted Submission (AC). If it does not match, It is a Wrong Answer (WA). Check out the LEGEND on various output results.
Your code is tested by a HackerEarth SQL Service automatically, not by a human being, and you have to write your code accordingly. For each problem, there will be one or more input files, each according to the specifications mentioned in the problem statement, and corresponding correct output files. Your program is run on each of those input files. The output generated by your queries must match the correct output exactly in order to be judged correctly. So your statements must be in order.
If your queries start by echoing 'Enter the number' and the problem does not tell you to do so, then since this is not part of the correct output, your script will be never be judged as correct submission regardless of what the rest of your queries do. As all that matters is that the output files match, it makes no difference at all at what point in your program's execution that this output is written.
So there is no need to read all of the input before starting output; it is much more common to just print out each result as you are reading through the input. If you use any method other than using the standard input and output streams - for example, using command line arguments, reading from a file, opening up some sort of dialog box, or otherwise - your code will never be judged as correct submission.
Your queries are tested multiple times with different data in the tables. The execution time displayed is the total time spent in executing your queries against the database collectively. But your queries are terminated if it exceeds the time limit mentioned in the problem while processing any input file. Hence, Total execution time <= (Time Limit * Number of input files)
Your queries are constrained in following ways:
Your queries violated one of the above constraints mentioned.
No, Time Limit Exceeded or TLE means that your solution exceeded the amount of time which was determined for the problem or for that particular test case. Your solution never finished running in time, it was stopped in between. So, there is no definite way to say if the code was correct or not.
At times, this means that your SQL script may contain sleep, and your queries will never stop executing. In other cases, it may mean that your code will terminate, but not within the time limit indicated.
For example, if the time limit of an SQL script is 2 seconds, and your script terminates on 2.001 seconds, it does NOT mean that it exceeded the limit by 0.001 seconds, it simply means that the judge stopped evaluating your code after 2 seconds.
Your script ran successfully but gave an incorrect answer. Most probably your SQL script contains a bug, or you are not interpreting the problem text correctly. If your code shows that it has passed the sample input correctly, then remember that there are multiple input and output cases for which your SQL script is supposed to be evaluated, which is why in spite of passing the sample input cases, you’re still getting a wrong answer.
A runtime error means that the program was compiled successfully, but it exited with a runtime error or crashed. You will receive an additional error message, which is most commonly one of the following:
RE
The Error means your query execution failed.
Some ways to avoid runtime errors:
CV
The error means you have violated one of the problem constraints. Most common reasons are:
Max number of tables and Max number of rows per table are restricted.
No, You can't. Similarly, No one can view your solution.
There might be many submissions by many users. Sometimes our code-checker servers or web servers might be under maintenance. As soon as that gets over, your submissions will be judged automatically.
There might be an issue with the judge, contact a website admin asap. Drop a mail to vivek@hackerearth.com, or arjit@hackerearth.com.
You won't want to do that ideally. During contest if your code becomes public, Your account can be suspended, if detected for plagiarism.
If you think that some problem has an incorrect test data, its specification isn't clear or in your opinion something in the problem needs clarification, post a comment on the bottom of the problem's page. While posting comments, please keep the following things in mind:
If all this still doesn't answer your question, drop us an email at support@hackerearth.com.