結果
| 問題 | No.793 うし数列 2 |
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2020-04-15 17:21:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| 記録 | |
| コンパイル時間 | 1,719 ms |
| コンパイル使用メモリ | 166,008 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-01 18:55:04 |
| 合計ジャッジ時間 | 2,281 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD=1e9+7;
int pw(int n,int k){
assert(k>=0);
int res=1;
while(k){
if(k&1)(res*=n)%=MOD;
(n*=n)%=MOD;
k>>=1;
}
return res;
}
signed main(){
int n;cin>>n;
int ans=pw(10,n);
int res=0,now=1,nok=10;
while(n){
if(n&1)res=(res*nok+now)%MOD;
now=(now*nok+now)%MOD;
(nok*=nok)%MOD;
n>>=1;
}
cout<<(ans+res*3)%MOD<<endl;
}
cureskol