結果

問題 No.1679 マスゲーム
ユーザー You_sakuYou_saku
提出日時 2021-09-11 20:53:08
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 901 ms
コンパイル使用メモリ 91,260 KB
実行使用メモリ 7,640 KB
最終ジャッジ日時 2023-09-05 09:53:50
合計ジャッジ時間 4,969 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 204 ms
7,612 KB
testcase_04 AC 202 ms
7,436 KB
testcase_05 AC 205 ms
7,640 KB
testcase_06 AC 204 ms
7,456 KB
testcase_07 AC 204 ms
7,520 KB
testcase_08 AC 202 ms
7,416 KB
testcase_09 AC 202 ms
7,560 KB
testcase_10 AC 208 ms
7,432 KB
testcase_11 AC 205 ms
7,392 KB
testcase_12 AC 17 ms
4,380 KB
testcase_13 AC 80 ms
5,104 KB
testcase_14 AC 215 ms
7,568 KB
testcase_15 AC 171 ms
7,076 KB
testcase_16 AC 145 ms
6,420 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 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 1 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include <ios>
#include <iomanip> 
#include<algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    int ans = 0;
    map<int,int>red;
    vector<int>blue;
    for(int i = 0; i < n; i++){
        long long a,b,t;
        cin >> a >> b >> t;
        if(a==0){
            red[b-t]++;
        }else{
            blue.push_back(b-t);
        }
    }

    for(auto x: blue){
        if(red.count(x)){
            ans += red[x];
        }
    }
    cout << ans << endl;
    return 0;
}
0