結果
| 問題 |
No.1281 Cigarette Distribution
|
| コンテスト | |
| ユーザー |
Haa
|
| 提出日時 | 2020-11-06 21:34:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 1,556 ms |
| コンパイル使用メモリ | 170,104 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-22 12:20:16 |
| 合計ジャッジ時間 | 4,724 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 19 |
ソースコード
#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*2-1)
cout << 0 << endl;
else
cout << power(n/i,i-n%i)*power(n/i+1,n%i)%MOD << endl;
}
return 0;
}
Haa