結果

問題 No.126 2基のエレベータ
ユーザー ゆるくゆるく
提出日時 2019-04-26 01:34:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 845 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 10,476 KB
最終ジャッジ日時 2023-08-14 03:57:09
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 31 ms
10,188 KB
testcase_02 AC 32 ms
10,268 KB
testcase_03 AC 32 ms
10,256 KB
testcase_04 AC 31 ms
10,228 KB
testcase_05 AC 31 ms
10,220 KB
testcase_06 AC 31 ms
10,352 KB
testcase_07 AC 31 ms
10,224 KB
testcase_08 AC 31 ms
10,136 KB
testcase_09 AC 30 ms
10,228 KB
testcase_10 AC 30 ms
10,224 KB
testcase_11 AC 31 ms
10,204 KB
testcase_12 AC 32 ms
10,188 KB
testcase_13 AC 31 ms
10,180 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 31 ms
10,308 KB
testcase_19 AC 31 ms
10,260 KB
testcase_20 WA -
testcase_21 AC 31 ms
10,432 KB
testcase_22 AC 31 ms
10,204 KB
testcase_23 AC 31 ms
10,224 KB
testcase_24 AC 32 ms
10,264 KB
testcase_25 AC 31 ms
10,260 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a, b, c = map(int, input().split())
count = 0
off = 0
if a == 0:
    a += 1
    b += 1
    c += 1
    off -= 1
if c == 1:
    count += a
else:
    aa = abs(a - c)
    bb = abs(b - c)
    if aa > bb:
        count += bb
        count += min(aa + c, c - 1 + a)
    else:
        count += aa + c + off
print(count)
0