結果

問題 No.2746 Bicolor Pyramid
ユーザー PNJ
提出日時 2024-04-20 13:20:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 61,568 KB
最終ジャッジ日時 2024-10-12 08:47:12
合計ジャッジ時間 4,868 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

R,B = map(int,input().split())
l = 1
r = 2000000
while r - l > 1:
  k = (l + r) // 2
  f = 1
  RR,BB = min(R,B),max(R,B)
  for kk in range(k,0,-1):
    if BB < kk*kk:
      f = 0
      break
    BB -= kk*kk
    if BB < RR:
      RR,BB = BB,RR
  if f:
    l = k
  else:
    r = k
print(l)
0