結果
| 問題 |
No.2746 Bicolor Pyramid
|
| コンテスト | |
| ユーザー |
PNJ
|
| 提出日時 | 2024-04-20 12:55:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 258 bytes |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 61,056 KB |
| 最終ジャッジ日時 | 2024-10-12 08:19:07 |
| 合計ジャッジ時間 | 4,874 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 WA * 6 |
ソースコード
R,B = map(int,input().split())
l = 1
r = 2000000
while r - l > 1:
k = (l + r) // 2
s = k*(k+1)*(2*k+1) // 6
RR,BB = R,B
for kk in range(k,0,-1):
if RR >= kk*kk:
RR -= kk*kk
s -= kk*kk
if s <= BB:
l = k
else:
r = k
print(l)
PNJ