結果

問題 No.182 新規性の虜
ユーザー togaerror
提出日時 2015-04-17 11:50:45
言語 Perl
(5.40.0)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 7,076 KB
実行使用メモリ 17,144 KB
最終ジャッジ日時 2024-12-26 18:58:49
合計ジャッジ時間 2,441 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
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