結果

問題 No.406 鴨等間隔の法則
ユーザー motimoti
提出日時 2018-05-20 07:24:55
言語 Perl
(5.38.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 24,432 KB
最終ジャッジ日時 2023-09-21 18:49:46
合計ジャッジ時間 3,775 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
12,544 KB
testcase_01 AC 5 ms
4,960 KB
testcase_02 AC 5 ms
4,900 KB
testcase_03 AC 4 ms
5,020 KB
testcase_04 AC 100 ms
22,620 KB
testcase_05 AC 33 ms
11,436 KB
testcase_06 AC 37 ms
11,716 KB
testcase_07 AC 36 ms
11,780 KB
testcase_08 AC 93 ms
22,488 KB
testcase_09 AC 106 ms
24,096 KB
testcase_10 AC 42 ms
12,596 KB
testcase_11 AC 81 ms
19,912 KB
testcase_12 AC 50 ms
14,428 KB
testcase_13 AC 48 ms
13,896 KB
testcase_14 AC 99 ms
21,040 KB
testcase_15 AC 7 ms
6,016 KB
testcase_16 AC 10 ms
6,236 KB
testcase_17 AC 7 ms
5,548 KB
testcase_18 AC 9 ms
6,384 KB
testcase_19 AC 12 ms
6,572 KB
testcase_20 AC 16 ms
7,052 KB
testcase_21 AC 14 ms
7,364 KB
testcase_22 AC 26 ms
9,180 KB
testcase_23 AC 53 ms
15,308 KB
testcase_24 AC 84 ms
19,056 KB
testcase_25 AC 110 ms
24,432 KB
testcase_26 AC 126 ms
24,292 KB
testcase_27 AC 58 ms
24,272 KB
testcase_28 AC 61 ms
24,364 KB
testcase_29 AC 127 ms
24,412 KB
testcase_30 AC 124 ms
24,228 KB
testcase_31 AC 104 ms
23,476 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

$_ = <>;
my @v = sort {$a <=> $b} (split / /,<>);
my $count = $v[1] - $v[0];
my $prev = -1;
for my $x (@v) {
  if ($prev != -1 && ($prev == $x || $x - $prev != $count)) {
    print "NO\n";
    exit;
  }
  $prev = $x;
}
print "YES\n";
0