結果
問題 | No.492 IOI数列 |
ユーザー |
![]() |
提出日時 | 2020-05-21 13:02:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 896 ms / 1,000 ms |
コード長 | 1,065 bytes |
コンパイル時間 | 420 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 73,680 KB |
最終ジャッジ日時 | 2024-12-20 16:38:12 |
合計ジャッジ時間 | 15,358 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
import numpy as npfrom itertools import *from bisect import *from collections import *from heapq import *import syssys.setrecursionlimit(10 ** 6)def II(): return int(sys.stdin.readline())def MI(): return map(int, sys.stdin.readline().split())def LI(): return list(map(int, sys.stdin.readline().split()))def SI(): return sys.stdin.readline()[:-1]def LLI(rows_number): return [LI() for _ in range(rows_number)]def LLI1(rows_number): return [LI1() for _ in range(rows_number)]int1 = lambda x: int(x) - 1def MI1(): return map(int1, sys.stdin.readline().split())def LI1(): return list(map(int1, sys.stdin.readline().split()))p2D = lambda x: print(*x, sep="\n")dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]def main():md=1000000007n=II()ans1=(pow(100,n,md)-1)*pow(99,md-2,md)%mdmd=101010101010101010101n-=1ans2=np.ones(2,dtype="i8")base=np.array([[100,0],[1,1]],dtype="i8")while n:if n&1:ans2=np.dot(ans2,base)%mdbase=np.dot(base,base)%mdn>>=1print(ans1)print(ans2[0])main()