結果

問題 No.492 IOI数列
コンテスト
ユーザー 👑 kakel-san
提出日時 2026-11-17 20:52:24
言語 C#
(.NET 10.0.403 + ACL)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 37 ms / 1,000 ms
+ 159µs
コード長 1,082 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,364 ms
コンパイル使用メモリ 173,008 KB
実行使用メモリ 31,044 KB
最終ジャッジ日時 2026-11-17 20:52:37
合計ジャッジ時間 11,157 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (213 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = long.Parse(ReadLine());
        var mod = 1_000_000_007;
        var rev99 = 646_464_651;
        WriteLine((Exp(10, 2 * n, mod) - 1 + mod) % mod * rev99 % mod);
        if (n % 11 == 0) WriteLine(0);
        else
        {
            var ans = "1";
            for (var i = 1; i < n % 11; ++i) ans += "01";
            WriteLine(ans);
        }
    }
    static long Exp(long n, long p, int mod)
    {
        long _n = n % mod;
        var _p = p;
        var result = 1L;
        if ((_p & 1) == 1) result *= _n;
        while (_p > 0)
        {
            _n = _n * _n % mod;
            _p >>= 1;
            if ((_p & 1) == 1) result = result * _n % mod;
        }
        return result;
    }
}
0