結果

問題 No.793 うし数列 2
ユーザー dsytk7
提出日時 2019-02-22 23:54:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 1,506 ms
コンパイル使用メモリ 166,152 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-26 03:16:36
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<ll, ll>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

ll mod_pow(ll x, ll n, ll mod=1e9+7)
{
    ll ret = 1;
    while (n > 0)
    {
        if (n&1) ret = ret * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return ret % mod;
}

int main()
{
    const ll mod = 1e9 + 7;
    ll n;
    cin >> n;
    ll tmp = mod_pow(10LL, n);
    cout << (tmp + (tmp - 1) / 3LL) % mod << endl;
}
0