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

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

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
  • Проголосовать: не нравится

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

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

  • »
    »
    15 лет назад, скрыть # ^ |
    ← 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;

»
15 лет назад, скрыть # |
 
Проголосовать: нравится 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

»
15 лет назад, скрыть # |
← 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".