-
Notifications
You must be signed in to change notification settings - Fork 0
/
201403-2-窗口.cpp
65 lines (59 loc) · 1.02 KB
/
201403-2-窗口.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# include <iostream>
# include <list>
# include <vector>
using namespace std;
int N,M,num;
list<vector<int>> mylist;
vector<vector<int>> coords;
vector<int> tmp;
void myInput(){
cin >> N >> M;
for(auto i=0;i<N+M;++i){
tmp.clear();
if(i<N){
for(auto j=0;j<4;++j){
cin >> num;
tmp.push_back(num);
}
tmp.push_back(i+1);
mylist.push_front(tmp);
}
else{
for(auto j=0;j<2;++j){
cin >> num;
tmp.push_back(num);
}
coords.push_back(tmp);
}
}
return;
}
bool isInner(vector<int> crd,vector<int> window){
if(crd[0]>=window[0] && crd[0]<=window[2] &&\
crd[1]>=window[1] && crd[1]<=window[3]){
return true;
}
else{
return false;
}
}
int main(){
myInput();
for(auto crd:coords){
bool flag=false;
for(auto it=mylist.begin();it!=mylist.end();++it){
vector<int> window=*it;
if(isInner(crd,window)){
flag=true;
cout << window[4] << endl;
mylist.push_front(window);
mylist.erase(it);
break;
}
}
if(!flag){
cout << "IGNORED" << endl;
}
}
return 0;
}