結果

問題 No.1679 マスゲーム
ユーザー otoshigootoshigo
提出日時 2021-09-17 18:11:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,056 bytes
コンパイル時間 4,523 ms
コンパイル使用メモリ 259,012 KB
実行使用メモリ 6,488 KB
最終ジャッジ日時 2023-09-12 04:26:57
合計ジャッジ時間 8,154 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,344 KB
testcase_01 AC 4 ms
6,324 KB
testcase_02 AC 4 ms
6,232 KB
testcase_03 AC 148 ms
6,196 KB
testcase_04 AC 147 ms
6,296 KB
testcase_05 AC 149 ms
6,248 KB
testcase_06 AC 147 ms
6,488 KB
testcase_07 AC 146 ms
6,280 KB
testcase_08 AC 148 ms
6,332 KB
testcase_09 AC 147 ms
6,236 KB
testcase_10 AC 146 ms
6,464 KB
testcase_11 AC 148 ms
6,344 KB
testcase_12 AC 16 ms
6,252 KB
testcase_13 AC 62 ms
6,196 KB
testcase_14 AC 146 ms
6,200 KB
testcase_15 AC 125 ms
6,300 KB
testcase_16 AC 110 ms
6,240 KB
testcase_17 AC 5 ms
6,192 KB
testcase_18 WA -
testcase_19 AC 4 ms
6,352 KB
testcase_20 AC 4 ms
6,228 KB
testcase_21 AC 4 ms
6,248 KB
testcase_22 AC 5 ms
6,240 KB
testcase_23 AC 4 ms
6,180 KB
testcase_24 AC 5 ms
6,320 KB
testcase_25 AC 5 ms
6,184 KB
testcase_26 AC 4 ms
6,188 KB
testcase_27 AC 5 ms
6,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;  using vvi = vector<vi>;
using vl = vector<ll>;   using vvl = vector<vl>;
using vb = vector<bool>; using vvb = vector<vb>;
using vm = vector<mint>; using vvm = vector<vm>;
using vpi = vector<pii>; using vvpi = vector<vpi>;
using vpl = vector<pll>; using vvpl = vector<vpl>;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
#define rep(i,m,n) for (int i = m; i < (int)(n); i++)
#define rrep(i,m,n) for (int i = m; i > (int)(n); i--)

int main(){
    int n; cin >> n;
    vi A(4e5+10),B(4e5+10);
    rep(i,0,n){
        int a,b,t; cin >> a >> b >> t;
        if (a == 1){
            A[t-b+2e5]++;
        }
        if (a == 0){
            B[t-b+2e5]++;
        }
    }
    ll ans = 0;
    rep(i,0,4e5+10){
        ans += A[i]*B[i];
    }
    cout << ans << endl;
}
0