結果

問題 No.406 鴨等間隔の法則
ユーザー nukosukenukosuke
提出日時 2016-10-20 13:40:33
言語 Raku
(rakudo v2024.02)
結果
AC  
実行時間 1,071 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 133,688 KB
実行使用メモリ 167,632 KB
最終ジャッジ日時 2023-08-16 03:52:52
合計ジャッジ時間 27,600 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 682 ms
141,004 KB
testcase_01 AC 486 ms
132,292 KB
testcase_02 AC 481 ms
132,132 KB
testcase_03 AC 477 ms
132,332 KB
testcase_04 AC 968 ms
167,632 KB
testcase_05 AC 645 ms
138,244 KB
testcase_06 AC 658 ms
138,864 KB
testcase_07 AC 668 ms
138,836 KB
testcase_08 AC 955 ms
167,416 KB
testcase_09 AC 985 ms
167,604 KB
testcase_10 AC 679 ms
140,944 KB
testcase_11 AC 861 ms
153,404 KB
testcase_12 AC 702 ms
145,412 KB
testcase_13 AC 703 ms
143,308 KB
testcase_14 AC 954 ms
165,320 KB
testcase_15 AC 524 ms
132,636 KB
testcase_16 AC 524 ms
132,756 KB
testcase_17 AC 509 ms
132,956 KB
testcase_18 AC 516 ms
133,064 KB
testcase_19 AC 585 ms
132,424 KB
testcase_20 AC 558 ms
132,704 KB
testcase_21 AC 549 ms
132,484 KB
testcase_22 AC 603 ms
134,884 KB
testcase_23 AC 729 ms
145,244 KB
testcase_24 AC 863 ms
151,004 KB
testcase_25 AC 1,005 ms
165,664 KB
testcase_26 AC 1,053 ms
167,448 KB
testcase_27 AC 837 ms
165,560 KB
testcase_28 AC 856 ms
165,808 KB
testcase_29 AC 1,071 ms
165,272 KB
testcase_30 AC 1,060 ms
166,784 KB
testcase_31 AC 989 ms
167,340 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

get();
my @x = get().split(' ').map({.Int}).sort({ $^a <=> $^b });

for 1..@x.end {
  @x[$_-1] = @x[$_] - @x[$_-1];
}

my $ans;
for 0..@x.end-2 {
  if @x[$_] != @x[$_+1] || @x[$_] == 0 {
    $ans = 'NO';
    last;
  }
  $ans = 'YES';
}

say $ans;
0