結果

問題 No.2787 グッドスタイン数列?
ユーザー 👑 testestest
提出日時 2023-08-25 16:34:23
言語 PyPy3
(7.3.15)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 680 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 612,760 KB
最終ジャッジ日時 2024-06-14 20:50:30
合計ジャッジ時間 6,252 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52 MLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

N,B,M=map(int,input().split())
if N==0:
  print("Yes")
  if M>=2:
    print("Yes")
    print(2)
  else:
    print("No")
  exit()

print("Yes")
if N>=2*B*B:
  print("No")
elif N>=B*B:
  a=N%B
  b=N//B%B
  #if b<5 and 2**b*(a+B+1)<60 and (2**(2**b*(a+B+1))*(2**b*(a+B+1))-B)*2<=M:  # AC
  #if 2**b*(a+B+1)<60 and (2**(2**b*(a+B+1))*(2**b*(a+B+1))-B)*2<=M:  # TLE
  if (2**(2**b*(a+B+1))*(2**b*(a+B+1))-B)*2<=M:  # TLE
    print("Yes")
    print((2**(2**b*(a+B+1))*(2**b*(a+B+1))-B)*2)
  else:
   print("No")
else:
  a=N%B
  b=N//B%B
  #if b<60 and (2**b*(a+B+1)-B)*2<=M:  # AC
  if (2**b*(a+B+1)-B)*2<=M:  #TLE
    print("Yes")
    print((2**b*(a+B+1)-B)*2)
  else:
    print("No")
0