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

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

Recently, each time when I summit, it said:

Source code hasn't submitted because of warning, please read it.

Please do not use the %lld (or similar) specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator. Press button to submit the solution.

so I have to summit again! that is to say , each problem, I have to summit two times.

My system is Ubuntu 10.04. IDE: Codeblocks.

I can not bear that, help me please. Thanks!

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

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

What's your problem? You don't want to click twice, or I misunderstand you?

  • »
    »
    12 лет назад, # ^ |
    Rev. 3   Проголосовать: нравится +16 Проголосовать: не нравится

    Sorry for my bad English. I mean that: no matter what code I write, when I choose file (Source file) and click 'summit'. the system of codeforces.com give me a warning:

    Source code hasn’t submitted because of warning, please read it.

    and the warning is: Please do not use the %lld (or similar) specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator. Press button to submit the solution.

    so I have to choose the file again and click 'summit' again.

    you can see what Gassa said be above. thanks!

    My code template:

    .... using namespace std; .... typedef long long lld; typedef unsigned long long u64;

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

You must carefully read warnings of codeforces system. It seems that instead of printf("%lld") you must use printf("%I64d") for long long or you can use cin and cout to read/write big numbers.

P.S. Sorry for bad English

»
12 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

It could be a "false positive" kind of warning generated by this line of code:

typedef long long lld;

Edit: indeed, both this and my own template (which is intended to work for both MinGW/Windows and G++/Linux) now generate the warning:

#ifdef WIN32
#define INT64 "%I64d"
#else
#define INT64 "%lld"
#endif

I hope the authors of the warning system consider fixing the warning rule a bit, so that it gives less "false positives".

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

    Yep, regex is needed to be improved to handle the first case correctly. But the second case seems to be indistinguishable.

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

      Uh... then consider changing the tool (regex)?

      At least you could include a tick "don't want lld warnings" in the settings and point to it in the warning text.

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

      You can run gcc -E — it runs preprocessor and outputs preprocessed source.

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

        The problem is that it is impossible to make such checking in frontend. Obviously, web server can't run gcc -E so it is only possible to pass source code to the backend (judge, we called it contester) and it returns verdict something like Ignored and the reason.

        For now I've improved the regex and we will implement checkbox like "Do not show me this warring". I believe it will be enough.

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

    Yeah, you are right. Thanks very much! but about half month ago, my code with 'typedef long long lld;' could summit normally.