# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
403391 |
2021-05-13T06:39:31 Z |
zaneyu |
None (KOI16_laser) |
C++14 |
|
87 ms |
65540 KB |
/*input
2
0 0
1 1
2 4
3 9
-1 1
-2 4
*/
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define f first
#define s second
#define sz(x) (int)x.size()
const int maxn=2e3+5;
pii ans[maxn];
int main(){
ios::sync_with_stdio(false),cin.tie(0);
int n;
cin>>n;
vector<pii> v;
priority_queue<pii> less;
priority_queue<pii,vector<pii>,greater<pii>> more;
REP(i,n){
int x,y;
cin>>x>>y;
v.pb({x,i});
}
REP(i,2*n){
int x,y;
cin>>x>>y;
more.push({x,i});
}
sort(ALL(v));
for(auto &x:v){
while(more.top()<=x){
less.push(more.top());
more.pop();
}
if(!sz(less)){
ans[x.s].f=more.top().s;
more.pop();
}
else{
ans[x.s].f=less.top().s;
less.pop();
}
if(!sz(less)){
ans[x.s].s=more.top().s;
more.pop();
}
else{
ans[x.s].s=less.top().s;
less.pop();
}
}
REP(i,n) cout<<ans[i].f+1<<' '<<ans[i].s+1<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
87 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |