結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2018-02-15 20:13:41 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 4,500 ms |
| コード長 | 1,093 bytes |
| 記録 | |
| コンパイル時間 | 627 ms |
| コンパイル使用メモリ | 105,508 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-14 05:40:59 |
| 合計ジャッジ時間 | 1,298 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 647.cc: No.647 明太子 - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int MAX_N = 10000;
const int MAX_M = 1000;
/* typedef */
/* global variables */
int as[MAX_N], bs[MAX_N], cs[MAX_M];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d%d", &as[i], &bs[i]);
int m;
scanf("%d", &m);
int maxcnt = 0;
for (int i = 0; i < m; i++) {
int xi, yi;
scanf("%d%d", &xi, &yi);
int cnt = 0;
for (int j = 0; j < n; j++)
if (xi <= as[j] && yi >= bs[j]) cnt++;
cs[i] = cnt;
if (maxcnt < cnt) maxcnt = cnt;
}
if (maxcnt == 0) puts("0");
else
for (int i = 0; i < m; i++)
if (cs[i] == maxcnt) printf("%d\n", i + 1);
return 0;
}
tnakao0123