結果

問題 No.647 明太子
ユーザー imulanimulan
提出日時 2018-03-13 23:57:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 4,500 ms
コード長 917 bytes
コンパイル時間 1,425 ms
コンパイル使用メモリ 167,484 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 09:41:37
合計ジャッジ時間 2,544 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main(){
    int n;
    cin >>n;
    vector<int> a(n),b(n);
    rep(i,n) cin >>a[i] >>b[i];

    int m;
    cin >>m;
    vector<int> x(m),y(m);
    rep(i,m) cin >>x[i] >>y[i];

    vector<int> ct(m);
    rep(i,n){
        rep(j,m) ct[j] += (x[j]<=a[i] && b[i]<=y[j]);
    }

    int M = *max_element(all(ct));
    if(M==0) cout << 0 << endl;
    else{
        rep(i,m)if(ct[i]==M) cout << i+1 << endl;
    }
    return 0;
}
0