結果

問題 No.1659 Product of Divisors
ユーザー たたき@競プロたたき@競プロ
提出日時 2023-08-29 04:05:41
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 779 bytes
コンパイル時間 5,025 ms
コンパイル使用メモリ 308,336 KB
実行使用メモリ 10,984 KB
最終ジャッジ日時 2023-08-29 04:05:54
合計ジャッジ時間 6,365 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
10,688 KB
testcase_01 AC 13 ms
10,780 KB
testcase_02 AC 4 ms
10,692 KB
testcase_03 AC 5 ms
10,860 KB
testcase_04 AC 5 ms
10,784 KB
testcase_05 AC 8 ms
10,792 KB
testcase_06 AC 11 ms
10,740 KB
testcase_07 AC 13 ms
10,744 KB
testcase_08 AC 6 ms
10,896 KB
testcase_09 AC 7 ms
10,912 KB
testcase_10 AC 15 ms
10,748 KB
testcase_11 AC 7 ms
10,960 KB
testcase_12 AC 7 ms
10,744 KB
testcase_13 AC 5 ms
10,744 KB
testcase_14 AC 8 ms
10,896 KB
testcase_15 AC 12 ms
10,984 KB
testcase_16 AC 13 ms
10,800 KB
testcase_17 AC 10 ms
10,792 KB
testcase_18 AC 10 ms
10,736 KB
testcase_19 AC 11 ms
10,756 KB
testcase_20 AC 13 ms
10,740 KB
testcase_21 AC 14 ms
10,688 KB
testcase_22 AC 16 ms
10,784 KB
testcase_23 AC 12 ms
10,848 KB
testcase_24 AC 14 ms
10,692 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