結果

問題 No.1679 マスゲーム
ユーザー tnodinotnodino
提出日時 2022-02-04 20:07:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 150,224 KB
最終ジャッジ日時 2023-09-02 04:21:35
合計ジャッジ時間 10,783 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,488 KB
testcase_01 AC 94 ms
71,608 KB
testcase_02 AC 94 ms
71,612 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 93 ms
71,728 KB
testcase_18 AC 348 ms
124,844 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 97 ms
71,684 KB
testcase_24 WA -
testcase_25 AC 109 ms
76,920 KB
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
L = [list(map(int,input().split())) for _ in range(N)]
A,B,T = [list(i) for i in zip(*L)]
dic = defaultdict(int)
for i in range(N):
    if A[i] == 0:
        dic[B[i]+T[i]] += 1
ans = 0
for i in range(N):
    if A[i] == 1:
        ans += dic[B[i]+T[i]]
print(ans)
0