結果
問題 |
No.1679 マスゲーム
|
ユーザー |
|
提出日時 | 2021-09-19 15:49:43 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 328 bytes |
コンパイル時間 | 296 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 78,464 KB |
最終ジャッジ日時 | 2024-07-01 19:08:27 |
合計ジャッジ時間 | 4,842 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 2 RE * 21 |
ソースコード
N = int(input()) R = {} B = {} for i in range(N): c,a,b = map(int,input().split()) if c: if a+b not in R: R[a-b] = 0 R[a-b] += 1 else: if a+b not in B: B[a-b] = 0 B[a-b] += 1 ans = 0 for k,v in R.items(): if k in B: ans += R[k] * B[k] print(ans)