Hey guys, do you know if there is any memory limit for the hacks' size. I am asking this because during contest #149 I tried to hack a solution which used an array of 10^4 elements while the problem's restrictions showed that there can be up to 10^5 numbers which have to be stored. So, of course I decided to hack the solution, but I was unhappy to see that my hack couldn't be processed and I should try again. I tried several times uploading the file or directly copying the data, but I would always get the same answer. My test was with 20001 rows. Later I saw that this solution had run-time error. I was upset to see that. Actually it doesn't matter so much because I joined this website to learn and practice, but I am just eager to know why this happened to me. I would be grateful if there is someone who can explain :) Thank you in advance guys :)
You can write test generator, a program which writes test data to stdout, and upload it.
I didn't try that, but do you have any idea if this will work. I mean are you aware why I had this answer by the system?
there is no memory control in C++. see at example below
let's suppose someone declares global array A[10000], and the is no other arrays declared immediately after this one. A[20001] can be situated in the memory interval assigned to array A, for example size of this interval have to be a multiple of size virtual memory page. you should use bigger index, for example 99 000.
Yes, I am aware of that, but the problem is why was my hack not processed by the system and before someone suggests...it was not because I didn't input the test data correctly. I was simply told by the system "Your hack cannot be processed. Please try again!" or something like that
acturally,the hack data you submitted is too large. it may be under 1M,i think. i have been faced with the same problem,but i don't remember the max size.
It's 256KB
Thank you very much guys. Now we have to solve the mystery why they put a memory limit on hack data that is less than the memory needed for the biggest test :D
To hack somebody with big test you must write a generator. it is probably done because servers can be easily overloaded if users would be able to upload large files.
Generator is a program that outputs your test in stdout.
For example:
I pasted this same code for a hack, and I got the following error. INVALID INPUT Validator 'val.exe' returns exit code 3 [FAIL Unexpected character #13, but ' ' expected (stdin)]
Can you please help?
That particular generator was just an example. For each problem you should write a generator which will match the problem input specification given in the problem statement.
The problem statement was such that this code was valid for the hack. Here is the link of the hack:http://mirror.codeforces.com/contest/574/hacks/164509/test Problem:http://mirror.codeforces.com/contest/574/problem/C
=========================== The code above outputs end of line before the last number.
Thanks!
Can you tell me about this one please?
http://mirror.codeforces.com/contest/574/hacks/164471/test
It will output ' ' in the end. It should be like this
Thank you so much!
Did you ask during the contest?
Hacking represents traffic: you need to transfer the test data from your machine to CF's servers at that specific point in time, and the limit on the size of this data has been set to prevent the contestants from overloading the servers. The limit on hack data size is the same for all tasks, it has nothing to do with the limits on test data size for specific tasks.