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

Автор coder_Aditya_404, история, 3 года назад, По-английски

How can we add new test case to the problem which may fail many of AC solutions?

EDIT 1: Low possibility for such test case but curious if its possible to do as above?

EDIT 2: Supersized to know this fact that even operations > 1e9 can be done in 2 seconds. Thanks

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

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

See testcase 24.

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

Maybe you think the solution should get TLE. No it shouldn't, because compilers are clever enough to optimize such code.

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

    how in my ide compiler(g++) it shows TLE, can you explain or direct me to sources where i can find more about it? Thanks

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

      It's actually not about >1e9 operations per second. The compiler optimizes that for loop to a formula.

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

      What are you compiling options? Is -O2 set? Are there any other configuration differences?

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

        How can i check compiling options, I don't know about it? btw i use VS code and "code runner" extension to run them in VS code.

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

          Do you have a build file or just compile manually?

          If it's the first case, look for launch.json or tasks.json file and you can edit your preferred command line arguments in args key.

          If it's the second case, you can optimize your code by passing some optimization flags during compilation.

          EDIT:

          For Code Runner, type @ext:formulahendry.code-runner in settings and click Edit in settings.json under Code-runner: Executor Map and you can edit your compilation command in cpp key.

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

Auto comment: topic has been updated by coder_Aditya_404 (previous revision, new revision, compare).