結果

問題 No.126 2基のエレベータ
ユーザー ゆるくゆるく
提出日時 2019-04-26 02:05:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-05-01 18:14:56
合計ジャッジ時間 2,229 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
11,776 KB
testcase_01 WA -
testcase_02 AC 34 ms
11,776 KB
testcase_03 AC 35 ms
11,776 KB
testcase_04 AC 33 ms
11,776 KB
testcase_05 AC 34 ms
11,776 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 34 ms
11,776 KB
testcase_09 AC 34 ms
11,776 KB
testcase_10 AC 34 ms
11,776 KB
testcase_11 AC 34 ms
11,776 KB
testcase_12 AC 35 ms
11,776 KB
testcase_13 AC 33 ms
11,776 KB
testcase_14 AC 34 ms
11,776 KB
testcase_15 AC 33 ms
11,776 KB
testcase_16 AC 33 ms
11,776 KB
testcase_17 AC 32 ms
11,904 KB
testcase_18 AC 31 ms
11,776 KB
testcase_19 AC 32 ms
11,776 KB
testcase_20 AC 31 ms
11,904 KB
testcase_21 AC 32 ms
11,776 KB
testcase_22 AC 33 ms
11,776 KB
testcase_23 AC 31 ms
11,776 KB
testcase_24 AC 33 ms
11,776 KB
testcase_25 AC 32 ms
11,776 KB
testcase_26 AC 32 ms
11,776 KB
testcase_27 AC 32 ms
11,776 KB
testcase_28 AC 32 ms
11,776 KB
testcase_29 AC 33 ms
11,776 KB
権限があれば一括ダウンロードができます

ソースコード

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 + off:
    count += a + off
else:
    aa = abs(a - c) + off
    bb = abs(b - c) + off
    if aa > bb:
        count += bb
        count += min(a + c - 1 + off, aa + a + off)
    else:
        count += aa + c + off
print(count)
0