結果

問題 No.406 鴨等間隔の法則
ユーザー nukosukenukosuke
提出日時 2016-10-20 14:07:18
言語 Raku
(rakudo v2024.02)
結果
AC  
実行時間 953 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 136,196 KB
実行使用メモリ 175,148 KB
最終ジャッジ日時 2024-05-03 13:23:56
合計ジャッジ時間 23,522 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 613 ms
146,656 KB
testcase_01 AC 460 ms
136,944 KB
testcase_02 AC 453 ms
136,216 KB
testcase_03 AC 451 ms
136,940 KB
testcase_04 AC 818 ms
159,748 KB
testcase_05 AC 573 ms
146,420 KB
testcase_06 AC 597 ms
145,560 KB
testcase_07 AC 587 ms
146,288 KB
testcase_08 AC 808 ms
159,680 KB
testcase_09 AC 847 ms
163,664 KB
testcase_10 AC 614 ms
146,520 KB
testcase_11 AC 764 ms
155,964 KB
testcase_12 AC 650 ms
148,764 KB
testcase_13 AC 646 ms
147,948 KB
testcase_14 AC 827 ms
159,716 KB
testcase_15 AC 494 ms
141,016 KB
testcase_16 AC 498 ms
141,548 KB
testcase_17 AC 470 ms
140,228 KB
testcase_18 AC 486 ms
141,676 KB
testcase_19 AC 515 ms
141,804 KB
testcase_20 AC 526 ms
142,456 KB
testcase_21 AC 498 ms
142,572 KB
testcase_22 AC 570 ms
144,512 KB
testcase_23 AC 672 ms
149,016 KB
testcase_24 AC 777 ms
157,112 KB
testcase_25 AC 837 ms
162,228 KB
testcase_26 AC 953 ms
173,180 KB
testcase_27 AC 822 ms
173,836 KB
testcase_28 AC 737 ms
162,620 KB
testcase_29 AC 953 ms
172,556 KB
testcase_30 AC 948 ms
175,148 KB
testcase_31 AC 843 ms
161,020 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

get();
my @x = get().split(' ').map({.Int}).sort({ $^a <=> $^b });
my $diff = @x[1] - @x[0];
my $expect = @x[1];
my $ans  = True;

for 1..@x.end {
  if $expect != @x[$_] {
    $ans = False;
    last;
  }
  $expect += $diff;
}

if $diff == 0 {
  $ans = False;
}

say($ans ?? 'YES' !! 'NO');
0