JOIN
Get Time
hs_support_faqs  Competition FAQ
Competition FAQ



How does rating work?
Occasionally, when navigating between rooms, I lose my cursor/focus, or stranger it may have two blinking cursors, but I can't type anything?
Why am I not able to copy and paste to my arena applet?
The small HTML window that holds the challenge applet does not pop up in Mozilla 0.9.4.
If I choose to code a solution in C++, which implementation of string or vector do I use?
How are returns of type double evaluated for correctness?
My submission failed because it ran out of memory, what's wrong?
More Questions? Contact Us
How does rating work?
Rating events occur at the completion of every round, following the system tests. Single round matches and tournament rounds are considered rated events, and therefore rating will be adjusted after each. Finishing first and advancing does not necessarily guarantee your rating will go up. It is based on your performance compared everyone else participating in that round, taking into account relative ratings. Click here to see a detailed description of the rating process.
[back to top]

Occasionally, when navigating between rooms, I lose my cursor/focus, or stranger it may have two blinking cursors, but I can't type anything?
This problem is currently being examined. The current temporary solution is to reload the applet.
[back to top]

Why am I not able to copy and paste to my arena applet?
This problem seems to be specific to JRE 1.3.1. Here is the fix asumming you are using JRE1.3.1: make sure to check for all java.policy files on your machine to catch the plugin JRE directory. If you are a Windows user, it should be something like c:\program files\javasoft\jre\1.3.1\lib\security. Add this permission to the java.policy file:
grant CodeBase "http://www.topcoder.com/-" {
permission java.awt.AWTPermission "accessClipboard";
};

[back to top]

The small HTML window that holds the challenge applet does not pop up in Mozilla 0.9.4.
This is caused by mozilla bug 101323 (http://bugzilla.mozilla.org), which is new as of 0.9.4. The effect of the bug is that you can't use Javascript Window.open to popup a new window with a background image. If you do, the browser becomes unable to open any new windows until you manually kill it. A workaround is to pop up a new window on your own and then go to the URL "http://www.topcoder.com/?Task=arena"
[back to top]

If I choose to code a solution in C++, which implementation of string or vector do I use?
C++ solutions that use string refer to the C++ string. Arguments or returns that indicate "vector" refer to the STL (Standard Template Library) implementation of vector.
[back to top]

How are returns of type double evaluated for correctness?
Since math involving floating point numbers is subject to rounding errors, double are evaluated differently than other return types. For most return types, your method's result must exactly match the result of the reference solution. Doubles, however, are a special case where your result must be correct only to a certain degree of precision. To determine whether or not your solution is close enough, the system will test as follows:
  • If the expected result is NaN, +Infinity, or -Infinity, your result must be also. (We do not plan on using any of these returns for the time being.)
  • If your result is within 10-9 of the expected result, your solution will be evaluated as correct.
  • If your result is between (1+10-9) * expected and (1-10-9) * expected, it will be evaluated as correct.
  • If none of the above are true, your result will be evaluated as incorrect.

If the return type is a double[] (vector<double> in C++) each of the elements of the array must pass the above tests.
The exact implementation of this is:
static final double MAX_DOUBLE_ERROR = 1E-9;
private static boolean doubleCompare(double expected, double result){
if(Double.isNaN(expected)){
return Double.isNaN(result);
}else if(Double.isInfinite(expected)){
if(expected > 0){
return result > 0 && Double.isInfinite(result);
}else{
return result < 0 && Double.isInfinite(result);
}
}else if(Double.isNaN(result) || Double.isInfinite(result)){
return false;
}else if(Math.abs(result - expected) < MAX_DOUBLE_ERROR){
//always allow it to be off a little, regardless of scale
return true;
}else{
double min = Math.min(expected * (1.0 - MAX_DOUBLE_ERROR),
expected * (1.0 + MAX_DOUBLE_ERROR));
double max = Math.max(expected * (1.0 - MAX_DOUBLE_ERROR),
expected * (1.0 + MAX_DOUBLE_ERROR));
return result > min && result < max;
}
}


[back to top]

My submission failed because it ran out of memory, what's wrong?
Using any form of output to the console (cout in C++, System.println in Java, Console.WriteLine in C# / VB) will add to your memory use. The system has to redirect the standard out to memory so that it can trap the results. This means that if you have a lot of output in your code, it will likely fail testing.

We recommend that you remove all output statements before submitting your code to avoid this situation.
[back to top]