Submission #1099488


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(int(fabs(x-y))+2)
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 178 Byte
Status
Exec Time 23 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 23 ms 3064 KB
0_01.txt 23 ms 3064 KB
0_02.txt 23 ms 3064 KB
1_00.txt 23 ms 3064 KB
1_01.txt 23 ms 3064 KB
1_02.txt 23 ms 3064 KB
1_03.txt 23 ms 3064 KB
1_04.txt 23 ms 3064 KB
1_05.txt 23 ms 3064 KB
1_06.txt 23 ms 3064 KB
1_07.txt 23 ms 3064 KB
1_08.txt 23 ms 3064 KB
1_09.txt 23 ms 3064 KB
1_10.txt 23 ms 3064 KB