結果

問題 No.1679 マスゲーム
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-09-14 22:09:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 682 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 23,884 KB
最終ジャッジ日時 2023-09-09 21:14:03
合計ジャッジ時間 13,172 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,512 KB
testcase_01 AC 18 ms
8,460 KB
testcase_02 AC 19 ms
8,616 KB
testcase_03 AC 673 ms
23,820 KB
testcase_04 AC 671 ms
23,728 KB
testcase_05 AC 672 ms
23,884 KB
testcase_06 AC 670 ms
23,876 KB
testcase_07 AC 671 ms
23,676 KB
testcase_08 AC 675 ms
23,844 KB
testcase_09 AC 669 ms
23,812 KB
testcase_10 AC 682 ms
23,692 KB
testcase_11 AC 669 ms
23,864 KB
testcase_12 AC 77 ms
9,936 KB
testcase_13 AC 285 ms
15,260 KB
testcase_14 AC 654 ms
23,632 KB
testcase_15 AC 568 ms
22,608 KB
testcase_16 AC 500 ms
21,580 KB
testcase_17 AC 19 ms
8,576 KB
testcase_18 AC 585 ms
9,932 KB
testcase_19 AC 20 ms
8,492 KB
testcase_20 AC 19 ms
8,644 KB
testcase_21 AC 22 ms
8,528 KB
testcase_22 AC 20 ms
8,628 KB
testcase_23 AC 18 ms
8,448 KB
testcase_24 AC 20 ms
8,552 KB
testcase_25 AC 21 ms
8,592 KB
testcase_26 AC 20 ms
8,484 KB
testcase_27 AC 21 ms
8,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
red = []
blue = []
for _ in range(N):
    a,b,t = map(int,input().split())
    if a==0:
        red.append(b-t)
    else:
        blue.append(b-t)
from collections import Counter
c = Counter(red)
c_b = Counter(blue)
ans = 0
for key,value in c.items():
    ans += value*c_b[key]
print(ans)
0