結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2016-05-19 00:32:52 |
言語 | Perl (5.40.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 05:45:35 |
合計ジャッジ時間 | 910 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 5 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
use strict; my $N = <STDIN>; my @list; my $str; for (my $i = 0; $i < $N; $i++) { $str = <STDIN>; push(@list, $str); } @list = sort {$a <=> $b} @list; my $cnt = 0; my $cnt_max = 0; my $res = ""; foreach my $i(@list) { if($i ne $res) { $cnt = 0; } $cnt++; $res = $i; if($cnt > $cnt_max) { $cnt_max = $cnt; } } if($cnt_max >= int(@list / 2) + 1) { print "NO\n"; } else { print "YES\n"; }