結果

問題 No.647 明太子
ユーザー gotutiyangotutiyan
提出日時 2018-02-09 22:53:03
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 39 ms / 4,500 ms
コード長 1,198 bytes
コンパイル時間 775 ms
コンパイル使用メモリ 85,616 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 09:24:58
合計ジャッジ時間 1,940 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <map>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e933
#define INFL 1e18
#define MOD 1e9+7
#define pb push_back
#define MP make_pair
typedef long long ll;
typedef std::pair<int,int> pii;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main() {
    int n;cin>>n;
    vector<pair<int,int>> v(n);
    rep(i,0,n)cin>>v[i].fi>>v[i].se;
    int m;cin>>m;
    vector<pair<int,int>> vv(m);
    rep(i,0,m)cin>>vv[i].fi>>vv[i].se;
    
    vector<int> ct(m,0);
    rep(j,0,n){
        rep(i,0,m){
            if(vv[i].fi<=v[j].fi&&v[j].se<=vv[i].se)ct[i]++;
        }
    }
    
    int ans=0;
    bool f=true;
    rep(i,0,m)ans=max(ans,ct[i]);
    if(!ans){
        cout<<ans<<endl;
        return 0;
    }
    rep(i,0,m){
        if(ans==ct[i]){
            cout<<i+1<<endl;
            f=false;   
        }
    }
    return 0;
}
0