2018北航预推免机试 T2 激活窗口

题意:

输入输出用例:

4
1 43 31 70 56
2 50 24 80 50
3 23 13 63 42
4 57 36 90 52
4
47 28
73 40
68 32
82 43
4 2 3 1

代码:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
int n;
pair<
pair<int,int>,
pair<
pair<int,int>, pair<int,int>
>
> win[1010];
int k;
int main(){
ios::sync_with_stdio(false);
cin>>n; for(int i=0; i<n; ++i)
win[i].first.first=i, cin>>win[i].first.second,
cin>>win[i].second.first.first>>win[i].second.first.second
>>win[i].second.second.first>>win[i].second.second.second;
cin>>k;
while(k--){
int x, y; cin>>x>>y;
sort(win, win+n);
for(int i=0; i<n; ++i){
if(win[i].second.first.first<=x && x<=win[i].second.second.first &&
win[i].second.first.second<=y && y<=win[i].second.second.second){
win[i].first.first=0;
for(int j=0; j<i; ++j) win[j].first.first=j+1;
break;
}
}
}
sort(win, win+n);
for(int i=0; i<n; ++i) cout<<win[i].first.second<<" ";
}

本文作者:MoonOut

本文链接:https://www.cnblogs.com/moonout/p/16456499.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   MoonOut  阅读(71)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 Sibelius: Violin Concerto in D Minor, Op. 47:III. Allegro, ma non tanto Jascha Heifetz / Chicago Symphony Orchestra
Sibelius: Violin Concerto in D Minor, Op. 47:III. Allegro, ma non tanto - Jascha Heifetz / Chicago Symphony Orchestra
00:00 / 00:00
An audio error has occurred.