結果

問題 No.793 うし数列 2
コンテスト
ユーザー aaaaaaiu
提出日時 2019-08-21 23:11:54
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 994µs
コード長 338 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,307 ms
コンパイル使用メモリ 214,076 KB
実行使用メモリ 9,860 KB
最終ジャッジ日時 2026-10-24 00:50:58
合計ジャッジ時間 3,222 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int mpow(ll a,ll b,int m) {
    int ans=1;
    while (b) {
        if (b&1) ans=ans*a%m;
        a=a*a%m;
        b>>=1;
    }
    return ans;
}

int main() {
    int m=1e9+7;
    ll n;
    cin>>n;
    cout<<(4LL*mpow(10,n,m)-1)%m*mpow(3,m-2,m)%m<<endl;
    return 0;
}
0