結果
問題 |
No.1281 Cigarette Distribution
|
ユーザー |
![]() |
提出日時 | 2020-11-06 21:31:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 573 bytes |
コンパイル時間 | 2,005 ms |
コンパイル使用メモリ | 168,732 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 12:17:39 |
合計ジャッジ時間 | 5,465 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; #define REP(i,n) for(int i=0;i<n;i++) #define ALL(v) v.begin(),v.end() const ll MOD=1000000007; const ll INF=1e18; ll power(ll x, ll y){ x%=MOD; if(y==0) return 1; else if(y%2) return x*power(x*x%MOD,y/2)%MOD; else return power(x*x%MOD,y/2); } int main(){ int n, m; cin >> n >> m; for(int i=1;i<=m;i++){ if(n<=i) cout << 0 << endl; else cout << power(n/i,i-n%i)*power(n/i+1,n%i)%MOD << endl; } return 0; }