結果

問題 No.1679 マスゲーム
ユーザー yansi819yansi819
提出日時 2024-04-22 11:43:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 4,963 ms
コンパイル使用メモリ 259,028 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-04-22 11:43:40
合計ジャッジ時間 10,875 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 315 ms
17,280 KB
testcase_04 AC 282 ms
17,152 KB
testcase_05 AC 281 ms
17,280 KB
testcase_06 AC 283 ms
17,152 KB
testcase_07 AC 308 ms
17,280 KB
testcase_08 AC 282 ms
17,152 KB
testcase_09 AC 289 ms
17,152 KB
testcase_10 AC 283 ms
17,152 KB
testcase_11 AC 306 ms
17,280 KB
testcase_12 AC 21 ms
5,376 KB
testcase_13 AC 101 ms
9,728 KB
testcase_14 AC 276 ms
17,024 KB
testcase_15 AC 238 ms
15,360 KB
testcase_16 AC 199 ms
14,080 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 165 ms
7,936 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  ll N; cin >> N;
  vector<ll> a(N), b(N), t(N);
  map<ll, ll> mp;
  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;
}
0