結果

問題 No.406 鴨等間隔の法則
ユーザー motimoti
提出日時 2018-05-20 07:24:55
言語 Perl
(5.38.2)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 24,480 KB
最終ジャッジ日時 2023-09-21 18:50:12
合計ジャッジ時間 3,447 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
12,500 KB
testcase_01 AC 5 ms
4,968 KB
testcase_02 AC 5 ms
5,108 KB
testcase_03 AC 4 ms
5,088 KB
testcase_04 AC 102 ms
22,588 KB
testcase_05 AC 33 ms
11,440 KB
testcase_06 AC 35 ms
11,664 KB
testcase_07 AC 35 ms
11,668 KB
testcase_08 AC 93 ms
22,528 KB
testcase_09 AC 102 ms
24,308 KB
testcase_10 AC 39 ms
12,528 KB
testcase_11 AC 78 ms
19,964 KB
testcase_12 AC 48 ms
14,656 KB
testcase_13 AC 45 ms
13,972 KB
testcase_14 AC 95 ms
21,124 KB
testcase_15 AC 7 ms
5,956 KB
testcase_16 AC 9 ms
6,192 KB
testcase_17 AC 7 ms
5,556 KB
testcase_18 AC 8 ms
6,396 KB
testcase_19 AC 12 ms
6,416 KB
testcase_20 AC 15 ms
7,112 KB
testcase_21 AC 14 ms
7,320 KB
testcase_22 AC 25 ms
9,156 KB
testcase_23 AC 53 ms
15,384 KB
testcase_24 AC 82 ms
19,140 KB
testcase_25 AC 103 ms
24,436 KB
testcase_26 AC 124 ms
24,480 KB
testcase_27 AC 59 ms
24,372 KB
testcase_28 AC 59 ms
24,440 KB
testcase_29 AC 120 ms
24,276 KB
testcase_30 AC 119 ms
24,252 KB
testcase_31 AC 101 ms
23,384 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