結果

問題 No.182 新規性の虜
ユーザー togaerrortogaerror
提出日時 2015-04-17 11:50:45
言語 Perl
(5.38.2)
結果
AC  
実行時間 89 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 16,496 KB
最終ジャッジ日時 2023-08-27 07:12:18
合計ジャッジ時間 2,674 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,916 KB
testcase_01 AC 4 ms
4,816 KB
testcase_02 AC 4 ms
5,012 KB
testcase_03 AC 4 ms
4,892 KB
testcase_04 AC 4 ms
4,896 KB
testcase_05 AC 5 ms
4,944 KB
testcase_06 AC 5 ms
4,920 KB
testcase_07 AC 5 ms
4,756 KB
testcase_08 AC 55 ms
10,968 KB
testcase_09 AC 89 ms
14,672 KB
testcase_10 AC 80 ms
13,396 KB
testcase_11 AC 66 ms
11,904 KB
testcase_12 AC 27 ms
7,780 KB
testcase_13 AC 4 ms
4,784 KB
testcase_14 AC 4 ms
4,828 KB
testcase_15 AC 5 ms
5,056 KB
testcase_16 AC 5 ms
4,920 KB
testcase_17 AC 4 ms
5,004 KB
testcase_18 AC 75 ms
13,264 KB
testcase_19 AC 54 ms
10,752 KB
testcase_20 AC 33 ms
8,316 KB
testcase_21 AC 87 ms
14,236 KB
testcase_22 AC 42 ms
9,244 KB
testcase_23 AC 5 ms
4,920 KB
testcase_24 AC 60 ms
16,496 KB
testcase_25 AC 39 ms
16,024 KB
testcase_26 AC 13 ms
6,208 KB
testcase_27 AC 4 ms
4,892 KB
evil01.txt AC 62 ms
16,836 KB
evil02.txt AC 59 ms
16,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my $n = <>;
my $str = <>;
chomp $str;
my @array = split / /, $str;
my $count = 0;
@array = sort @array;

my $i = 0;
while($i < $n) {
	my $j = 1;
	while(($i + $j < $n)and($array[$i] == $array[$i + $j])) {
		$j++;
	}
	if($j == 1) {
		$count++;
	}
	$i += $j;
}

print "$count\n";

exit;
0