結果

問題 No.2318 Phys Bone Maker
ユーザー ttkkggwwttkkggww
提出日時 2023-05-26 22:22:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 993 bytes
コンパイル時間 4,798 ms
コンパイル使用メモリ 278,216 KB
実行使用メモリ 22,908 KB
最終ジャッジ日時 2023-08-26 12:15:24
合計ジャッジ時間 14,298 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 18 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 11 ms
4,376 KB
testcase_30 AC 12 ms
4,376 KB
testcase_31 WA -
testcase_32 AC 23 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 23 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
ll x;
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
using mit = modint998244353;


unordered_map<ll,ll> mp;
unordered_map<ll,mit> dp;
unordered_map<ll,vector<ll>> divisor_mp;

void solve(){
	auto v = divisor(x);
	for(auto &i:v){
		divisor_mp[i] = divisor(i);
	}
	dp[1] = 1;
	for(auto &i:v){
		auto &v2 = divisor_mp[x/i];
		for(auto &j:v2){
			if(j==1)continue;
			dp[i*j] += dp[i]*(divisor_mp[j/gcd(i,j)].size()-1);
		}
		/*
		for(auto &j:v){
			cout<<i<<':'<<j<<':'<<dp[j].val()<<endl;;
		}
		*/
	}
	cout<<dp[x].val()<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> x;
	solve();
}
0