結果
問題 | No.126 2基のエレベータ |
ユーザー |
![]() |
提出日時 | 2016-05-24 19:21:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 699 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-10 18:30:04 |
合計ジャッジ時間 | 2,069 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
a, b, s = map(int,input().split())if s == 1:print(abs(a-1)+1)exit()if s == a and s == b:print(a)elif s == a and s != b:print(a)elif (s != a and s == b) and a != 0:if abs(s-a) > abs(s-1):print(abs(b-1) + a)else:print(abs(b-a) + a)elif (s != a and s == b) and a == 0:print((b - 1) + 2)else:if abs(s-a) == abs(s-b):print(abs(s-a)+ s)elif abs(s-a) < abs(s-b):print(abs(s-a) + s)else:if a !=0:if abs(s-a) > abs(s-1):print(abs(s-b) + abs(s-1) + a)else:print(abs(s-b) + abs(s-a) + a)else:print(abs(s-b) + (s-1) + 2)