結果
問題 |
No.1679 マスゲーム
|
ユーザー |
![]() |
提出日時 | 2021-09-11 18:29:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 212 ms / 2,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 3,465 ms |
コンパイル使用メモリ | 173,548 KB |
実行使用メモリ | 11,696 KB |
最終ジャッジ日時 | 2024-06-23 02:45:57 |
合計ジャッジ時間 | 6,559 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2021.09.11 18:29:30 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n;cin >> n; unordered_map<int,int> mp; vector<int> a(n),b(n),t(n); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i] >> t[i]; if (a[i] == 0) mp[b[i]-t[i]]++; } ll ans = 0; for (int i = 0; i < n; i++) { if (a[i] == 1) ans += mp[b[i]-t[i]]; } cout << ans << endl; return 0; }