Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
140160 | EUCLID | 双关键字排序 | C++ | 通过 | 100 | 471 MS | 1040 KB | 386 | 2024-03-29 13:53:51 |
#include <bits/stdc++.h> using namespace std; struct qwq{ int a,b; void input(){ cin>>a>>b; } void output(){ cout<<a<<" "<<b<<endl; } bool operator<(const qwq o)const{ if(a!=o.a)return a<o.a; return b<o.b; } }a[1000005]; int main(){ int n; cin>>n; for(int i=0;i<n;i++)a[i].input(); sort(a,a+n); for(int i=0;i<n;i++)a[i].output(); return 0; }