結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー togaerrortogaerror
提出日時 2015-04-18 02:13:35
言語 Perl
(5.38.2)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 367 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 15,228 KB
最終ジャッジ日時 2023-09-08 14:24:12
合計ジャッジ時間 1,745 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,180 KB
testcase_01 AC 37 ms
15,072 KB
testcase_02 AC 5 ms
4,792 KB
testcase_03 AC 5 ms
5,096 KB
testcase_04 AC 5 ms
5,060 KB
testcase_05 AC 39 ms
15,196 KB
testcase_06 AC 5 ms
5,076 KB
testcase_07 AC 5 ms
4,768 KB
testcase_08 AC 5 ms
4,912 KB
testcase_09 AC 5 ms
4,932 KB
testcase_10 AC 5 ms
4,808 KB
testcase_11 AC 5 ms
4,992 KB
testcase_12 AC 5 ms
4,880 KB
testcase_13 AC 5 ms
5,076 KB
testcase_14 AC 24 ms
10,852 KB
testcase_15 AC 12 ms
7,308 KB
testcase_16 AC 31 ms
13,004 KB
testcase_17 AC 13 ms
7,076 KB
testcase_18 AC 29 ms
12,332 KB
testcase_19 AC 22 ms
10,328 KB
testcase_20 AC 38 ms
15,228 KB
testcase_21 AC 6 ms
5,044 KB
testcase_22 AC 17 ms
8,188 KB
testcase_23 AC 36 ms
14,532 KB
testcase_24 AC 38 ms
14,732 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 < 7; $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 < 7; $i++) {
	if($keep <= $count[$i]) {
		$j = $i;
		$keep = $count[$i];
	}
}

print "$j\n";

exit;
0