結果
| 問題 |
No.1659 Product of Divisors
|
| コンテスト | |
| ユーザー |
たたき@競プロ
|
| 提出日時 | 2023-08-29 04:05:41 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 2,000 ms |
| コード長 | 779 bytes |
| コンパイル時間 | 7,420 ms |
| コンパイル使用メモリ | 309,376 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-12-30 20:56:45 |
| 合計ジャッジ時間 | 6,916 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint1000000007;
using ll=long long;
using pp=pair<int,int>;
#define sr string
#define vc vector
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int main(){
ll n,k;cin>>n>>k;
vc<ll>p(1e6+1,1);
vc<mint>comb(100,(mint)k);
for(int i=1;i<100;i++)comb[i+1]=comb[i]*(k+i)/(i+1);
mint ans=1;
for(ll i=2;i*i<=n;i++)if(p[i]){
for(ll j=i;j<=1e6;j+=i)p[j]=0;
int t=0;
while(n%i==0)n/=i,t++;
mint res=1;
for(int j=1;j<=t;j++)res+=comb[j];
ans*=res;
}
if(n>1)ans+=ans*k;
cout<<ans.val();
}
たたき@競プロ