結果

問題 No.1686 Geschenkt
ユーザー neko_the_shadowneko_the_shadow
提出日時 2021-10-11 20:47:52
言語 Perl
(5.38.2)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 5,452 KB
実行使用メモリ 5,368 KB
最終ジャッジ日時 2023-10-14 05:45:23
合計ジャッジ時間 1,548 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,256 KB
testcase_01 AC 6 ms
5,256 KB
testcase_02 AC 6 ms
5,244 KB
testcase_03 AC 6 ms
5,160 KB
testcase_04 AC 7 ms
5,356 KB
testcase_05 AC 7 ms
5,368 KB
testcase_06 AC 6 ms
5,244 KB
testcase_07 AC 7 ms
5,284 KB
testcase_08 AC 7 ms
5,288 KB
testcase_09 AC 7 ms
5,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;
use List::Util qw(sum);

sub gets {
    chomp(my $line = <>);
    $line;
}

my $n = gets;
my @a = split / /, gets;

my %b = map {$_, 1} @a;
printf "%d\n", sum(grep {!exists($b{$_-1})} @a);
0