Submission #1099508


Source Code Expand

Copy
from math import fabs
x, y = map(int, input().split())
if x*y > 0:
	if y >= x:
		print(y-x)
	else:
		print(x-y+2)
elif x*y == 0:
	if x <= y:
		print(y-x)
	else:
		print(int(fabs(fabs(x)-fabs(y))+1))

Submission Info

Submission Time
Task A - Simple Calculator
User TAB
Language Python3 (3.4.3)
Score 0
Code Size 211 Byte
Status
Exec Time 22 ms
Memory 3064 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt
All 0 / 300 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt
Case Name Status Exec Time Memory
0_00.txt 22 ms 3064 KB
0_01.txt 22 ms 3064 KB
0_02.txt 22 ms 3064 KB
1_00.txt 22 ms 3064 KB
1_01.txt 22 ms 3064 KB
1_02.txt 22 ms 3064 KB
1_03.txt 22 ms 3064 KB
1_04.txt 22 ms 3064 KB
1_05.txt 22 ms 3064 KB
1_06.txt 22 ms 3064 KB
1_07.txt 22 ms 3064 KB
1_08.txt 22 ms 3064 KB
1_09.txt 22 ms 3064 KB
1_10.txt 22 ms 3064 KB