結果

問題 No.1659 Product of Divisors
ユーザー たたき@競プロたたき@競プロ
提出日時 2023-08-29 04:05:41
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 779 bytes
コンパイル時間 4,702 ms
コンパイル使用メモリ 310,944 KB
実行使用メモリ 11,184 KB
最終ジャッジ日時 2024-06-09 20:19:51
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
11,136 KB
testcase_01 AC 11 ms
11,128 KB
testcase_02 AC 4 ms
11,032 KB
testcase_03 AC 4 ms
11,132 KB
testcase_04 AC 4 ms
11,124 KB
testcase_05 AC 8 ms
11,104 KB
testcase_06 AC 8 ms
11,008 KB
testcase_07 AC 11 ms
11,008 KB
testcase_08 AC 5 ms
11,136 KB
testcase_09 AC 4 ms
10,972 KB
testcase_10 AC 11 ms
11,136 KB
testcase_11 AC 5 ms
11,136 KB
testcase_12 AC 5 ms
11,036 KB
testcase_13 AC 4 ms
11,152 KB
testcase_14 AC 6 ms
11,116 KB
testcase_15 AC 9 ms
11,184 KB
testcase_16 AC 10 ms
11,008 KB
testcase_17 AC 8 ms
10,972 KB
testcase_18 AC 9 ms
11,128 KB
testcase_19 AC 9 ms
11,040 KB
testcase_20 AC 11 ms
11,136 KB
testcase_21 AC 11 ms
11,092 KB
testcase_22 AC 13 ms
11,008 KB
testcase_23 AC 9 ms
11,116 KB
testcase_24 AC 11 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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();
}
    
0