結果

問題 No.1884 Sequence
ユーザー kokatsukokatsu
提出日時 2022-03-25 21:40:23
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 4,026 ms
コンパイル使用メモリ 208,820 KB
実行使用メモリ 15,228 KB
最終ジャッジ日時 2023-09-04 16:27:59
合計ジャッジ時間 9,050 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 WA -
testcase_10 AC 101 ms
14,708 KB
testcase_11 AC 102 ms
14,800 KB
testcase_12 AC 19 ms
9,632 KB
testcase_13 AC 21 ms
10,168 KB
testcase_14 AC 20 ms
9,716 KB
testcase_15 AC 62 ms
12,752 KB
testcase_16 AC 93 ms
14,756 KB
testcase_17 AC 38 ms
11,656 KB
testcase_18 AC 51 ms
13,428 KB
testcase_19 AC 45 ms
11,528 KB
testcase_20 AC 53 ms
11,864 KB
testcase_21 AC 41 ms
9,688 KB
testcase_22 AC 58 ms
11,840 KB
testcase_23 AC 93 ms
14,704 KB
testcase_24 AC 93 ms
14,604 KB
testcase_25 AC 91 ms
15,108 KB
testcase_26 AC 92 ms
14,664 KB
testcase_27 AC 23 ms
10,488 KB
testcase_28 AC 23 ms
10,484 KB
testcase_29 WA -
testcase_30 AC 23 ms
11,140 KB
testcase_31 AC 52 ms
11,284 KB
testcase_32 WA -
testcase_33 AC 72 ms
14,672 KB
testcase_34 AC 72 ms
14,748 KB
testcase_35 AC 26 ms
9,632 KB
testcase_36 AC 57 ms
12,560 KB
testcase_37 AC 74 ms
14,784 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 37 ms
10,876 KB
testcase_41 AC 79 ms
13,912 KB
testcase_42 AC 78 ms
13,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/dmd2/linux/bin64/../../src/phobos/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!ulong.gcdImpl`

ソースコード

diff #

import std;

void main() {
    long N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(long[]);

    A.sort!"a > b";

    long mx = A[0], mn = A[0];
    long[] B;
    foreach (i; 1 .. N) {
        if (A[i] == 0) break;

        B ~= A[i-1] - A[i];
        mn = min(mn, A[i]);
    }

    bool isOK = true;
    if (!B.empty) {
        long g = B.fold!gcd;
        isOK = mx <= mn + g * (N - 1);
    }

    writeln(isOK ? "Yes" : "No");
}
0