yimao's blog

By yimao, 12 years ago, In English

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!

  • Vote: I like it
  • -16
  • Vote: I do not like it

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    12 years ago, # ^ |
    Rev. 3   Vote: I like it +16 Vote: I do not like it

    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 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      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 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        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 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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