Submission #1607003
Source Code Expand
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right INF = float("inf") def a(x, y): if x <= y: return y - x return INF def main(): x, y = map(int, input().split()) ans = INF ans = min(ans, a(x, y)) ans = min(ans, 1 + a(-x, y)) ans = min(ans, 1 + a(x, -y)) ans = min(ans, 2 + a(-x, -y)) print(ans) if __name__ == '__main__': main()
Submission Info
Submission Time | |
---|---|
Task | A - Simple Calculator |
User | MitI_7 |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 593 Byte |
Status | AC |
Exec Time | 26 ms |
Memory | 3444 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 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 | AC | 26 ms | 3444 KB |
0_01.txt | AC | 21 ms | 3316 KB |
0_02.txt | AC | 21 ms | 3316 KB |
1_00.txt | AC | 21 ms | 3316 KB |
1_01.txt | AC | 21 ms | 3316 KB |
1_02.txt | AC | 21 ms | 3316 KB |
1_03.txt | AC | 21 ms | 3316 KB |
1_04.txt | AC | 21 ms | 3316 KB |
1_05.txt | AC | 21 ms | 3316 KB |
1_06.txt | AC | 21 ms | 3316 KB |
1_07.txt | AC | 21 ms | 3316 KB |
1_08.txt | AC | 21 ms | 3316 KB |
1_09.txt | AC | 21 ms | 3316 KB |
1_10.txt | AC | 21 ms | 3316 KB |