結果

問題 No.492 IOI数列
ユーザー face4
提出日時 2019-02-14 10:12:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 545 bytes
コンパイル時間 774 ms
コンパイル使用メモリ 64,112 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 11:20:13
合計ジャッジ時間 1,258 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;

ll modpow(ll a, ll b, ll p = 1e9+7){
    if(b == 0)  return 1;

    if(b % 2 == 0){
        ll d = modpow(a, b/2, p);
        return (d*d) % p;
    }else{
        return (a%p * modpow(a, b-1, p)) % p;
    }
}

int main(){
    ll n;
    cin >> n;

    ll a = modpow(100, n-1, mod);
    cout << (a + (a-1+mod)%mod * modpow(99, mod-2, mod))%mod << endl;

    for(int i = 0; i < (n%11)-1; i++)   cout << "10";
    cout << (n%11-1 >= 0) << endl;

    return 0;
}
0