Блог пользователя slycelote

Автор slycelote, 14 лет назад, По-английски

(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 post

Q. 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.com/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.com/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?
A. Try google or this query: "http://codeforces.com/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.






  • Проголосовать: нравится
  • +14
  • Проголосовать: не нравится

14 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится
Q3. Should I do anything special right after a contest starts?
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.

:)
14 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
Great!

Q4. What languages are supported? What are the compiler options and run command lines?
A4. Please, check this post
  • 14 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится
    Mike, your site is seriously wrong. Know what? You pasted that comment as Russian. As I did below.
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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++?



14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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++?
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Actually, "%lld" works perfectly fine, if you submit using "Visual C++" instead of "GNU C++", and I believe is should be mentioned.
14 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
A2. There's big performance difference between
  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.
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
A4. No. But you can see the number of test on which your program failed.

[rus_spoiler]Думаю ещё стоит описать особенности системы комментирования: символ ^ и backspace (browser.back) для возврата на предыдущее сообщение.[/rus_spoiler]
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Не знаю, в чем особенности, это нормальное ожидаемое поведение)
  • 14 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    А для меня было открытием.
    Месяц мучался, а потом меня научили. :-)
14 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится
Проще писать всегда и "%I64lld" незадумываться =)
  • 14 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    Можно вначале программы сделать ifdef внутри которого задефайнить LLD (или что-то еще) нужной строкой. И потом использовать дефайн в форматной строке. По-моему так проще. и это точно работает.
    • 14 лет назад, # ^ |
        Проголосовать: нравится +2 Проголосовать: не нравится
      Я раньше использовал ifdef , один раз обламался ((
      Больше не использую ....
  • 13 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    а еще проще cin/cout, редко когда ввода/вывода столько что это важно
14 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится
"%I64lld" на топкодере криво работает, кроме нужного ещё кучу пробелов выводит.. так что не всегда
13 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
Please, add that the judge machines are Core 2 Duo, 2.67 Ghz (E6750).
13 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
Когда нажимаю на ссылку из А3, пишет что невозможно найти заданного пользователя. Firefox
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Is %s also having problems?
13 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
Хороший FAQ. Сделайте на него ссылку с главной страницы, чтобы новички сразу его могли увидеть, а не задавать одни и те же вопросы на форумах
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Q: How can I know test, where my solution has a WA/TL/..?
A: Click My submissions and then click for submission's id and scrool down
13 лет назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится
Q9. How can I find some useful information on this site?
A9. Try google or this query: "http://codeforces.com/search?query=<what do you want>".

13 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
Q10. Why are my comments crashed?
A10. If your comments suddenly disappeared, you used copy-paste and your comment have some incorrect tags. Try to watch html code of your message (button "< >") and erase all charset tags. If system told you "Rendering to html failed: ....", you use "\$" symbol as a symbol. Comments can contain some formulas () with help of "\$" symbol. Try to avoid this symbols.
13 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится
Q10. Why are my comments crashed?
A10. If your comments suddenly disappeared, you used copy-paste and your comment have some incorrect tags. Try to watch html code of your message (button "< >") and erase all charset tags. If system told you "Rendering to html failed: ....", you use "\$" symbol as a symbol. Comments can contain some formulas () with help of "\$" symbol. Try to avoid this symbols.
13 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
Q0. What are the rules of these contests?
A0. Read this.
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Думается мне в Q9
«http://www.google.ru/search?sclient=psy&hl=ru&newwindow=1&qscrl=1&q=site:codeforces.com&qscrl=1&aq=f&aqi=&aql=&oq=&pbx=1&cad=h»

стоит заменить на
«http://www.google.com/search?q=i%27m+searching+for...+site%3Acodeforces.com»
13 лет назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится
Q. Hi! I'm new at this site. What can I do?
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
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Q. I want to post all my templates for sharing my beautiful code. Can I do that at this site?
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.:
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Thanks for the contribution everyone. Sorry for the delay, I don't receive e-mails about new comments for some reason.
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
How can I ask a question about a problem that is used already in a contest?
  • 13 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    I think that the best way is to write about it on your blog or find the blog with this particular contest and ask your question there.
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Is it possible to change the handle? It'd be nice if I could change it to my Name+Surname making easier for my friends to find me.
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
When I registered for the Contest but at the time it due, I'm busy and can't not attend, will it affect my rating? (I mean will it count as I solved zero problems?)
»
11 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

в связи с плохим знанием сайта у меня возник такой вопрос — как добавлять в друзья? На сколько я понимаю, это удобно инструмент переписки

  • »
    »
    11 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Зайти в профиль человека и нажать на звездочку справа от ника.

»
10 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How could I get problemset which are get input and output from a txt rather than standard input and output...?

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
8 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

As far as I can see this

 printf("%I64d\n",n);

is not necessary yet. I checked on cppreference.com using different compilers and here using GNU and MS compilers. This piece of code

 scanf("%lli\n",&n);
 printf("%lli\n",n);

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.