結果

問題 No.1281 Cigarette Distribution
ユーザー persimmon-persimmon
提出日時 2021-06-18 14:25:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 709 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2024-06-22 06:55:12
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
mod=10**9+7
"""
2*x-1回目ではじめて正の得点を得れる

"""
#print(n)
for x in range(1,m+1):
  if 2*x-1>n:
    print(0)
    continue
  tmp=1
  t=n//x
  p=n%x
  if p==x-1:
    tmp*=pow(t,x-p,mod)
    tmp*=pow(t+1,p,mod)
  else:
    tmp*=pow(t-1,1,mod)
    tmp*=pow(t,x-p-2,mod)
    tmp*=pow(t+1,p+1,mod)
  print(tmp%mod)
0