結果
問題 | No.793 うし数列 2 |
ユーザー |
![]() |
提出日時 | 2019-02-22 23:01:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 863 bytes |
コンパイル時間 | 916 ms |
コンパイル使用メモリ | 96,540 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 21:15:58 |
合計ジャッジ時間 | 1,726 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; using ll = long long; using pii = pair<int,int>; ll mod = 1000000007; ll mod_pow(ll a, ll b){ if(b==0)return 1; if(b==1)return a; ll res = mod_pow(a,b/2); res = res * res % mod; if(b%2)res = res * a; return res % mod; } int main(){ ll n; cin >> n; cout << (4*mod_pow(10,n)%mod-1+mod)%mod*mod_pow(3,mod-2)%mod << endl; }