結果

問題 No.1679 マスゲーム
ユーザー tnodinotnodino
提出日時 2022-02-04 20:19:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 390 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 2,541 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 149,964 KB
最終ジャッジ日時 2023-09-02 04:22:10
合計ジャッジ時間 9,849 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,604 KB
testcase_01 AC 87 ms
71,444 KB
testcase_02 AC 85 ms
71,404 KB
testcase_03 AC 390 ms
149,716 KB
testcase_04 AC 360 ms
149,956 KB
testcase_05 AC 365 ms
149,620 KB
testcase_06 AC 355 ms
149,948 KB
testcase_07 AC 361 ms
149,872 KB
testcase_08 AC 365 ms
149,848 KB
testcase_09 AC 349 ms
149,852 KB
testcase_10 AC 356 ms
149,964 KB
testcase_11 AC 349 ms
149,832 KB
testcase_12 AC 135 ms
82,564 KB
testcase_13 AC 223 ms
107,108 KB
testcase_14 AC 355 ms
144,596 KB
testcase_15 AC 312 ms
136,944 KB
testcase_16 AC 299 ms
129,060 KB
testcase_17 AC 82 ms
71,644 KB
testcase_18 AC 313 ms
124,532 KB
testcase_19 AC 92 ms
76,492 KB
testcase_20 AC 94 ms
76,680 KB
testcase_21 AC 101 ms
77,212 KB
testcase_22 AC 100 ms
76,584 KB
testcase_23 AC 87 ms
71,396 KB
testcase_24 AC 97 ms
76,596 KB
testcase_25 AC 100 ms
76,580 KB
testcase_26 AC 93 ms
76,572 KB
testcase_27 AC 95 ms
76,776 KB
権限があれば一括ダウンロードができます

ソースコード

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