結果
| 問題 | No.1281 Cigarette Distribution |
| コンテスト | |
| ユーザー |
taiga000629
|
| 提出日時 | 2020-11-06 22:35:59 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 163 ms |
| コンパイル使用メモリ | 85,300 KB |
| 実行使用メモリ | 81,208 KB |
| 最終ジャッジ日時 | 2026-04-03 09:13:31 |
| 合計ジャッジ時間 | 2,513 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 20 |
ソースコード
n,m=map(int,input().split())
mod=10**9+7
for x in range(1,m+1):
if x==n:
print(0)
else:
if n%x==0:
print(pow(n//x,x,mod))
else:
hon=n//x
amari=n-x*hon
if hon>=0:
print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)
else:
if x-amari>1:
print(0)
else:
print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)
taiga000629