結果

問題 No.1679 マスゲーム
ユーザー neko_the_shadowneko_the_shadow
提出日時 2021-10-20 09:01:25
言語 Perl
(5.38.2)
結果
AC  
実行時間 385 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 1,126 ms
コンパイル使用メモリ 5,920 KB
実行使用メモリ 31,756 KB
最終ジャッジ日時 2023-10-20 10:55:47
合計ジャッジ時間 9,098 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,940 KB
testcase_01 AC 7 ms
5,936 KB
testcase_02 AC 7 ms
5,936 KB
testcase_03 AC 385 ms
31,748 KB
testcase_04 AC 360 ms
31,488 KB
testcase_05 AC 352 ms
31,488 KB
testcase_06 AC 347 ms
31,752 KB
testcase_07 AC 345 ms
31,488 KB
testcase_08 AC 344 ms
31,488 KB
testcase_09 AC 339 ms
31,756 KB
testcase_10 AC 347 ms
31,500 KB
testcase_11 AC 349 ms
31,492 KB
testcase_12 AC 30 ms
8,572 KB
testcase_13 AC 131 ms
17,816 KB
testcase_14 AC 373 ms
31,488 KB
testcase_15 AC 314 ms
29,112 KB
testcase_16 AC 269 ms
26,744 KB
testcase_17 AC 6 ms
5,940 KB
testcase_18 AC 146 ms
5,940 KB
testcase_19 AC 7 ms
5,952 KB
testcase_20 AC 6 ms
5,940 KB
testcase_21 AC 7 ms
6,004 KB
testcase_22 AC 7 ms
5,988 KB
testcase_23 AC 7 ms
5,940 KB
testcase_24 AC 6 ms
5,944 KB
testcase_25 AC 7 ms
5,976 KB
testcase_26 AC 7 ms
5,944 KB
testcase_27 AC 8 ms
5,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;
use utf8;

my $n = <>;
my %p;
my %q;
for (my $i = 0; $i < $n; $i++) {
    my ($a, $b, $t) = split / /, <>;
    $a==0 ? $p{$b-$t}++ : $q{$b-$t}++; 
}

my $ans = 0;
for my $k (keys %p) {
    $ans += $p{$k} * $q{$k};
}
print $ans, "\n";

0