結果
問題 | No.1892 Extended Fib Series |
ユーザー | yassu0320 |
提出日時 | 2022-04-02 01:15:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,624 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,496 KB |
実行使用メモリ | 80,356 KB |
最終ジャッジ日時 | 2024-11-20 19:48:44 |
合計ジャッジ時間 | 4,046 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
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 | AC | 96 ms
80,136 KB |
testcase_16 | WA | - |
testcase_17 | AC | 89 ms
79,892 KB |
testcase_18 | AC | 89 ms
80,144 KB |
testcase_19 | AC | 85 ms
80,100 KB |
testcase_20 | AC | 90 ms
80,024 KB |
testcase_21 | AC | 90 ms
79,804 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 83 ms
80,100 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 84 ms
79,896 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
ソースコード
#!/usr/bin/env pypy3 from pprint import pprint from string import ascii_lowercase as letter from sys import setrecursionlimit, stdin from typing import Dict, Iterable, Set try: import pypyjit pypyjit.set_param("max_unroll_recursion=-1") except ModuleNotFoundError: ... INF: int = (1 << 62) - 1 MOD1000000007 = 10**9 + 7 MOD998244353 = 998244353 setrecursionlimit(500_000) readline = stdin.readline input = lambda: stdin.readline().rstrip("\r\n") def inputs(type_=int): ins = input().split() if isinstance(type_, Iterable): return [t(x) for t, x in zip(type_, ins)] else: return list(map(type_, ins)) def input_(type_=int): (a, ) = inputs(type_) return a def input1() -> int: return int(readline()) inputi = input1 def input2(): a = readline().split() assert len(a) == 2 a[0] = int(a[0]) a[1] = int(a[1]) return a def input3(): a = readline().split() assert len(a) == 3 a[0] = int(a[0]) a[1] = int(a[1]) a[2] = int(a[2]) return a def input4(): a = readline().split() assert len(a) == 4 a[0] = int(a[0]) a[1] = int(a[1]) a[2] = int(a[2]) a[3] = int(a[3]) return a # start coding from typing import List, Optional n, l = input2() n, l = 1, 1 mod = MOD1000000007 if n < l: print(pow(2, n - 1, mod)) exit() a: List[Optional[int]] = [None] * (n + 1) a[0] = 1 for i in range(1, l): a[i] = pow(2, i - 1, mod) s = 0 for i in range(l): s += a[i] s %= mod for i in range(l, n + 1): a[i] = s s -= a[i - l] s += a[i] s %= mod # print(a) print(a[-1])