結果

問題 No.2600 Avator Height
ユーザー heno239heno239
提出日時 2024-02-05 17:26:17
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 798 ms / 2,000 ms
コード長 1,250 bytes
コンパイル時間 6,866 ms
コンパイル使用メモリ 158,528 KB
実行使用メモリ 201,928 KB
最終ジャッジ日時 2024-02-05 17:26:49
合計ジャッジ時間 30,424 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
38,892 KB
testcase_01 AC 775 ms
49,900 KB
testcase_02 AC 765 ms
49,900 KB
testcase_03 AC 771 ms
49,900 KB
testcase_04 AC 746 ms
49,900 KB
testcase_05 AC 798 ms
49,900 KB
testcase_06 AC 767 ms
49,900 KB
testcase_07 AC 730 ms
49,900 KB
testcase_08 AC 758 ms
49,900 KB
testcase_09 AC 741 ms
49,900 KB
testcase_10 AC 748 ms
49,900 KB
testcase_11 AC 779 ms
49,900 KB
testcase_12 AC 750 ms
49,900 KB
testcase_13 AC 762 ms
49,900 KB
testcase_14 AC 761 ms
49,900 KB
testcase_15 AC 744 ms
49,900 KB
testcase_16 AC 781 ms
49,900 KB
testcase_17 AC 781 ms
49,900 KB
testcase_18 AC 751 ms
49,900 KB
testcase_19 AC 793 ms
49,900 KB
testcase_20 AC 762 ms
49,900 KB
testcase_21 AC 740 ms
49,900 KB
testcase_22 AC 781 ms
49,900 KB
testcase_23 AC 744 ms
49,900 KB
testcase_24 AC 708 ms
43,500 KB
testcase_25 AC 761 ms
201,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (93 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System.Collections;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

internal class Program
{
    private const long mod = 998244353;

    
    public static void Main(string[] args)
    {
        const int mn = 1 << 18;
        List<long> mem = new List<long>(mn);
        List<long> r = new List<long>(mn);
        List<long> e = new List<long>(mn);
        r.Add(0);
        r.Add(1);
        r.Add(1);
        e.Add(0);
        e.Add(1);
        e.Add(3);
        for (int i = 3; i < mn; i++)
        {
            r.Add((r[i-2]+r[i-1])%mod);
            e.Add((e[i-2]+e[i-1])%mod);
        }

        for (int i = 0; i < mn; i++)
        {
            long val = 0;
            val += 5 * r[i] % mod * r[i] % mod;
            val -= e[i] * e[i] % mod;
            if (val < 0) val += mod;
            mem.Add(val);
        }

        int q = int.Parse(Console.ReadLine());
        while (q-- > 0)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(mem[n]);
        }
    }

    public static List<int> mkar(int n, int val)
    {
        List<int> res = new List<int>(n);
        for(int i=0;i<n;i++)res.Add(val);
        return res;
    }
}
0