結果

問題 No.793 うし数列 2
ユーザー htkbhtkb
提出日時 2019-02-22 22:39:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-08-16 20:25:37
合計ジャッジ時間 1,550 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,792 KB
testcase_01 AC 13 ms
7,784 KB
testcase_02 AC 12 ms
7,968 KB
testcase_03 AC 12 ms
7,720 KB
testcase_04 AC 13 ms
7,784 KB
testcase_05 AC 14 ms
7,860 KB
testcase_06 AC 13 ms
7,800 KB
testcase_07 AC 13 ms
7,804 KB
testcase_08 AC 12 ms
7,984 KB
testcase_09 AC 13 ms
7,800 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 10**9+7
ans = pow(10, N, mod)
prev_d = 0

while N:
    d = 0
    x = 1
    n = 3
    while pow(2, d+1) <= N:
        n = (n * (pow(10, x, mod) + 1)) % mod
        x = x * 2 % mod
        d += 1

    ans = (ans + n * pow(10, prev_d, mod)) % mod
    N -= 2**d
    prev_d += 2**d

print(ans)
0