結果

問題 No.1281 Cigarette Distribution
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-18 14:25:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 77,744 KB
最終ジャッジ日時 2023-09-04 07:41:22
合計ジャッジ時間 5,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,372 KB
testcase_01 AC 75 ms
71,516 KB
testcase_02 AC 75 ms
71,444 KB
testcase_03 AC 75 ms
71,484 KB
testcase_04 AC 75 ms
71,388 KB
testcase_05 AC 75 ms
71,304 KB
testcase_06 AC 73 ms
71,480 KB
testcase_07 AC 72 ms
71,392 KB
testcase_08 AC 73 ms
71,348 KB
testcase_09 AC 75 ms
71,356 KB
testcase_10 AC 73 ms
71,260 KB
testcase_11 AC 75 ms
71,280 KB
testcase_12 AC 139 ms
77,388 KB
testcase_13 AC 185 ms
77,572 KB
testcase_14 AC 171 ms
77,304 KB
testcase_15 AC 143 ms
77,460 KB
testcase_16 AC 159 ms
77,536 KB
testcase_17 AC 79 ms
75,528 KB
testcase_18 AC 198 ms
77,744 KB
testcase_19 AC 203 ms
77,712 KB
testcase_20 AC 199 ms
77,528 KB
testcase_21 AC 189 ms
77,424 KB
testcase_22 AC 197 ms
77,664 KB
権限があれば一括ダウンロードができます

ソースコード

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