(This FAQ may be outdated. Please refer to official help).
I'm sure we won't need this post after Codeforces comes out of beta, but meanwhile it could be useful :) Feel free to suggest what should be added here.
Competitions: general
Q. What are the rules of these contests?A. Read this.
Q. What languages are supported? What are the compiler options and run command lines? What is the configuration of judge servers?
A. The judge machines are Core 2 Duo, 2.67 Ghz (E6750). The full list of supported languages and compiler options can be found in this postQ. How do I hack other's solutions?
A. First lock your own solution in the main ('problems') tab. Then in your room double click or Ctrl+click the solution you want to hack. Check this post for complete rules concerning hacking.
Q. How is rating calculated?
A. The rating system is described in these two posts. Note that even for a joined contest the rating updates are calculated separately for the first and the second divisions. Therefore, a situation is possible, when a div2-coder performed worse than a div1-coder in the same contest, but gained more rating points.
Competitions: writing code
Q. How do I read/write 64bit integers in C/C++?
A. If you submit under "GNU C++" or "GNU C" option, use this:
printf("%I64d\n",n);
but NOT this:
printf("%lld\n",n);
If you submit under "MS C++" option, both variants should work.
And of course, with C++ you can always write
std::cout << n << "\n";
Q. How can my program determine whether it runs in Codeforces server?
A. For most programming languages Codeforces environment defines the symbol ONLINE_JUDGE. Again, see this post for details.
Using the site
Q. How do I read other people's code?
A. After the contest is over, go to its page (for example, http://codeforces.me/contest/15 ) and click on this picture: . You will see a page with several submits (currently 100, I think). You can sort and filter the solutions there. To see the fastest solutions, you need to manually paste a URL like this: http://codeforces.me/contest/15/status/A?order=BY_ARRIVED_ASC
(currently there's no way to do this via UI)
Q. During the practice, can I see the test case that my program failed on?
A.No. YES! Go to 'My submissions' tab and click the link showing the ID of your submission.
Q. How can I find some useful information on this site?
Q. Why are my comments / post empty?
Q. Can I post a highlighted code sample?
A. Currently the best way is to submit the code to a service like codepad.org and post only links to the submit.
Q. I've found a bug! When I upvote a post, its rating increases by 2 points, but when I downvote a post, its rating decreases only by 1 point.
A. It's not a bug, it's a feature.
A.
Q. How can I find some useful information on this site?
A. Try google or this query: "http://codeforces.me/search?query=<what do you want>".
Q. Why are my comments / post empty?
A. If you used copy-paste, your comment may have some incorrect tags. Try to look at the HTML code of your message (button "< >") and erase all charset tags. If the system tells you "Rendering to html failed: ....", you used "\$" symbol. Codeforces supports
Unable to parse markup [type=CF_TEX]
formulas which are enabled by this symbol. Try to avoid it.Q. Can I post a highlighted code sample?
A. Currently the best way is to submit the code to a service like codepad.org and post only links to the submit.
Miscellaneous
Q. I've found a bug! When I upvote a post, its rating increases by 2 points, but when I downvote a post, its rating decreases only by 1 point.
A. It's not a bug, it's a feature.
A3. Yes, you should. Open all problems in different browser tabs as soon as possible.
There is a good chance you won't be able to do that later, because of the server's occasional shutdowns.
:)
But seriously, it happened only twice, I think. (Although I usually try to follow this advice anyway :) )
Wrong.
Q2. How do I read/write 64bit integers in C (GNU/ mingw)?
Q3. How do I read/write 64bit integers in C (MSVC)?
Q4. How do I read/write 64bit integers in C++?For GNU only I64d.
std::cout << std::endl;
and
std::cout << "\n";
The first statement flushes output buffers to disk, so it is much slower. It matters if output is huge.
[rus_spoiler]Думаю ещё стоит описать особенности системы комментирования: символ ^ и backspace (browser.back) для возврата на предыдущее сообщение.[/rus_spoiler]
Is the configuration upgraded or is it still the same?
From https://codeforces.me/blog/entry/8457 they are using i5-3470, but that is also kind of outdated. I'm pretty sure they use some sort of dynamic cloud system now.
A. Here is some tactic:
1. Solve the Problemset starting from most solvable - seems to be a more simple problem.
2. Wait for a registration for a next contest.
3. Register, check yourself in registrants ().
4. Wait for the contest starts, read the original interesting contest rules, don't get confused with them, read the rules again.
5. Write the contest.
6. If you are not in «Top rated», goto step 1.
7. ???????
8. PROFIT
A. Yes (?), but you should better post your code on one of the services like codepad.org and have just one post, containing your templates, e.g.:
How could I get problemset which are get input and output from a txt rather than standard input and output...?
You can't.
how to raise a help query regarding a submission which gave right answer on my compiler as well as ideone but wrong answer on codeforces
Try to compile and run your solution with codeforces compiler: http://assets.codeforces.com/files/mingw-4.9.2.7z
Actually now we use mingw-tdm-gcc 5.1.0. For Windows users easiest way to install is to use PBOX http://pbox.me/ and install the package using the command
pbox install mingw-tdm-gcc
.As far as I can see this
is not necessary yet. I checked on cppreference.com using different compilers and here using GNU and MS compilers. This piece of code
works well. You can use %lld also. I'm not sure 100% that I properly tested it, but I think it is time to review this Q-A.
Dear Codeforces Team,
I am writing to appeal the recent rating reduction for my solution to Problem 2036D, as flagged due to similarities with other submissions. I understand that this process is automated to maintain contest integrity, but I assure you that I approached the problem with original thinking and adhered to all competition guidelines.
Solution Overview: In my code, I used a method to extract "layers" from the input grid, then count occurrences of a specific target string by iterating over each layer. This approach involved:
Layer Extraction: By traversing the matrix edges from the outermost to the innermost layer. Counting Occurrences: Using string manipulation and a sliding window approach. Study Resources Referenced: Before the contest, I studied a few sources on matrix traversal techniques and string pattern matching, specifically:
General matrix traversal methods to work with layers or spirals. Sliding window technique for string matching from standard tutorials. These foundational methods could explain any unintended resemblance between my solution and others submitted in the contest, as they represent common problem-solving patterns.
Request for Review: Given the honest approach I took and my careful adherence to the rules, I kindly request that my rating be reconsidered. I’m committed to fair competition and would never intentionally engage in any actions against the rules.
Thank you for your attention, and please let me know if I can provide further details or clarifications.
Best regards, racbhitbit