結果

問題 No.647 明太子
ユーザー sigmanisigmani
提出日時 2022-03-08 20:28:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 138 ms / 4,500 ms
コード長 592 bytes
コンパイル時間 1,672 ms
コンパイル使用メモリ 173,832 KB
実行使用メモリ 7,700 KB
最終ジャッジ日時 2023-10-01 02:54:25
合計ジャッジ時間 3,837 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,544 KB
testcase_01 AC 2 ms
7,504 KB
testcase_02 AC 2 ms
7,512 KB
testcase_03 AC 2 ms
7,504 KB
testcase_04 AC 2 ms
7,580 KB
testcase_05 AC 2 ms
7,476 KB
testcase_06 AC 2 ms
7,428 KB
testcase_07 AC 3 ms
7,536 KB
testcase_08 AC 3 ms
7,500 KB
testcase_09 AC 4 ms
7,700 KB
testcase_10 AC 7 ms
7,456 KB
testcase_11 AC 3 ms
7,476 KB
testcase_12 AC 5 ms
7,528 KB
testcase_13 AC 11 ms
7,540 KB
testcase_14 AC 101 ms
7,620 KB
testcase_15 AC 15 ms
7,544 KB
testcase_16 AC 7 ms
7,476 KB
testcase_17 AC 129 ms
7,560 KB
testcase_18 AC 138 ms
7,552 KB
testcase_19 AC 8 ms
7,604 KB
testcase_20 AC 7 ms
7,580 KB
testcase_21 AC 4 ms
7,508 KB
testcase_22 AC 42 ms
7,612 KB
testcase_23 AC 3 ms
7,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  long long A[202020],B[202020];
  for(int i=1;i<=N;i++)cin>>A[i]>>B[i];
  int M;
  cin>>M;
  long long X[202020],Y[202020];
  for(int i=1;i<=M;i++)cin>>X[i]>>Y[i];
  map<pair<long long ,long long>,int>Map;
  for(int i=1;i<=N;i++){
    for(int j=1;j<=M;j++){
      if(X[j]<=A[i]&&Y[j]>=B[i])Map[{X[j],Y[j]}]++;
    }
  }
  int ma=0;
  for(int i=1;i<=M;i++){
    ma=max(ma,Map[{X[i],Y[i]}]);
  }
  if(ma==0)cout<<0<<endl;
  else{
  for(int i=1;i<=M;i++){
    if(Map[{X[i],Y[i]}]==ma)cout<<i<<endl;
  }
  }

  
  
  
}
0