結果
| 問題 |
No.1679 マスゲーム
|
| ユーザー |
|
| 提出日時 | 2023-04-20 23:15:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 409 bytes |
| コンパイル時間 | 1,686 ms |
| コンパイル使用メモリ | 167,232 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2024-10-15 17:50:59 |
| 合計ジャッジ時間 | 5,167 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll ans = 0;
int mx = 200000, n;
cin >> n;
vector<array<int, 2>> cnt(2 * mx + 1);
for(int i = 0; i < n; i++){
int c, b, t;
cin >> c >> b >> t;
ans += cnt[b - t + mx][c ^ 1];
cnt[b - t + mx][c]++;
}
cout << ans << '\n';
}