結果
問題 | No.2318 Phys Bone Maker |
ユーザー | cleantted |
提出日時 | 2023-02-26 03:08:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 2,731 ms / 3,000 ms |
コード長 | 1,974 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 82,604 KB |
実行使用メモリ | 94,868 KB |
最終ジャッジ日時 | 2024-09-18 12:58:39 |
合計ジャッジ時間 | 27,946 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 161 ms
91,948 KB |
testcase_01 | AC | 158 ms
91,968 KB |
testcase_02 | AC | 2,403 ms
94,396 KB |
testcase_03 | AC | 165 ms
92,176 KB |
testcase_04 | AC | 165 ms
92,028 KB |
testcase_05 | AC | 166 ms
91,944 KB |
testcase_06 | AC | 165 ms
91,900 KB |
testcase_07 | AC | 166 ms
93,092 KB |
testcase_08 | AC | 173 ms
92,844 KB |
testcase_09 | AC | 161 ms
92,096 KB |
testcase_10 | AC | 173 ms
92,072 KB |
testcase_11 | AC | 171 ms
92,108 KB |
testcase_12 | AC | 181 ms
92,564 KB |
testcase_13 | AC | 182 ms
92,732 KB |
testcase_14 | AC | 168 ms
92,068 KB |
testcase_15 | AC | 166 ms
91,708 KB |
testcase_16 | AC | 163 ms
92,132 KB |
testcase_17 | AC | 170 ms
92,064 KB |
testcase_18 | AC | 176 ms
92,484 KB |
testcase_19 | AC | 161 ms
92,128 KB |
testcase_20 | AC | 165 ms
92,040 KB |
testcase_21 | AC | 163 ms
92,172 KB |
testcase_22 | AC | 170 ms
92,716 KB |
testcase_23 | AC | 164 ms
91,956 KB |
testcase_24 | AC | 171 ms
92,124 KB |
testcase_25 | AC | 164 ms
91,884 KB |
testcase_26 | AC | 177 ms
92,480 KB |
testcase_27 | AC | 172 ms
92,140 KB |
testcase_28 | AC | 164 ms
91,976 KB |
testcase_29 | AC | 161 ms
91,912 KB |
testcase_30 | AC | 162 ms
92,072 KB |
testcase_31 | AC | 173 ms
92,500 KB |
testcase_32 | AC | 166 ms
92,168 KB |
testcase_33 | AC | 156 ms
91,924 KB |
testcase_34 | AC | 168 ms
91,644 KB |
testcase_35 | AC | 436 ms
93,392 KB |
testcase_36 | AC | 1,752 ms
94,116 KB |
testcase_37 | AC | 1,343 ms
94,052 KB |
testcase_38 | AC | 1,526 ms
93,944 KB |
testcase_39 | AC | 2,456 ms
94,296 KB |
testcase_40 | AC | 1,977 ms
94,504 KB |
testcase_41 | AC | 2,731 ms
94,868 KB |
testcase_42 | AC | 2,229 ms
94,512 KB |
testcase_43 | AC | 187 ms
92,544 KB |
testcase_44 | AC | 347 ms
93,212 KB |
testcase_45 | AC | 338 ms
93,028 KB |
testcase_46 | AC | 2,528 ms
94,680 KB |
testcase_47 | AC | 171 ms
91,956 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 main(): N = int(input()) T = {} for n in range(2, int(N ** 0.5) + 1): while N % n == 0: T[n] = T.get(n, 0) + 1 N //= n if N > 1: T[N] = T.get(N, 0) + 1 T = list(T.items()) K = len(T) X = {} V = set() def f(s, S): if len(S) == K: V.add(s) X[s] = (tuple(S)) return k, v = T[len(S)] S.append(0) for _ in range(v + 1): f(s, S) s *= k S[-1] += 1 S.pop() s //= k ** v f(1, []) N = len(V) V = sorted(list(V)) X = [X[v] for v in V] dp = [0] * N dp[0] = 1 for i in range(N): for j in range(i + 1, N): r = 1 for k in range(K): x1, x2 = X[i][k], X[j][k] if x2 > x1: continue elif x2 == x1: r *= x1 + 1 r %= mod else: break else: dp[j] += dp[i] * r % mod dp[j] %= mod print(dp[-1]) if __name__ == "__main__": main()