kunnu96's blog

By kunnu96, history, 8 years ago, In English

Since during hacking we face such a solution sometimes which is likely to pass for small test cases and would definately fail for larger test cases sometimes its in type of array so suppose upto 1e6 .Then in that case since codeforces editor doesn't allow copy paste operation during hacking and we can't type such 1e6 numbers for just one hack and in a short duration. So can anybody knows solution of this or any method by which we we can hack that solution?? thanks in advance.. :)

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
8 years ago, # |
Rev. 3   Vote: I like it +6 Vote: I do not like it

There's a button that allows you to send hack generators the idea is to write a program that prints out your test case.

Don't forget to print a new line after printing the test case.

P.S.: Example hack generator in c++:

int main() {
    int n = 1337;
    cout << n << '\n';
    for(int i = 1; i <= n; i++) {
        if(i != 1)
            cout << ' ';
        cout << 1;
    }
    cout << '\n';
}
  • »
    »
    8 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    You must print a newline character, but flushing is unnecessary.

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

    ok actually i didn't noticed that button so closely next time will surely try.. Have u hacked in past some solution with large test case as such?

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

      To be honest, I'm not much of a hacker, so no, I haven't.

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

        But now a days codeforces is following a trend like they are setting 1st 3 uestions of less difficulty level and many people easily able to solve them and in 4th one they add some good data structure with some nice flavor which is not as easy to crack in a given time. So sometimes its better to go for hacking instead of doing the 4th problem to improve rank and rating

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

          There's no doubt that hacking can help you improve your rank and rating but think about it, how important is your rating after all.

          I would much rather struggle for 30mins trying to solve the 4th problem and end up with smaller rating rather than trying to understand someone else's solution and hacking it for a somewhat higher rating.

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

            don't take it otherwise i m saying in case u have tried 4th one and didn't getting anything so instead of sitting just idle why not to try to hack?? If u r confident enough about the problem u solved..and sometimes it helps too in a way that we are able to gain better approaches which other people follow so in other words enhance our learning

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

              It's true that you could learn from other people's solutions but in my opinion it's better to continue trying to come up with something for 4th problem since you can find some of those solutions explained in the comments section anyways. Also keep in mind there's always the 5th problem :).

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

                But during hacking u will always gives more attention towards solutions w.r.t to reading solutions from comment sections frankly speaking ;) Secondly 5th question always requires something out of the box + good knowledge of data structures with proper implementation skills which is not easy to crack during such a short time.In my opinion its better to first focus and build our strong concepts on little bit easier problems then we should try for big guns :)

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

                  thanks!! i too have similar question as i m a good hacker but due to this problem i sometimes not been able to hack... As i code in java so if anyone could provide hacking code for large test case in java too it will be helpful for me.. thanks in advance

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

                  The idea is the same in any language, just print out your testcase followed by a new line at the end.

                  Here's an example written in Java: https://ideone.com/lKbGdl