結果

問題 No.793 うし数列 2
ユーザー pasoconhoshiipasoconhoshii
提出日時 2019-03-19 07:51:56
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 12,796 KB
最終ジャッジ日時 2023-10-11 09:09:00
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
mod=10**9+7
def g(n):
    if n==1:
        return 3
    elif n==0:
        return 0
    
    if n%2==0: 
        return (g(n//2)*pow(10,n//2,mod)%mod+g(n//2)%mod)%mod
    else:
        t=g(n//2)*pow(10,n//2,mod)%mod
        t+=g(n//2)
        t%=mod
        t=(t*10+3)%mod
        return t
print( (g(N)+pow(10,N+1,mod))%mod )
0