結果

問題 No.847 Divisors of Power
ユーザー kenta255kenta255
提出日時 2019-07-25 23:04:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,305 bytes
コンパイル時間 2,524 ms
コンパイル使用メモリ 201,596 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-16 10:06:25
合計ジャッジ時間 11,444 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,704 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 208 ms
5,376 KB
testcase_05 AC 1,657 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 462 ms
5,376 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 784 ms
5,376 KB
testcase_14 TLE -
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>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define out(a) cout<<fixed<<setprecision((a))

ll K,N,M;
set<ll> ans;
vector<ll> dev;
vector<ll> enum_div(ll n){//yakusu
	vector<ll> ret;
	for(ll i=1 ; i*i<=n ; ++i){
			if(n%i == 0){
				ret.push_back(i);
				if(i!=(n/i))ret.push_back(n/i);
			}
	}
	return ret;
}

void dfs(ll m,ll d){
	ans.insert(m);
	if(d==K)return;
	for(auto x:dev){
		if(x==1)continue;
		if(m*x<=M)dfs(m*x,d+1);
	}
	return;
}


int main(){
	cin >> N >> K >> M;
	dev = enum_div(N);
	dfs(1,0);
	cout << ans.size() << endl;
}
0