結果

問題 No.1679 マスゲーム
ユーザー ygd.ygd.
提出日時 2021-09-13 22:10:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 1,634 ms
コンパイル使用メモリ 86,644 KB
実行使用メモリ 102,964 KB
最終ジャッジ日時 2023-09-08 06:04:09
合計ジャッジ時間 7,257 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,660 KB
testcase_01 AC 89 ms
71,408 KB
testcase_02 AC 86 ms
71,348 KB
testcase_03 AC 230 ms
98,660 KB
testcase_04 AC 216 ms
102,744 KB
testcase_05 AC 215 ms
102,836 KB
testcase_06 AC 212 ms
102,748 KB
testcase_07 AC 218 ms
102,816 KB
testcase_08 AC 218 ms
102,820 KB
testcase_09 AC 216 ms
102,664 KB
testcase_10 AC 214 ms
102,784 KB
testcase_11 AC 228 ms
98,680 KB
testcase_12 AC 112 ms
78,772 KB
testcase_13 AC 146 ms
89,296 KB
testcase_14 AC 217 ms
102,964 KB
testcase_15 AC 205 ms
100,652 KB
testcase_16 AC 189 ms
97,108 KB
testcase_17 AC 87 ms
71,636 KB
testcase_18 AC 131 ms
77,096 KB
testcase_19 AC 90 ms
71,512 KB
testcase_20 AC 88 ms
71,764 KB
testcase_21 AC 94 ms
72,096 KB
testcase_22 AC 91 ms
72,188 KB
testcase_23 AC 88 ms
71,844 KB
testcase_24 AC 88 ms
71,716 KB
testcase_25 AC 92 ms
72,208 KB
testcase_26 AC 90 ms
71,740 KB
testcase_27 AC 89 ms
71,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline
from collections import defaultdict 


def main():
    N = int(input())
    dicx = defaultdict(int)
    dicy = defaultdict(int)
    for _ in range(N):
        a,b,t = map(int,input().split())
        v = t - b
        if a == 0:
            dicx[v] += 1
        else:
            dicy[v] += 1
    ans = 0
    for z in dicx:
        ans += dicx[z]*dicy[z]
    print(ans)

if __name__ == '__main__':
    main()
0