結果

問題 No.2318 Phys Bone Maker
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2023-05-27 17:11:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 206,308 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-26 22:26:35
合計ジャッジ時間 13,804 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 21 ms
4,380 KB
testcase_04 AC 26 ms
4,376 KB
testcase_05 AC 8 ms
4,380 KB
testcase_06 AC 10 ms
4,380 KB
testcase_07 AC 8 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 18 ms
4,380 KB
testcase_10 AC 44 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 12 ms
4,376 KB
testcase_17 AC 37 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 17 ms
4,380 KB
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 15 ms
4,376 KB
testcase_23 AC 12 ms
4,376 KB
testcase_24 AC 32 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 46 ms
4,380 KB
testcase_27 WA -
testcase_28 AC 9 ms
4,376 KB
testcase_29 AC 6 ms
4,376 KB
testcase_30 AC 9 ms
4,376 KB
testcase_31 WA -
testcase_32 AC 19 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 AC 218 ms
4,380 KB
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 12 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
unordered_map<ll, ll> mp, mp_cn;
ll m = 998244353;
ll cnt_yk(ll a){
	if (mp_cn.find(a) != mp_cn.end()) {
		return mp_cn[a];
	}
	if (a == 1) {
		return mp_cn[a] = 1;
	}
	mp_cn[a] = 0;
	for (ll i = 1; i * i <= a; i ++) {
		if (a % i == 0) {
			mp_cn[a] ++;
			if (i * i < a) {
				mp_cn[a] ++;
			}
		}
	}
	return mp_cn[a];
}
ll calc(ll a) {
	if (mp.find(a) != mp.end()) {
		return mp[a];
	}
	mp[a] = 0;
	for (ll i = 1; i * i <= a; i ++) {
		if (a % i == 0) {
			mp[a] += (calc(i) * cnt_yk(i)) % m;
			if (i * i < a && i > 1) {
				mp[a] += (calc(a / i) * cnt_yk(a / i)) % m;
			}
			mp[a] %= m;
		}
	}
	return mp[a];
}
int main() {
	ll N;
	cin >> N;
	mp[1] = 1;
	cout << calc(N) << endl;
}
0