結果

問題 No.1224 I hate Sqrt Inequality
ユーザー kakel-san
提出日時 2025-03-19 22:49:55
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 835 bytes
コンパイル時間 8,668 ms
コンパイル使用メモリ 173,560 KB
実行使用メモリ 188,136 KB
最終ジャッジ日時 2025-03-19 22:50:09
合計ジャッジ時間 10,878 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (107 ミリ秒)。
  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 long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static long[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (a, b) = (c[0], c[1]);
        var gcd = GCD(a, b);
        var pa = b / gcd;
        while (pa % 2 == 0) pa /= 2;
        while (pa % 5 == 0) pa /= 5;
        WriteLine(pa == 1 ? "No" : "Yes");
    }
    static long GCD(long a, long b)
    {
        if (a < b) return GCD(b, a);
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }
}
0