結果
問題 |
No.793 うし数列 2
|
ユーザー |
![]() |
提出日時 | 2019-10-22 14:24:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 798 bytes |
コンパイル時間 | 1,508 ms |
コンパイル使用メモリ | 165,904 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 23:01:55 |
合計ジャッジ時間 | 2,581 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--) #define itn int #define all(x) (x).begin(),(x).end() #define F first #define S second const long long INF = 1LL << 60; const int MOD = 1000000007; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template< typename T > T mod_pow(T x, T n, const T &p) { T ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= p; (x *= x) %= p; n >>= 1; } return ret; } signed main(void){ int n; cin>>n; cout<<(mod_pow(10LL,n, MOD) * 4 + MOD - 1)* ((MOD+2)/3) % MOD<<endl; }