HQNP2 - HQNP Incomputable Hard


See problem HQNP for description.

Score : Score is number of test cases correctly solved.

Limits

Any HQ0-9+−INCOMPUTABLE?! program (output for each case) must be at most 20,000 commands long. The accumulator is unbounded (it can store an arbitrarily large integer). After each command, the buffer must be at most 20,000 characters long. To prevent code injection vulnerabilities, during the execution of your program( output for each case ) the buffer must never contain non-alphanumeric characters, i.e. characters other than A-Z, a-z, and 0-9. If it happens, your score for that particular test case will be 0.

Additionally for this challenge you must use the command '+' at least once for each test case.

Input

First line has integer T i.e. number of test cases. ( T <= 1000 ). Next T lines has a number n ( 0 <= n <= 10^1000 ).

Output

For each n, output the required HQ0-9+−INCOMPUTABLE?! program( having '+' at least once ) which will give n as output. If there are multiple solutions, output any one of them. Output of each test case must be in a single line. If you don't want to solve a test case, leave a blank line for it.

PS : Number of test cases in 11 test files are respectively -> 10, 10, 100, 1000, 80, 20, 40, 500, 100, 50, 200

Update (Dec/5/2012) : A small bug in judge which was causing internal error has been fixed. With refinement in test files, all solutions have been rejudged.


hide comments
XeRoN!X: 2012-12-06 06:27:15

@Robert and Béla, i have fixed the judge ( indeed the bug was in handling command 'a'). I have also updated the test cases. Sorry for the inconvenience.

I've fixed the judge for classical version also, fortunately no solution was affected. Also, it has different( easy ) test cases.

Last edit: 2012-12-05 19:14:47
Robert Gerbicz: 2012-12-06 06:27:15

OK, my guess is that the author's code is broken for the 'a' command. There should be no problem for ha+\n. (it is rarely solves the problem, I'm printing only '\n' for cases that I can't solve.)

Béla Mérvadó: 2012-12-06 06:27:15

Hi Robert,
Thanks.
(grats for ~800 solved)

I printf("ha+\n") for every case and i still get internal errors, not WA.

(tried to print solution for n=1 only and \n for every other line, still IE).

Last edit: 2012-12-01 19:05:40
Robert Gerbicz: 2012-12-06 06:27:15

RE: Béla, the judge has roughly 1 minute to check your solution. (this is not the time limit, this is fixed on every problem). You can clearly see that on this problem the output can be large, and checking the solution is harder than just reading it.

Though it could be other problem. You could try to solve only say every 10-th line from the input files, in other lines just print '\n' to see if it is the problem. (and in this case you get a small but positive score).

The judge works a lot also on my best code, but I haven't got an internal error.

You could try to solve only the test file with 100 cases. Just checked that my code solves it perfectly, maybe this is not a luck, and the input is the same what is in the easy version of this problem. (in this case you can get 100 points).

Last edit: 2012-12-01 15:46:16
Béla Mérvadó: 2012-12-06 06:27:15

hai

i'm getting internal errors. can you please check if it's mah codes fault?

Jeroen Bransen: 2012-12-06 06:27:15

There also seems to be a problem with the score calculation. When attempting to solve more testcases my score has gone down, while I am sure that I only replaced empty lines by non-empty lines. This should either give a runtime error or the score should be the same or go up.

Re( Author ) : I think my custom judge is ignoring TLE. It seems you are getting time limit exceeded on 4th test file. So score for that file is not getting added to your total score. I'll try to find a way out of it.

Last edit: 2012-03-24 18:52:13
Jeroen Bransen: 2012-12-06 06:27:15

Are you sure the input data is formatted correctly? I had some problems getting a trivial solution accepted (just reading input data).

Re( Author ): some newlines( in the beginning ) were there in two input files( earlier they were fine ). I've updated them, all submissions have been rejudged.

Last edit: 2012-02-13 16:47:54

Added by:XeRoN!X
Date:2011-12-27
Time limit:0.200s-2s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Variation of IPSC Problem