結果
| 問題 | No.847 Divisors of Power |
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-11 22:50:58 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 635 bytes |
| 記録 | |
| コンパイル時間 | 2,849 ms |
| コンパイル使用メモリ | 199,072 KB |
| 最終ジャッジ日時 | 2025-01-09 06:21:25 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 TLE * 4 |
ソースコード
#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
int n,k,m;std::cin>>n>>k>>m;
auto mul=[m](const std::set<int>&a,const std::set<int>&b){
std::set<int>c;
for(int x:a)for(int y:b){
if(x<=m/y)c.insert(x*y);
}
return c;
};
std::set<int>a;
for(int i=1;i*i<=n;i++){
if(n%i!=0)continue;
a.insert(i);
a.insert(n/i);
}
std::set<int>b={1};
for(;k;k>>=1){
if(k&1)b=mul(b,a);
a=mul(a,a);
}
std::cout<<b.size()<<'\n';
}
ngtkana