結果
問題 | No.793 うし数列 2 |
ユーザー | eQe |
提出日時 | 2020-05-05 23:07:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 121 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 704 ms |
コンパイル使用メモリ | 86,636 KB |
実行使用メモリ | 72,540 KB |
最終ジャッジ日時 | 2023-09-09 14:11:02 |
合計ジャッジ時間 | 5,189 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
72,356 KB |
testcase_01 | AC | 111 ms
72,384 KB |
testcase_02 | AC | 113 ms
72,364 KB |
testcase_03 | AC | 110 ms
72,504 KB |
testcase_04 | AC | 114 ms
72,392 KB |
testcase_05 | AC | 111 ms
72,264 KB |
testcase_06 | AC | 113 ms
72,272 KB |
testcase_07 | AC | 115 ms
72,352 KB |
testcase_08 | AC | 112 ms
72,380 KB |
testcase_09 | AC | 112 ms
72,364 KB |
testcase_10 | AC | 121 ms
72,540 KB |
testcase_11 | AC | 111 ms
72,276 KB |
testcase_12 | AC | 108 ms
72,280 KB |
testcase_13 | AC | 109 ms
72,536 KB |
testcase_14 | AC | 109 ms
72,276 KB |
testcase_15 | AC | 112 ms
72,516 KB |
testcase_16 | AC | 114 ms
72,356 KB |
testcase_17 | AC | 113 ms
72,276 KB |
testcase_18 | AC | 115 ms
72,488 KB |
testcase_19 | AC | 116 ms
72,540 KB |
testcase_20 | AC | 113 ms
72,104 KB |
testcase_21 | AC | 115 ms
72,152 KB |
testcase_22 | AC | 110 ms
72,276 KB |
ソースコード
import cmath import sys from collections import deque, defaultdict from heapq import heappop,heappush from copy import deepcopy INF=10**18 MOD=10**9+7 MAX=10**5+7 def f(n): if n==0: return 0 res=0 if n&1: res+=pow(10, n-1, MOD) res%=MOD t=f(n//2) res+=(pow(10, n//2, MOD)*t+t)%MOD res%=MOD return res def main(): N=int(input()) ans=(pow(10, N, MOD)+f(N)*3)%MOD print(ans) if __name__=='__main__': main()