結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー togaerrortogaerror
提出日時 2015-04-18 02:07:27
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 18,312 KB
最終ジャッジ日時 2023-09-17 22:29:12
合計ジャッジ時間 2,143 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
5,392 KB
testcase_01 AC 61 ms
18,300 KB
testcase_02 AC 5 ms
5,004 KB
testcase_03 AC 5 ms
4,820 KB
testcase_04 AC 5 ms
4,820 KB
testcase_05 AC 61 ms
18,248 KB
testcase_06 AC 5 ms
4,856 KB
testcase_07 WA -
testcase_08 AC 5 ms
4,964 KB
testcase_09 AC 5 ms
4,828 KB
testcase_10 AC 5 ms
4,960 KB
testcase_11 AC 5 ms
5,016 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 37 ms
12,864 KB
testcase_15 AC 18 ms
7,888 KB
testcase_16 AC 48 ms
15,264 KB
testcase_17 AC 17 ms
7,864 KB
testcase_18 AC 46 ms
14,652 KB
testcase_19 AC 35 ms
12,128 KB
testcase_20 AC 61 ms
18,312 KB
testcase_21 AC 6 ms
5,060 KB
testcase_22 AC 24 ms
9,380 KB
testcase_23 AC 57 ms
17,572 KB
testcase_24 AC 60 ms
17,720 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my $n = <>;
my $l = <>;
chomp $l;
my @array = split / /, $l;
my @count;
for(my $i = 0; $i < $n + 1; $i++) {
	$count[$i] = 0;
}
for(my $i = 0; $i < $n; $i++) {
	$count[$array[$i]]++; 
}

my $keep = 0;
my $j = 0;
for(my $i = 0; $i < $n + 1; $i++) {
	if($keep <= $count[$i]) {
		$j = $i;
		$keep = $count[$i];
	}
}

print "$j\n";

exit;
0