提交时间:2024-08-19 17:54:27
运行 ID: 167797
#include<bits/stdc++.h> using namespace std; priority_queue<long long,vector<long long>,greater<long long> >q; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ long long c,b; cin>>c>>b; q.push((c*100000)+b); } for(int i=0;i<n;i++){ long long u=q.top(); long long b=u%100000; u-=b; long long c=u/100000; cout<<c<<" "<<b<<endl; q.pop(); } return 0; }