結果

問題 No.1679 マスゲーム
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-29 18:22:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 685 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 22,780 KB
最終ジャッジ日時 2023-08-30 18:10:49
合計ジャッジ時間 13,054 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,604 KB
testcase_01 AC 17 ms
8,456 KB
testcase_02 AC 17 ms
8,464 KB
testcase_03 AC 674 ms
22,716 KB
testcase_04 AC 685 ms
22,672 KB
testcase_05 AC 677 ms
22,628 KB
testcase_06 AC 672 ms
22,780 KB
testcase_07 AC 681 ms
22,692 KB
testcase_08 AC 685 ms
22,744 KB
testcase_09 AC 681 ms
22,568 KB
testcase_10 AC 684 ms
22,644 KB
testcase_11 AC 666 ms
22,640 KB
testcase_12 AC 76 ms
9,752 KB
testcase_13 AC 286 ms
14,960 KB
testcase_14 AC 672 ms
22,744 KB
testcase_15 AC 585 ms
21,604 KB
testcase_16 AC 507 ms
20,984 KB
testcase_17 AC 17 ms
8,496 KB
testcase_18 AC 607 ms
9,152 KB
testcase_19 AC 20 ms
8,424 KB
testcase_20 AC 18 ms
8,540 KB
testcase_21 AC 20 ms
8,616 KB
testcase_22 AC 20 ms
8,616 KB
testcase_23 AC 17 ms
8,524 KB
testcase_24 AC 18 ms
8,596 KB
testcase_25 AC 19 ms
8,572 KB
testcase_26 AC 18 ms
8,600 KB
testcase_27 AC 20 ms
8,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n=int(input())
red=defaultdict(int)
blue=[]
for _ in range(n):
    a,b,t=map(int,input().split())
    if a==0:
        red[b-t]+=1
    else:
        blue.append(b-t)
ans=0
for i in blue:
    ans+=red[i]
print(ans)
0