結果

問題 No.149 碁石の移動
ユーザー WatsonWatson
提出日時 2017-07-27 16:00:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 10,844 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-08-25 17:53:30
合計ジャッジ時間 2,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
7,784 KB
testcase_01 AC 25 ms
7,764 KB
testcase_02 AC 14 ms
7,780 KB
testcase_03 AC 14 ms
7,840 KB
testcase_04 AC 15 ms
7,840 KB
testcase_05 AC 72 ms
7,856 KB
testcase_06 AC 77 ms
7,888 KB
testcase_07 AC 15 ms
7,788 KB
testcase_08 AC 15 ms
7,848 KB
testcase_09 AC 25 ms
7,864 KB
testcase_10 AC 56 ms
7,836 KB
testcase_11 AC 64 ms
7,848 KB
testcase_12 AC 40 ms
7,920 KB
testcase_13 AC 37 ms
7,960 KB
testcase_14 AC 38 ms
7,844 KB
testcase_15 AC 147 ms
7,780 KB
testcase_16 AC 231 ms
7,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C,D = [int(i) for i in input().split()]
while C > 0:
    if A[1] >= 1:
        A[1] -= 1
        B[1] += 1
    else:
        A[0] -= 1
        B[0] += 1
    C -= 1
while D > 0:
    if B[0] >= 1:
        A[0] += 1
        B[0] -= 1
    else:
        A[1] += 1
        B[1] -= 1
    D -= 1
print(A[0])
0