結果
問題 | No.793 うし数列 2 |
ユーザー |
![]() |
提出日時 | 2019-02-22 21:40:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,119 bytes |
コンパイル時間 | 1,509 ms |
コンパイル使用メモリ | 167,524 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 06:14:16 |
合計ジャッジ時間 | 2,362 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include "bits/stdc++.h" #define REP(i,n) for(ll i=0;i<ll(n);++i) #define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i) #define FOR(i,m,n) for(ll i=m;i<ll(n);++i) #define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i) #define ALL(v) (v).begin(),(v).end() #define UNIQUE(v) v.erase(unique(ALL(v)),v.end()); #define INF 1000000001ll #define MOD 1000000007ll #define EPS 1e-9 constexpr int dx[8] = { 1,1,0,-1,-1,-1,0,1 }; constexpr int dy[8] = { 0,1,1,1,0,-1,-1,-1 }; using namespace std; using ll = long long; using vi = vector<int>; using vl = vector<ll>; using vvi = vector<vi>; using vvl = vector<vl>; using pii = pair<int, int>; using pll = pair<ll, ll>; template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } ll po(ll a, ll n) { if (n == 0)return 1; ll d = po(a, n / 2); if (n & 1)return a * d%MOD*d%MOD; return d * d%MOD; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; cout << (4 * ((MOD + 1) / 3) % MOD*po(10, n) - (MOD + 1) / 3 + MOD) % MOD << endl; }