|Online Judge||Problem Set||Authors||Online Contests||User|
Brian Huck has invented a new powersaving computer. With the current CMOSbased processors, a certain amount of power
is lost each time a bit is changed from 0 to 1 or back. To avoid this problem, Brian's new Nullary Core stores only zeros. All numbers are stored in nullary form, as shown on the right.
His initial 64-nit model has 26 registers, each of which may store up to 64 nits, and any attempt to store more than 64 nits will result in a run time error. There is also a flag register, which contains either a zero, or nothing. The instruction set is as follows:
Apart from instructions, no other characters than whitespace are allowed in a nullary program.
Brian has provided some programs to illustrate the elegance and simplicity of his computer.
Your task will be to write a sorting program for Brian's Nullary Corebased Prototype Computer. The NCPC has limited memory, so your program must be no longer than 5432 instructions. Also, the running time of your program must be no more than 5 * 106 steps for any possible input, where a step is considered to be the execution of one instruction.
Important note: You must submit some Java, C or C++ source code that generate the nullary source code of this program.
Input to your nullary program
The numbers to be sorted will be given in the first 24 registers A-X; the remaining two registers (Y and Z) will be empty.
Output to your nullary program
The sorted numbers should be in registers A through X, in increasing order. Register Y and Z should be empty.
Sample Input to your nullary program
Sample Output to your nullary program
Output some Java, C, C++ or Pascal source code that generate the nullary source code of this program.
Refer to Output.
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator