C++
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct Pos{
int max_x;
int max_y;
int min_x;
int min_y;
};
vector<Pos> vec;
int N,M;
const int MAX_P = 1000001;
int arr_x[MAX_P],arr2_x[MAX_P];
int arr_y[MAX_P],arr2_y[MAX_P];
int result[100010];
int main()
{
scanf("%d",&N);
for(int i=0;i<N;i++){
int a,b,c,d,e,f;
scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
vec.push_back({max({a,c,e}),max({b,d,f}),min({a,c,e}),min({b,d,f})});
}
for(auto p: vec){
arr2_x[p.max_x]--;
arr2_x[p.min_x+1]++;
arr2_y[p.max_y]--;
arr2_y[p.min_y+1]++;
}
int level_x=0,level_y=0;
for(int i=0;i<MAX_P;i++){
level_x+=arr2_x[i];
level_y+=arr2_y[i];
arr_x[i]=level_x;
arr_y[i]=level_y;
}
scanf("%d",&M);
for(int i=0;i<M;i++){
char a,c;
int b;
scanf(" %c %c %d",&a,&c,&b);
if(a=='x'){
result[i]=arr_x[b];
}else{
result[i]=arr_y[b];
}
}
for(int i=0;i<M;i++){
printf("%d\n",result[i]);
}
return 0;
}
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 안내사항 | 관리자 | 2019.12.21 | 163 |
74 | 9663 | 관리자 | 2019.12.21 | 114 |
73 | 9345 | 관리자 | 2020.04.11 | 150 |
72 | 9019 | 관리자 | 2019.12.21 | 113 |
71 | 7569 | 관리자 | 2019.12.21 | 113 |
70 | 6987 | 관리자 | 2019.12.21 | 113 |
69 | 5842 | 관리자 | 2020.04.11 | 151 |
» | 5625 | 관리자 | 2019.12.21 | 109 |
67 | 5419 | 관리자 | 2020.04.11 | 155 |
66 | 3392 | 관리자 | 2020.04.11 | 156 |
65 | 3019 | 관리자 | 2019.12.21 | 111 |
64 | 2933 | 관리자 | 2019.12.21 | 112 |
63 | 2931 | 관리자 | 2019.12.21 | 111 |
62 | 2836 | 관리자 | 2019.12.21 | 110 |
61 | 2667 | 관리자 | 2019.12.21 | 113 |
60 | 2636 | 관리자 | 2019.12.21 | 113 |
59 | 2629 | 관리자 | 2020.04.11 | 146 |
58 | 2615 | 관리자 | 2019.12.21 | 111 |
57 | 2610 | 관리자 | 2020.04.11 | 146 |
56 | 2606 | 관리자 | 2019.12.21 | 111 |
55 | 2585 | 관리자 | 2019.12.21 | 113 |
54 | 2578 | 관리자 | 2019.12.21 | 111 |
53 | 2573 | 관리자 | 2020.04.11 | 151 |
52 | 2557 | 관리자 | 2019.12.21 | 111 |
51 | 2512 | 관리자 | 2019.12.21 | 111 |
50 | 2504 | 관리자 | 2020.04.11 | 147 |
49 | 2481 | 관리자 | 2019.12.21 | 112 |
48 | 2478 | 관리자 | 2020.04.11 | 148 |
47 | 2473 | 관리자 | 2020.04.11 | 153 |
46 | 2470 | 관리자 | 2020.04.11 | 151 |