Task: | Kyselyt |
Sender: | yhyy |
Submission time: | 2017-10-06 21:45:42 +0300 |
Language: | Assembly |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | 1 | details |
#2 | WRONG ANSWER | 0.08 s | 2 | details |
#3 | WRONG ANSWER | 0.05 s | 3 | details |
Code
section .datasection .bsssyote resb 30000000 ; syötebuf resb 90090000 ; tulosteasd resb 1section .textglobal _start_start:mov eax, 3mov ebx, 0mov ecx, syotemov edx, 30000000int 0x80 ; lue syötemov rsi, syotemov rdi, bufcall readmov r15, rax ; n.lopeta:call flushmov rax, 1mov rbx, 0int 0x80;) ****************** flush ********************* (;; suoritetaan lopussa niin buf tulostuuflush: ;! huom sotkee lähes KAIKENmov rdx, rdisub rdx, bufmov rax, 4mov rbx, 1mov rcx, bufint 0x80ret;) ****************** read ********************* (;;! rsi nykyinen kohta syötteessä;) laittaa syötteestä yhden luvun rax <- x, rdx <- |x|, rbx <- sign(x);! 64-bit;( sotkee rbx, rdx ja rax)read:mov rbx, 1xor rdx, rdxxor rax, rax._: lodsbcmp al, 0x2dje ._1cmp al, 0x30jl ._2cmp al, 0x39jg ._2sub al, 0x30imul rdx, 10add rdx, raxcmp rdx, 0jne ._jmp ._3._1: mov rbx, -1._2: cmp rdx, 0je ._._3: mov rax, rdximul rax, rbxret;) ****************** print ********************* (;;! rdi tärkeä;( sotkee rax, rdx, rbx)print:cmp rax, 0jnl ._mov rdx, raxmov al, 0x2d ;-stosbmov rax, rdximul rax, -1._: mov rbx, 0xapush rdimov rdi, asdstd._1: xor rdx, rdxdiv rbxxchg rax, rdxadd al, 0x30stosbxchg rax, rdxcmp rax, 0jne ._1cldmov rdx, rsimov rsi, rdiinc rsipop rdi._2: lodsbstosbcmp rsi, asdjng ._2mov al, 0x20stosbmov rsi, rdxret
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
1000 582 214 723 273 ... |
correct output |
---|
0 1 7 7 6 ... |
user output |
---|
(empty) |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
1000 615664 916441 627600 279508 ... |
correct output |
---|
1 2 3 2 2 ... |
user output |
---|
(empty) |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000 672274832941907421 260504693279721732 646999966092970935 100853063389774434 ... |
correct output |
---|
7 2 2 0 9 ... |
user output |
---|
(empty) |