結果

問題 No.2785 四乗足す四の末尾の0
ユーザー 👑 kakel-sankakel-san
提出日時 2024-06-24 00:04:13
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 577 ms / 2,000 ms
コード長 1,292 bytes
コンパイル時間 13,060 ms
コンパイル使用メモリ 171,188 KB
実行使用メモリ 34,688 KB
最終ジャッジ日時 2024-06-24 00:04:33
合計ジャッジ時間 16,206 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
29,036 KB
testcase_01 AC 52 ms
29,044 KB
testcase_02 AC 53 ms
28,800 KB
testcase_03 AC 52 ms
28,416 KB
testcase_04 AC 52 ms
28,764 KB
testcase_05 AC 52 ms
28,416 KB
testcase_06 AC 52 ms
29,056 KB
testcase_07 AC 52 ms
28,544 KB
testcase_08 AC 53 ms
28,764 KB
testcase_09 AC 52 ms
29,184 KB
testcase_10 AC 51 ms
28,416 KB
testcase_11 AC 52 ms
28,544 KB
testcase_12 AC 51 ms
29,056 KB
testcase_13 AC 56 ms
29,176 KB
testcase_14 AC 113 ms
30,720 KB
testcase_15 AC 573 ms
33,920 KB
testcase_16 AC 52 ms
28,928 KB
testcase_17 AC 540 ms
34,688 KB
testcase_18 AC 577 ms
34,432 KB
testcase_19 AC 546 ms
34,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (178 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

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();
    static int[] LList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => int.Parse(ReadLine())).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        for (var u = 0; u < t; ++u)
        {
            var n = Math.Abs(NN);
            WriteLine(n == 1 ? "Yes" : "No");
            n %= 100;
            n = n * n * n * n + 4;
            var cnt = 0;
            while (n % 10 == 0)
            {
                ++cnt;
                n /= 10;
            }
            WriteLine(cnt);
        }
    }
    static bool IsPrime(long n)
    {
        if (n == 1) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;
        int i = 3;
        while (i * i <= n)
        {
            if (n % i == 0)
            {
                WriteLine($"{n} = {i} * {n / i}");
                return false;
            }
            i = i + 2;
        }
        WriteLine($"{n} is Prime");
        return true;
    }
}
0