結果

問題 No.2746 Bicolor Pyramid
ユーザー だれだれ
提出日時 2024-04-20 12:16:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 63,744 KB
最終ジャッジ日時 2024-04-20 12:16:53
合計ジャッジ時間 6,069 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
58,368 KB
testcase_01 AC 56 ms
58,496 KB
testcase_02 AC 48 ms
58,112 KB
testcase_03 AC 48 ms
58,240 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 181 ms
63,104 KB
testcase_10 AC 212 ms
63,744 KB
testcase_11 AC 159 ms
62,464 KB
testcase_12 AC 205 ms
62,340 KB
testcase_13 AC 219 ms
62,848 KB
testcase_14 AC 47 ms
58,304 KB
testcase_15 AC 200 ms
59,520 KB
testcase_16 AC 78 ms
61,312 KB
testcase_17 AC 106 ms
60,160 KB
testcase_18 AC 111 ms
60,800 KB
testcase_19 AC 80 ms
61,312 KB
testcase_20 AC 85 ms
61,312 KB
testcase_21 AC 95 ms
61,312 KB
testcase_22 AC 98 ms
60,416 KB
testcase_23 AC 98 ms
60,672 KB
testcase_24 AC 110 ms
60,160 KB
testcase_25 AC 76 ms
61,840 KB
testcase_26 AC 78 ms
61,184 KB
testcase_27 WA -
testcase_28 AC 134 ms
60,544 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 112 ms
60,544 KB
testcase_32 AC 93 ms
61,184 KB
testcase_33 WA -
testcase_34 AC 150 ms
60,416 KB
testcase_35 AC 140 ms
60,928 KB
testcase_36 AC 150 ms
60,288 KB
testcase_37 AC 159 ms
60,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

r, b = map(int, input().split())
hi = 1817121
lw = 0
while hi - lw > 1:
    mid = (hi + lw) // 2
    rr, bb = r, b
    for i in range(mid, 0, -1):
        if rr < bb:
            rr, bb = bb, rr
        if i * i <= rr:
            rr -= i * i
        else:
            bb -= i * i
    if min(rr, bb) >= 0:
        lw = mid
    else:
        hi = mid
print(lw)
0