結果

問題 No.1679 マスゲーム
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-09-11 18:29:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 511 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 172,008 KB
実行使用メモリ 11,612 KB
最終ジャッジ日時 2023-09-05 06:23:54
合計ジャッジ時間 6,419 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 192 ms
11,416 KB
testcase_04 AC 189 ms
11,460 KB
testcase_05 AC 193 ms
11,296 KB
testcase_06 AC 194 ms
11,412 KB
testcase_07 AC 195 ms
11,288 KB
testcase_08 AC 195 ms
11,336 KB
testcase_09 AC 192 ms
11,336 KB
testcase_10 AC 191 ms
11,488 KB
testcase_11 AC 197 ms
11,412 KB
testcase_12 AC 17 ms
4,380 KB
testcase_13 AC 79 ms
6,812 KB
testcase_14 AC 200 ms
11,612 KB
testcase_15 AC 164 ms
10,476 KB
testcase_16 AC 145 ms
9,772 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 149 ms
5,548 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @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;
}
0