結果
問題 | No.793 うし数列 2 |
ユーザー | htkb |
提出日時 | 2019-02-22 22:54:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-25 19:51:51 |
合計ジャッジ時間 | 1,513 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
N = int(input()) mod = 10**9+7 ans = pow(10, N, mod) finished = 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 d += 1 ans = (ans + n * pow(10, finished, mod)) % mod N -= 2**d finished += 2 ** d print(ans % mod)