結果

問題 No.149 碁石の移動
ユーザー WatsonWatson
提出日時 2017-07-27 16:00:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-24 03:26:42
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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