結果

問題 No.647 明太子
ユーザー Kutimoti_TKutimoti_T
提出日時 2018-06-01 20:42:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 2,876 ms
コンパイル使用メモリ 148,172 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 21:25:16
合計ジャッジ時間 2,720 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 4 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 3 ms
4,380 KB
testcase_13 AC 5 ms
4,376 KB
testcase_14 AC 33 ms
4,384 KB
testcase_15 AC 6 ms
4,380 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 43 ms
4,376 KB
testcase_18 AC 45 ms
4,376 KB
testcase_19 AC 9 ms
4,376 KB
testcase_20 AC 9 ms
4,380 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)

int N;
int M;
vector<i64> X,Y;
vector<i64> A,B;

int main(){
  cin >> N;
  A.resize(N);
  B.resize(N);
  rep(i,0,N - 1){
    cin >> A[i] >> B[i];
  }
  cin >> M;
  X.resize(M);
  Y.resize(M);
  rep(i,0,M - 1){
    cin >> X[i] >> Y[i];
  }
  vector<int> ans(M,0);
  rep(i,0,N - 1){
    rep(j,0,M - 1){
      if(A[i] >= X[j] && B[i] <= Y[j])
        ans[j]++;
    }
  }

  int a = max_element(ans.begin(),ans.end()) - ans.begin();
  if(ans[a] == 0){
    cout << 0 << endl;
  }
  else
  {
    cout << a + 1 << endl;
  }
}
0