結果

問題 No.2269 eN!の整数部分の下1桁
ユーザー 👑 kakel-sankakel-san
提出日時 2023-07-05 18:04:19
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 731 bytes
コンパイル時間 1,384 ms
コンパイル使用メモリ 63,072 KB
実行使用メモリ 28,116 KB
最終ジャッジ日時 2023-09-26 18:22:12
合計ジャッジ時間 5,952 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,808 KB
testcase_01 AC 55 ms
20,636 KB
testcase_02 AC 57 ms
20,716 KB
testcase_03 AC 56 ms
20,732 KB
testcase_04 AC 57 ms
20,720 KB
testcase_05 AC 56 ms
20,620 KB
testcase_06 AC 57 ms
22,732 KB
testcase_07 AC 59 ms
20,600 KB
testcase_08 AC 60 ms
22,816 KB
testcase_09 AC 58 ms
20,632 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 122 ms
25,944 KB
testcase_21 AC 119 ms
26,028 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static ulong NN => ulong.Parse(ReadLine());
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = (int)NN;
        var ans = new ulong[t];
        for (var u = 0; u < t; ++u)
        {
            var n = NN;
            ulong mul = 1;
            ulong en1 = 0;
            for (ulong i = 0; i <= n; ++i)
            {
                en1 += mul;
                mul = mul * (n - i) % 10;
                if (mul == 0) break;
            }
            ans[u] = en1 % 10;
        }
        WriteLine(string.Join("\n", ans));
    }
}
0