結果
| 問題 | No.1679 マスゲーム |
| ユーザー |
hiragn
|
| 提出日時 | 2022-12-03 23:22:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 769 ms / 2,000 ms |
| コード長 | 404 bytes |
| 記録 | |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 32,144 KB |
| 最終ジャッジ日時 | 2024-10-11 02:16:29 |
| 合計ジャッジ時間 | 12,583 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
from collections import defaultdict
def main():
n = int(input())
red = defaultdict(int)
blue = defaultdict(int)
for _ in range(n):
a, b, t = map(int, input().split())
if a == 0:
red[b - t] += 1
else:
blue[b - t] += 1
ans = sum([red[x] * blue[x] for x in set(red) & set(blue)])
print(ans)
if __name__ == "__main__":
main()
hiragn