結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 28 ms
10,180 KB
testcase_02 AC 29 ms
10,252 KB
testcase_03 AC 29 ms
10,348 KB
testcase_04 AC 30 ms
10,460 KB
testcase_05 AC 30 ms
10,256 KB
testcase_06 WA -
testcase_07 AC 29 ms
10,300 KB
testcase_08 AC 29 ms
10,368 KB
testcase_09 AC 30 ms
10,292 KB
testcase_10 AC 31 ms
10,212 KB
testcase_11 AC 31 ms
10,252 KB
testcase_12 AC 30 ms
10,248 KB
testcase_13 AC 31 ms
10,248 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 30 ms
10,244 KB
testcase_19 AC 31 ms
10,248 KB
testcase_20 WA -
testcase_21 AC 30 ms
10,456 KB
testcase_22 AC 30 ms
10,296 KB
testcase_23 AC 30 ms
10,248 KB
testcase_24 AC 30 ms
10,316 KB
testcase_25 AC 32 ms
10,460 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
if a == 0:
    a += 1
    b += 1
    c += 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
print(count)
0