結果

問題 No.2746 Bicolor Pyramid
ユーザー PNJPNJ
提出日時 2024-04-20 12:55:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 258 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 62,916 KB
最終ジャッジ日時 2024-04-20 12:55:15
合計ジャッジ時間 5,284 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
58,524 KB
testcase_01 AC 50 ms
58,552 KB
testcase_02 AC 47 ms
58,068 KB
testcase_03 AC 48 ms
58,640 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 52 ms
58,388 KB
testcase_08 AC 48 ms
58,988 KB
testcase_09 AC 173 ms
61,264 KB
testcase_10 AC 188 ms
60,780 KB
testcase_11 AC 144 ms
60,780 KB
testcase_12 AC 193 ms
61,900 KB
testcase_13 AC 180 ms
62,080 KB
testcase_14 AC 48 ms
58,180 KB
testcase_15 AC 200 ms
62,508 KB
testcase_16 AC 88 ms
62,532 KB
testcase_17 AC 117 ms
61,432 KB
testcase_18 AC 86 ms
60,004 KB
testcase_19 AC 67 ms
60,304 KB
testcase_20 AC 68 ms
59,692 KB
testcase_21 AC 69 ms
60,000 KB
testcase_22 AC 79 ms
59,296 KB
testcase_23 AC 110 ms
61,008 KB
testcase_24 AC 116 ms
60,928 KB
testcase_25 AC 62 ms
58,832 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 148 ms
61,368 KB
testcase_29 AC 67 ms
58,504 KB
testcase_30 WA -
testcase_31 AC 128 ms
61,360 KB
testcase_32 AC 109 ms
62,916 KB
testcase_33 AC 63 ms
59,512 KB
testcase_34 AC 117 ms
60,040 KB
testcase_35 AC 157 ms
62,112 KB
testcase_36 AC 184 ms
61,084 KB
testcase_37 AC 103 ms
60,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0