結果
| 問題 | No.793 うし数列 2 |
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-13 21:38:03 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 427 bytes |
| 記録 | |
| コンパイル時間 | 1,256 ms |
| コンパイル使用メモリ | 209,212 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-09 01:10:34 |
| 合計ジャッジ時間 | 2,458 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
lint mod=1'000'000'007;
lint inv3=(1+mod)/3;
lint n;std::cin>>n;
lint ans=1;
for(lint pow10=10;n;n>>=1){
if(n&1)ans=ans*pow10%mod;
pow10=pow10*pow10%mod;
}
std::cout<<(4*ans-1)*inv3%mod<<'\n';
}
/*
* 133333...*3=(4*10^n-1)/3
*/
ngtkana