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

Автор moss3s, история, 6 лет назад, По-английски

I'm new on codeforces, and rarely use c++. Maybe the question was already discussed, but i cannot find anything except this.

Today i first time used c++ on the contest. And got message kind of "your code was not submitted, do not use %lld".

  1. Why is it bad idea to use %lld in 2018? Maybe this message is rudiment, and it is good time to dismiss it forever?

  2. Is it normal to not accept compilable code 1 second before end of the contest? Of course, now i see checkbox "submit anyway", but spent last seconds on testing and had no time to resubmit =(

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

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

For cross-platform support you can use macros from cinttypes, they look like PRId64.

Or just live a healthy life with std::cin.

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

    Thnx. PRId64 is smth new for me =)

    std::cin.. std::cout in my case. As i know, in c++ you can format string only using boost::format (not during the contest), or printf/sprintf. If we had smth like string.format like in java/python/kotlin, std::cout would be enough.

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

      Yeah, I guess you are right about it, no easy format string in std c++ are implemented.