結果

問題 No.149 碁石の移動
ユーザー nbisconbisco
提出日時 2016-03-25 00:29:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 7,892 KB
最終ジャッジ日時 2023-08-25 17:43:21
合計ジャッジ時間 1,125 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,684 KB
testcase_01 AC 12 ms
7,808 KB
testcase_02 AC 12 ms
7,784 KB
testcase_03 AC 13 ms
7,784 KB
testcase_04 AC 13 ms
7,884 KB
testcase_05 AC 13 ms
7,756 KB
testcase_06 AC 13 ms
7,744 KB
testcase_07 AC 14 ms
7,756 KB
testcase_08 AC 14 ms
7,752 KB
testcase_09 AC 14 ms
7,788 KB
testcase_10 AC 14 ms
7,788 KB
testcase_11 AC 13 ms
7,856 KB
testcase_12 AC 13 ms
7,856 KB
testcase_13 AC 13 ms
7,824 KB
testcase_14 AC 13 ms
7,892 KB
testcase_15 AC 13 ms
7,852 KB
testcase_16 AC 13 ms
7,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#fileencoding: utf-8

Aw, Ab = [int(i) for i in input().strip().split(" ")]
Bw, Bb = [int(i) for i in input().strip().split(" ")]
C, D = [int(i) for i in input().strip().split(" ")]

if C <= Ab:
    if D <= Bw:
        print(Aw+D)
    else:
        print(Aw+Bw)
elif C > Ab:
    Bw += (C-Ab)
    Aw = Aw - (C-Ab)
    if D <= Bw:
        print(Aw+D)
    else:
        print(Aw+Bw)
0