Task: | Järjestys |
Sender: | yhyy |
Submission time: | 2016-10-16 16:29:10 +0300 |
Language: | Assembly |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 19 |
#2 | ACCEPTED | 37 |
#3 | ACCEPTED | 44 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.05 s | 2 | details |
#3 | ACCEPTED | 0.09 s | 3 | details |
Code
section .bsssyote resb 3000000t resq 101010tuloste resb 80000000section .textglobal _start_start:mov eax, 3mov ebx, 0mov ecx, syotemov edx, 3000000int 0x80mov rsi, syotemov rdi, tulostecall lukumov r15, r9mov rax, r9imul rax, 5call tulostamov rcx, r15mov r10, r15xor rdx, rdxmov r11, r15xor r15, r15.a:call lukuinc rdxmov [t+rdx*4], r9mov rax, r11dec raxcmp r9, rdxcmove r11, raxloop .amov rcx, r11mov r12, 1.a2:mov eax, [t+4]cmp eax, r12djne .bmov eax, [t+r12*4]mov ebx, [t+4]mov [t+4], eaxmov [t+r12*4], ebxmov rax, r12call tulostainc r15.c: inc r12cmp r12d, [t+r12*4]je .ccmp r12, r10jg .lopetamov eax, [t+r12*4]mov ebx, [t+4]mov [t+4], eaxmov [t+r12*4], ebxmov rax, r12call tulostainc r15.b:xor rax, raxmov eax, [t+4]call vaihdamov edx, [t+eax*4]mov ebx, [t+4]mov [t+4], edxmov [t+eax*4], ebxdec rcxcmp rcx, 0jg .a2.lopeta:mov rax, r10imul rax, 5sub rax, r15mov rcx, raxmov rax, 1.i: call tulostaloop .imov rdx, rdisub rdx, tulostemov rax, 4mov rbx, 1mov rcx, tulosteint 0x80mov rax, 1mov rbx, 0int 0x80vaihda:cmp rax, 2jne .ainc r15call tulostajmp .palaa.a:add r15, 4dec raxcall tulostadec raxcall tulostainc raxcall tulostainc raxcall tulosta.palaa: retluku:xor r9, r9.a:xor rax, raxlodsbcmp al, 0x30jl .mmcmp al, 0x39jg .mmsub al, 0x30imul r9, 10add r9, raxjmp .a.mm:cmp r9, 0je .arettulosta:mov r9, raxmov r14, rcxmov rbx, raxmov rax, 1mov rcx, 0xa.hh:cqoimul rcxcmp rax, rbxjle .hhxor rdx, rdxcqoidiv rcxmov r13, raxmov rcx, r13mov rax, rbxjmp .hui.hh2:mov rax, rbxmov rcx, r13xor rdx, rdxcqoidiv rcxmov rbx, rdxadd rax, 0x30stosbmov rax, r13mov rcx, 10xor rdx, rdxcqoidiv rcxmov r13, rax.hui:cmp r13, 0jg .hh2mov eax, 0x20stosbmov rax, r9mov rcx, r14ret
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
10 9 3 4 7 6 5 10 2 8 1 |
correct output |
---|
32 10 10 9 10 9 8 7 9 4 2 1 4 5 2... |
user output |
---|
50 8 7 8 9 7 6 7 8 2 2 1 2 3 3... |
Test 2
Group: 2
Verdict: ACCEPTED
input |
---|
1000 650 716 982 41 133 1000 876 92... |
correct output |
---|
3984 207 207 206 207 128 127 126 12... |
user output |
---|
5000 649 648 649 650 327 326 3... |
Test 3
Group: 3
Verdict: ACCEPTED
input |
---|
100000 94703 47808 62366 31885 7091 8... |
correct output |
---|
399956 98676 98676 98675 98676 62994 ... |
user output |
---|
500000 94702 94701 94702 94703... |