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 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步