結果

問題 No.1679 マスゲーム
ユーザー 👑 rin204rin204
提出日時 2021-09-24 17:28:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 335 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 105,684 KB
最終ジャッジ日時 2023-09-18 20:17:06
合計ジャッジ時間 7,781 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,684 KB
testcase_01 AC 92 ms
71,712 KB
testcase_02 AC 93 ms
71,624 KB
testcase_03 AC 316 ms
105,568 KB
testcase_04 AC 335 ms
105,612 KB
testcase_05 AC 319 ms
105,152 KB
testcase_06 AC 315 ms
105,332 KB
testcase_07 AC 315 ms
105,684 KB
testcase_08 AC 316 ms
105,288 KB
testcase_09 AC 317 ms
105,144 KB
testcase_10 AC 313 ms
105,316 KB
testcase_11 AC 310 ms
105,136 KB
testcase_12 AC 138 ms
80,256 KB
testcase_13 AC 196 ms
88,004 KB
testcase_14 AC 308 ms
105,260 KB
testcase_15 AC 282 ms
103,520 KB
testcase_16 AC 266 ms
100,260 KB
testcase_17 AC 91 ms
71,548 KB
testcase_18 AC 215 ms
77,768 KB
testcase_19 AC 103 ms
72,164 KB
testcase_20 AC 100 ms
71,964 KB
testcase_21 AC 109 ms
76,028 KB
testcase_22 AC 105 ms
72,156 KB
testcase_23 AC 93 ms
71,544 KB
testcase_24 AC 101 ms
72,168 KB
testcase_25 AC 104 ms
72,152 KB
testcase_26 AC 100 ms
72,236 KB
testcase_27 AC 101 ms
72,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict as dd

n = int(input())
X = dd(int)
Y = dd(int)
for _ in range(n):
    a, b, t = map(int, input().split())
    if a == 0:
        X[b - t] += 1
    else:
        Y[b - t] += 1
ans = 0
for k, v in X.items():
    ans += v * Y[k]
print(ans)
0