結果

問題 No.1987 Sandglass Inconvenience
ユーザー 👑 kakel-sankakel-san
提出日時 2022-09-04 16:43:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 1,235 ms
コンパイル使用メモリ 65,884 KB
実行使用メモリ 24,012 KB
最終ジャッジ日時 2023-08-12 02:25:47
合計ジャッジ時間 4,964 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,824 KB
testcase_01 AC 58 ms
21,772 KB
testcase_02 AC 59 ms
21,848 KB
testcase_03 AC 59 ms
21,960 KB
testcase_04 AC 59 ms
21,828 KB
testcase_05 AC 59 ms
23,800 KB
testcase_06 AC 59 ms
23,956 KB
testcase_07 AC 59 ms
23,848 KB
testcase_08 AC 59 ms
21,860 KB
testcase_09 AC 60 ms
21,860 KB
testcase_10 AC 58 ms
21,948 KB
testcase_11 AC 59 ms
23,860 KB
testcase_12 AC 59 ms
23,952 KB
testcase_13 AC 59 ms
21,912 KB
testcase_14 AC 60 ms
23,992 KB
testcase_15 AC 59 ms
21,824 KB
testcase_16 AC 59 ms
21,824 KB
testcase_17 AC 60 ms
21,868 KB
testcase_18 AC 58 ms
21,980 KB
testcase_19 AC 60 ms
21,820 KB
testcase_20 AC 59 ms
21,832 KB
testcase_21 AC 59 ms
21,792 KB
testcase_22 AC 58 ms
19,756 KB
testcase_23 AC 60 ms
23,872 KB
testcase_24 AC 60 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Program
{
    static long NN => long.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static void Main()
    {
        var m = NList;
        var x = NN;
        var gcd = GCD(GCD(m[0], m[1]), m[2]);
        WriteLine(x % gcd == 0 ? "Yes" : "No");
    }
    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