結果
問題 | No.2318 Phys Bone Maker |
ユーザー | cleantted |
提出日時 | 2023-02-26 03:43:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,839 ms / 3,000 ms |
コード長 | 1,922 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 96,000 KB |
最終ジャッジ日時 | 2024-09-18 15:15:57 |
合計ジャッジ時間 | 21,936 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 130 ms
91,776 KB |
testcase_01 | AC | 135 ms
91,776 KB |
testcase_02 | AC | 1,839 ms
96,000 KB |
testcase_03 | AC | 156 ms
92,288 KB |
testcase_04 | AC | 157 ms
91,648 KB |
testcase_05 | AC | 147 ms
91,904 KB |
testcase_06 | AC | 149 ms
91,904 KB |
testcase_07 | AC | 147 ms
92,416 KB |
testcase_08 | AC | 158 ms
92,424 KB |
testcase_09 | AC | 158 ms
91,776 KB |
testcase_10 | AC | 181 ms
91,900 KB |
testcase_11 | AC | 171 ms
92,416 KB |
testcase_12 | AC | 185 ms
92,288 KB |
testcase_13 | AC | 190 ms
92,288 KB |
testcase_14 | AC | 159 ms
92,032 KB |
testcase_15 | AC | 156 ms
91,648 KB |
testcase_16 | AC | 152 ms
91,896 KB |
testcase_17 | AC | 165 ms
92,416 KB |
testcase_18 | AC | 171 ms
92,416 KB |
testcase_19 | AC | 146 ms
91,648 KB |
testcase_20 | AC | 161 ms
91,904 KB |
testcase_21 | AC | 149 ms
91,904 KB |
testcase_22 | AC | 148 ms
92,216 KB |
testcase_23 | AC | 148 ms
91,904 KB |
testcase_24 | AC | 157 ms
92,160 KB |
testcase_25 | AC | 150 ms
91,648 KB |
testcase_26 | AC | 164 ms
92,380 KB |
testcase_27 | AC | 166 ms
91,904 KB |
testcase_28 | AC | 154 ms
91,904 KB |
testcase_29 | AC | 147 ms
91,904 KB |
testcase_30 | AC | 144 ms
91,904 KB |
testcase_31 | AC | 160 ms
91,648 KB |
testcase_32 | AC | 154 ms
91,904 KB |
testcase_33 | AC | 131 ms
91,904 KB |
testcase_34 | AC | 194 ms
92,416 KB |
testcase_35 | AC | 372 ms
92,544 KB |
testcase_36 | AC | 940 ms
93,824 KB |
testcase_37 | AC | 968 ms
93,440 KB |
testcase_38 | AC | 1,036 ms
93,824 KB |
testcase_39 | AC | 1,347 ms
94,848 KB |
testcase_40 | AC | 1,358 ms
94,620 KB |
testcase_41 | AC | 1,653 ms
95,488 KB |
testcase_42 | AC | 1,605 ms
95,232 KB |
testcase_43 | AC | 188 ms
92,436 KB |
testcase_44 | AC | 497 ms
93,312 KB |
testcase_45 | AC | 478 ms
92,928 KB |
testcase_46 | AC | 1,793 ms
96,000 KB |
testcase_47 | AC | 159 ms
91,904 KB |
ソースコード
import sys from collections import deque, Counter from math import gcd, log10, pi, sqrt, ceil from bisect import bisect, bisect_left, bisect_right, insort from typing import Iterable, TypeVar, Union, Tuple, Iterator, List import copy import heapq import itertools import math import random from fractions import Fraction from functools import lru_cache, partial, cmp_to_key import operator input = sys.stdin.readline sys.setrecursionlimit(10000000) mod = 998244353 INF = 1 << 61 DIFF = 10 ** -9 DX = [1, 0, -1, 0, 1, 1, -1, -1] DY = [0, 1, 0, -1, 1, -1, 1, -1] def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(read_values()) def read_lists(N): return [read_list() for _ in range(N)] def prime_factors(n): P = [] for m in range(2, int(n ** 0.5) + 1): if n % m: continue P.append(m) while n % m == 0: n //= m if n > 1: P.append(n) return P def divisor(n): D = [] for m in range(1, int(n ** 0.5) + 1): if n % m: continue D.append(m) if m * m != n: D.append(n // m) D.sort() return D def main(): N = int(input()) P = prime_factors(N) D = divisor(N) dp = {d: 0 for d in D} dp[1] = 1 for i, d1 in enumerate(D): for d2 in D[i+1:]: if d2 % d1: continue r = 1 x1, x2 = d1, d2 for p in P: k = 0 while x1 % p == 0 and x2 % p == 0: x1 //= p x2 //= p k += 1 if x2 % p == 0: continue r *= k + 1 r %= mod dp[d2] += dp[d1] * r % mod dp[d2] %= mod print(dp[N]) if __name__ == "__main__": main()