結果

問題 No.847 Divisors of Power
ユーザー ngtkanangtkana
提出日時 2020-03-11 22:50:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 635 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 209,272 KB
実行使用メモリ 18,464 KB
最終ジャッジ日時 2024-04-27 21:30:56
合計ジャッジ時間 6,112 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 18 ms
6,940 KB
testcase_05 AC 6 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 7 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 7 ms
6,940 KB
testcase_14 AC 5 ms
6,940 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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