Submission #1043075
Source Code Expand
import sys N=list(map(int,(input().split()))) if N[0]==0: if N[1]>0: print(N[1]) sys.exit() print(abs(N[1])+1) sys.exit() if N[1]==0: if N[0]<0: print(abs(N[0])) sys.exit() print(abs(N[0])+1) sys.exit() if N[1]==N[0]* -1: print(1) sys.exit() if N[1]>N[0]: if (N[1]>0 and N[0]>0) or (N[1]<0 and N[0]<0): print(N[1]-N[0]) sys.exit() print(abs(N[1]-abs(N[0]))+1) if N[1]<N[0]: if (N[1]>0 and N[0]>0) or (N[1]<0 and N[0]<0): print(abs((N[0]-N[1]))+2) sys.exit() print(abs(N[0]-abs(N[1]))+1)
Submission Info
Submission Time | |
---|---|
Task | A - Simple Calculator |
User | bttb |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 626 Byte |
Status | AC |
Exec Time | 22 ms |
Memory | 3064 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 | 22 ms | 3064 KB |
0_01.txt | AC | 22 ms | 3064 KB |
0_02.txt | AC | 22 ms | 3064 KB |
1_00.txt | AC | 22 ms | 3064 KB |
1_01.txt | AC | 22 ms | 3064 KB |
1_02.txt | AC | 22 ms | 3064 KB |
1_03.txt | AC | 22 ms | 3064 KB |
1_04.txt | AC | 22 ms | 3064 KB |
1_05.txt | AC | 22 ms | 3064 KB |
1_06.txt | AC | 22 ms | 3064 KB |
1_07.txt | AC | 22 ms | 3064 KB |
1_08.txt | AC | 22 ms | 3064 KB |
1_09.txt | AC | 22 ms | 3064 KB |
1_10.txt | AC | 22 ms | 3064 KB |