結果
問題 | No.1532 Different Products |
ユーザー | mkawa2 |
提出日時 | 2023-10-04 15:44:31 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 961 bytes |
コンパイル時間 | 349 ms |
コンパイル使用メモリ | 10,768 KB |
実行使用メモリ | 559,064 KB |
最終ジャッジ日時 | 2023-10-04 15:45:55 |
合計ジャッジ時間 | 17,295 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 19 ms
13,108 KB |
testcase_01 | AC | 894 ms
132,388 KB |
testcase_02 | AC | 20 ms
8,788 KB |
testcase_03 | AC | 20 ms
8,724 KB |
testcase_04 | AC | 19 ms
8,804 KB |
testcase_05 | AC | 20 ms
8,776 KB |
testcase_06 | AC | 21 ms
8,788 KB |
testcase_07 | AC | 25 ms
9,424 KB |
testcase_08 | AC | 31 ms
10,496 KB |
testcase_09 | AC | 224 ms
38,552 KB |
testcase_10 | AC | 1,058 ms
140,200 KB |
testcase_11 | AC | 764 ms
131,716 KB |
testcase_12 | AC | 3,165 ms
315,344 KB |
testcase_13 | AC | 1,216 ms
152,340 KB |
testcase_14 | MLE | - |
testcase_15 | AC | 125 ms
12,340 KB |
testcase_16 | AC | 1,141 ms
136,920 KB |
testcase_17 | AC | 762 ms
131,232 KB |
testcase_18 | AC | 464 ms
72,620 KB |
testcase_19 | AC | 3,326 ms
308,088 KB |
testcase_20 | TLE | - |
testcase_21 | AC | 1,536 ms
172,388 KB |
testcase_22 | AC | 1,582 ms
256,328 KB |
testcase_23 | AC | 635 ms
86,524 KB |
testcase_24 | TLE | - |
testcase_25 | AC | 2,619 ms
281,304 KB |
testcase_26 | AC | 241 ms
41,720 KB |
testcase_27 | AC | 2,169 ms
257,900 KB |
testcase_28 | AC | 1,775 ms
257,672 KB |
testcase_29 | AC | 1,509 ms
173,428 KB |
testcase_30 | AC | 2,809 ms
309,124 KB |
testcase_31 | AC | 2,856 ms
310,456 KB |
testcase_32 | AC | 3,238 ms
342,000 KB |
testcase_33 | AC | 2,574 ms
288,152 KB |
testcase_34 | TLE | - |
testcase_35 | AC | 3,289 ms
339,844 KB |
testcase_36 | TLE | - |
testcase_37 | AC | 1,018 ms
134,388 KB |
testcase_38 | TLE | - |
testcase_39 | TLE | - |
testcase_40 | TLE | - |
testcase_41 | MLE | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
testcase_58 | -- | - |
testcase_59 | -- | - |
testcase_60 | -- | - |
testcase_61 | -- | - |
testcase_62 | -- | - |
testcase_63 | -- | - |
ソースコード
import sys sys.setrecursionlimit(200005) # sys.set_int_max_str_digits(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] # inf = -1-(-1 << 31) inf = -1-(-1 << 63) md = 10**9+7 # md = 998244353 from functools import lru_cache @lru_cache(None) def f(n, k): if n == 1 or k == 1: return 2 res = f(n-1, k) if k >= n: res += f(n-1, k//n) return res n, k = LI() print(f(n, k)-1)