Submission #1042263


Source Code Expand

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

Submission Info

Submission Time
Task A - Simple Calculator
User TAB
Language Python3 (3.4.3)
Score 300
Code Size 203 Byte
Status
Exec Time 23 ms
Memory 3192 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt
All 300 / 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 23 ms 3064 KB
1_00.txt 23 ms 3192 KB
1_01.txt 23 ms 3064 KB
1_02.txt 22 ms 3064 KB
1_03.txt 23 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 23 ms 3064 KB
1_10.txt 22 ms 3064 KB