結果

問題 No.24 数当てゲーム
ユーザー teioteio
提出日時 2020-07-25 07:21:58
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 4,640 KB
最終ジャッジ日時 2023-09-08 17:23:17
合計ジャッジ時間 722 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,468 KB
testcase_01 AC 3 ms
4,640 KB
testcase_02 AC 3 ms
4,608 KB
testcase_03 AC 3 ms
4,588 KB
testcase_04 WA -
testcase_05 AC 3 ms
4,464 KB
testcase_06 AC 3 ms
4,596 KB
testcase_07 AC 3 ms
4,588 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# use strict;
# use warnings;

my %d;
$d{$_} = 0 foreach 0 .. 9;
<>;
my $c = 0;
while (<>) {
    chomp;
    my @x = split(/\s/);
    my @ds = @x[0 .. ($#x - 1)];
    my $b = $x[-1];
    if ($b eq 'YES') {
        $c++;
        $d{$_}++ foreach @ds;
        foreach (keys(%d)) {
            delete $d{$_} if $d{$_} < $c;
        }
    } else {
        delete $d{$_} foreach @ds;
    }
    last if scalar(keys(%d)) == 1;
}
print((keys(%d))[0], "\n");
0