結果

問題 No.647 明太子
ユーザー squidsquid
提出日時 2018-02-09 22:34:15
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 1,391 ms
コンパイル使用メモリ 144,240 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-27 02:13:59
合計ジャッジ時間 2,945 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

//constant
const long long int inf = 1<<30;
const int N = 1e4+1;
const int M = 1e3+1;

//variable
int cnt_ment[M];
int a[N],b[N];
int x[M],y[M];

//function


int main()
{
    int n,m;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>a[i]>>b[i];
    }
    cin>>m;
    for(int i=0; i<m; i++){
        cin>>x[i]>>y[i];
    }

    for(int i=0; i<N; i++){
        for(int j=0; j<M; j++){
            if(a[i]>=x[j]&&b[i]<=y[j]){
                cnt_ment[j]++;
            }
        }
    }
    int ans=distance(cnt_ment,max_element(cnt_ment,&cnt_ment[m]));
    cout<<ans+1<<endl;

    /*for(int i=0; i<m; i++){
        cout<<cnt_ment[i]<<' ';
    }*/
    return 0;
}
0