結果

問題 No.1679 マスゲーム
ユーザー Nzt3Nzt3
提出日時 2022-10-05 02:39:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 1,934 ms
コンパイル使用メモリ 202,904 KB
実行使用メモリ 6,556 KB
最終ジャッジ日時 2023-08-29 01:50:47
合計ジャッジ時間 5,750 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,420 KB
testcase_01 AC 3 ms
5,372 KB
testcase_02 AC 3 ms
5,420 KB
testcase_03 AC 56 ms
6,512 KB
testcase_04 AC 56 ms
6,344 KB
testcase_05 AC 55 ms
6,492 KB
testcase_06 AC 55 ms
6,452 KB
testcase_07 AC 55 ms
6,556 KB
testcase_08 AC 55 ms
6,388 KB
testcase_09 AC 55 ms
6,372 KB
testcase_10 AC 55 ms
6,384 KB
testcase_11 AC 55 ms
6,512 KB
testcase_12 AC 7 ms
5,668 KB
testcase_13 AC 23 ms
5,952 KB
testcase_14 AC 56 ms
6,340 KB
testcase_15 AC 47 ms
6,392 KB
testcase_16 AC 41 ms
6,504 KB
testcase_17 AC 2 ms
5,356 KB
testcase_18 AC 50 ms
6,456 KB
testcase_19 AC 3 ms
5,388 KB
testcase_20 AC 3 ms
5,424 KB
testcase_21 AC 3 ms
5,388 KB
testcase_22 AC 4 ms
5,480 KB
testcase_23 AC 3 ms
5,520 KB
testcase_24 AC 3 ms
5,480 KB
testcase_25 AC 3 ms
5,472 KB
testcase_26 AC 3 ms
5,424 KB
testcase_27 AC 3 ms
5,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin>>N;
  vector<array<int,2>>Y;
  vector<int>T(600005);
  for(int i=0;i<N;i++){
    int a;
    cin>>a;
    if(a==0){
      int b,c;
      cin>>b>>c;
      ++T[c-b+2e5];
    }else{
      int b,c;
      cin>>b>>c;
      Y.push_back({b,c});
    }
  }
  long long ans=0;
  for(auto i:Y){
    ans+=T[i[1]-i[0]+2e5];
  }
  cout<<ans<<'\n';
}
0