Task: | Maalarit |
Sender: | yhyy |
Submission time: | 2016-10-16 22:15:29 +0300 |
Language: | Assembly |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | 1 | details |
#2 | WRONG ANSWER | 0.06 s | 1 | details |
#3 | WRONG ANSWER | 0.06 s | 1 | details |
#4 | WRONG ANSWER | 0.05 s | 1 | details |
#5 | WRONG ANSWER | 0.06 s | 1 | details |
#6 | WRONG ANSWER | 0.05 s | 1 | details |
#7 | WRONG ANSWER | 0.06 s | 2 | details |
#8 | WRONG ANSWER | 0.06 s | 2 | details |
#9 | WRONG ANSWER | 0.06 s | 2 | details |
#10 | WRONG ANSWER | 0.05 s | 2 | details |
#11 | WRONG ANSWER | 0.06 s | 2 | details |
#12 | WRONG ANSWER | 0.05 s | 2 | details |
#13 | WRONG ANSWER | 0.05 s | 3 | details |
#14 | WRONG ANSWER | 0.06 s | 3 | details |
#15 | WRONG ANSWER | 0.05 s | 3 | details |
#16 | WRONG ANSWER | 0.05 s | 3 | details |
#17 | WRONG ANSWER | 0.07 s | 3 | details |
#18 | WRONG ANSWER | 0.05 s | 3 | details |
#19 | WRONG ANSWER | 0.06 s | 4 | details |
#20 | WRONG ANSWER | 0.06 s | 4 | details |
#21 | WRONG ANSWER | 0.06 s | 4 | details |
#22 | WRONG ANSWER | 0.07 s | 4 | details |
#23 | WRONG ANSWER | 0.07 s | 4 | details |
#24 | WRONG ANSWER | 0.06 s | 4 | details |
Code
section .bsssyote resb 3000000t resq 101010valit resd 101010p resd 101010h resd 101010aita resd 101010edel resd 101010seur resd 101010puu resd 0x40000vasen resq 101010oikea resq 101010tuloste resb 9000000section .textglobal _start_start:mov eax, 3mov ebx, 0mov ecx, syotemov edx, 3000000int 0x80mov rsi, syotecall lukumov r10, r9 ; nxor rdx, rdx ; ixor r14, r14 ; bxor r15, r15 ; a.lue:call lukuinc rdxmov [h+rdx*4], r9dmov ebx, [h+rdx*4-4]cmp rbx, r9cmovg rbx, r9 ; rbx = max(h[i], h[i-1])cmp r14, rbxcmovl r14, rbx ; b=max(b, rbx)cmp r15, r9cmovl r15, r9 ; a=max(a, h[i])cmp rdx, r10jl .luemov rcx, r10inc rcxxor rbx, rbxmov rdx, r10inc rdx.yhyy:mov rax, rcxdec raxcmp ebx, [h+eax*4]cmovg ebx, [h+eax*4]cmp r14d, [h+eax*4] ; rbx= min(rbx, h[i])jnl .kmov esi, edxsub esi, eaxmov [p+eax], esimov [valit+eax*4], ebxand esi, 1imul ebx, esiadd eax, 0x20000mov [puu+eax*4], ebx ; puu[k] = rbxcall updmov ebx, r15dmov rax, rcxdec raxmov [seur+eax*4], edxmov [edel+rdx*4], eaxmov rdx, raxmov r9d, [h+eax*4]sal r9, 32add r9, raxmov [t+eax*8], r9.k: dec rcxcmp rcx, 0jne .yhyymov r13d, [puu+4]mov esi, 1mov edi, r10dinc edicall mergesortmov rdx, 1.a:mov rax, [t+rdx*8]cmp rax, 0je ._amov ecx, eaxmov ebx, [valit+eax*4]mov edi, [p+eax*4]mov esi, 0add eax, 0x20000mov [puu+eax*4], esicall updmov eax, [edel+ecx*4]cmp [valit+eax*4], ebxjg .pyhmov [valit+eax*4], ebx.pyh:inc ediadd [p+eax*4], edimov edi, [p+eax*4]inc ediand edi, 1imul ebx, ediadd eax, 0x20000mov [puu+eax*4], ebxcall updmov eax, [puu+4]add eax, [h+ecx*4]mov ebx, r13dadd ebx, r14dcmp ebx, eaxcmovg r13d, [puu+4]cmovg r14d, [h+ecx*4]._a: inc rdxcmp rdx, r10jng .amov rdi, tulostemov rax, r15;call tulostaadd rax, r14;call tulostaadd rax, r13call tulostamov rax, 3call tulostacall aitageneraattori.lopeta:mov rdx, rdisub rdx, tulostemov rax, 4mov rbx, 1mov rcx, tulosteint 0x80mov rax, 1mov rbx, 0int 0x80luku:xor r9, r9.a:xor rax, raxlodsbcmp al, 0x30jl .mmcmp al, 0x39jg .mmsub al, 0x30imul r9, 10add r9, raxjmp .a.mm:cmp r9, 0je .aretupd:.a:sar eax, 1sal eax, 1mov r9d, [puu+eax*4]inc eaxcmp r9d, [puu+eax*4]cmovl r9d, [puu+eax*4]sar eax, 1mov [puu+eax*4], r9dcmp eax, 0jne .aretmergesort:push rbpmov rbp, rspsub rsp, 12cmp esi, edijnl .palaamov [rbp-4], esimov [rbp-8], edimov edx, esiadd edx, edisar edx, 1mov [rbp-12], edxmov edi, edxcall mergesortmov esi, [rbp-12]inc esimov edi, [rbp-8]call mergesortmov esi, [rbp-4]mov edi, [rbp-8]mov edx, [rbp-12]call merge.palaa:leaveretmerge:mov ecx, edxsub ecx, esiinc ecxxor r9, r9mov r11d, esi.a:mov rax, [t+r11d*8]mov [vasen+r9d*8], raxinc r9dinc r11dloop .amov rax, 0x7000000000000000mov [vasen+r9d*8], raxmov ecx, edisub ecx, edxxor r9, r9mov r11d, edxinc r11d.b:mov rax, [t+r11d*8]mov [oikea+r9d*8], raxinc r9dinc r11dloop .bmov rax, 0x7000000000000000mov [oikea+r9d*8], raxmov ecx, edisub ecx, esiinc ecxxor r9, r9xor r11, r11mov r12d, esi.c:mov rax, [vasen+r9d*8]cmp rax, [oikea+r11d*8]jg .elsemov [t+r12d*8], raxinc r12dinc r9djmp .f.else:mov rax, [oikea+r11d*8]mov [t+r12d*8], raxinc r12dinc r11d.f loop .c.palaa:rettulosta:mov r9, raxadd rdi, 18std.a:mov rax, r9mov r9, 0xaxor rdx, rdxidiv r9mov r9, raxmov rax, rdxadd al, 0x30stosbcmp r9, 0jne .acldadd rdi, 19mov al, 0x20stosbretaitageneraattori:mov rcx, r10.a1:xor eax, eaxmov ebx, 1cmp r14d, [h+ecx*4]cmovl eax, ebxmov [aita+ecx*4], eaxloop .a1xor rcx, rcx.a2:inc rcxxor eax, eaxcmp eax, [aita+rcx*4]jne ._a2cmp r13d, [h+rcx*4]jnl ._a2dec rcxmov eax, 1xor ebx, ebxcmp eax, [aita+ecx*4]mov eax, 2cmove ebx, eaxcmp eax, [aita+ecx*4]mov eax, 1cmove ebx, eaxinc ecxmov [aita+ecx*4], ebx._a2: cmp rcx, r10jl .a2mov rcx, r10.a3:xor eax, eaxcmp eax, [aita+rcx*4]jne ._a3cmp r13d, [h+rcx*4]jnl ._a3inc ecxinc eaxmov ebx, 1cmp eax, [aita+ecx*4]mov eax, 2cmove ebx, eaxdec ecxmov [aita+ecx*4], ebx._a3: loop .a3mov ecx, 0jmp ._a4.a4:inc ecxxor eax, eaxcmp eax, [aita+ecx*4]jne ._a4mov edx, ecxdec edxmov ebx, 1mov eax, 2cmp eax, [aita+edx*4]je ._add edx, 2cmp eax, [aita+edx*4]je ._mov ebx, 2._: mov eax, 1xor edx, edxdec ecxcmp eax, [aita+ecx*4]cmove ebx, edxadd ecx, 2cmp eax, [aita+ecx*4]cmove ebx, edxdec ecxmov [aita+ecx*4], ebx._a4: ;cmp rcx, r10;jl .a4mov rcx, 0.a5: inc rcxxor rax, raxmov eax, [aita+rcx*4]inc eaxcall tulostacmp rcx, r10jl .a5ret
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 22 54 3 91 69 90 40 29 83 71 |
correct output |
---|
174 3 2 1 2 1 2 1 2 1 2 1 |
user output |
---|
174... |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 49 3 96 38 90 18 92 74 83 1 |
correct output |
---|
170 3 1 2 1 2 1 2 1 2 1 2 |
user output |
---|
170... |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 46 3 41 30 16 17 12 93 80 81 |
correct output |
---|
173 3 2 1 2 1 2 1 2 1 2 1 |
user output |
---|
173... |
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 46 8 95 85 82 73 82 92 53 90 |
correct output |
---|
187 3 1 2 1 2 1 2 1 2 1 2 |
user output |
---|
240... |
Test 5
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 41 18 61 59 40 96 5 2 74 38 |
correct output |
---|
159 3 2 1 2 1 2 1 2 3 1 2 |
user output |
---|
159... |
Test 6
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 1 1 1 1 1 1 1 1 1 1 |
correct output |
---|
2 3 2 1 2 1 2 1 2 1 2 1 |
user output |
---|
2... |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 1 39 94 5 24 84 84 10 78 61 38... |
correct output |
---|
193 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
193... |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 31 73 18 88 49 28 66 5 32 48 9... |
correct output |
---|
199 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
203... |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 45 56 36 60 31 10 23 79 29 17 ... |
correct output |
---|
198 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
198... |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 1 77 70 62 21 68 40 54 90 62 1... |
correct output |
---|
194 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
194... |
Test 11
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 4 47 41 81 56 64 12 10 20 100 ... |
correct output |
---|
189 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
197... |
Test 12
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 1 1 1 1 1 1 1 1 1 1 |
correct output |
---|
2 3 2 1 2 1 2 1 2 1 2 1 |
user output |
---|
2... |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 256160448 813097800 167146270 ... |
correct output |
---|
1929869257 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
1913733137 ... |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 520002672 3542567 24668528 959... |
correct output |
---|
1946957555 3 1 2 3 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
1946957555 ... |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 483158423 780224665 844754665 ... |
correct output |
---|
1959373560 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
1959373560 ... |
Test 16
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 969647264 128558017 889036329 ... |
correct output |
---|
1997942264 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
2085681998 ... |
Test 17
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 745018527 400495893 635468795 ... |
correct output |
---|
1961391143 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
1958477594 ... |
Test 18
Group: 3
Verdict: WRONG ANSWER
input |
---|
10 1 1 1 1 1 1 1 1 1 1 |
correct output |
---|
2 3 2 1 2 1 2 1 2 1 2 1 |
user output |
---|
2... |
Test 19
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 197349274 775463806 263930657 ... |
correct output |
---|
1999942635 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
2029556808 ... |
Test 20
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 102296405 34648120 320393597 9... |
correct output |
---|
1999930943 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ... |
user output |
---|
2103748312 ... |
Test 21
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 781254921 418252056 502363453 ... |
correct output |
---|
1999987794 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
2050135703 ... |
Test 22
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 849784881 230439009 455097426 ... |
correct output |
---|
1999979439 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
2001040101 ... |
Test 23
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 851456132 13422224 537539701 4... |
correct output |
---|
1999948226 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ... |
user output |
---|
2127640222 ... |
Test 24
Group: 4
Verdict: WRONG ANSWER
input |
---|
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
2 3 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 ... |
user output |
---|
2... |