結果

問題 No.647 明太子
ユーザー mytkytmytkyt
提出日時 2018-03-29 16:45:06
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 680 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 52,544 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-08 06:34:46
合計ジャッジ時間 4,122 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>

using namespace std;

int main(){
  int N,M,temp=0,ans;
  cin >> N;
  int member[2][N];
  for(int i=0;i<N; i++){
    cin >> member[i][0] >> member[i][1];
  }
  cin >> M;
  int price[M],hot[M],mentaiko[M];
  for(int i=0;i<M; i++){
    cin >> price[i] >> hot[i];
  }

  for(int j=0;j<M; j++){
    mentaiko[j]=0;
    for(int i=0; i<N; i++){
      if(price[j]<=member[i][0] && hot[j]>=member[i][1]){
        mentaiko[j]++;
      }
    }
    if(temp < mentaiko[j]){
      temp = mentaiko[j];
    }
  }
  if(temp==0){
    cout << 0 << endl;
  }else{
    for(int i=0;i<M;i++){
      if(mentaiko[i]==temp){
        cout << i+1 << endl;
      }
    }
  }
  return 0;
}
0