Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
191015 赵德明 双关键字排序 C++ 通过 100 39 MS 1040 KB 379 2025-02-15 14:29:38

Tests(5/5):


#include<bits/stdc++.h> using namespace std; struct dui{ int a,b; bool operator < (const dui &o)const{ if(a!=o.a) return a<o.a; else return b<o.b; } }m[1000005]; int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d%d",&m[i].a,&m[i].b); } sort(m+1,m+n+1); for(int i=1;i<=n;i++){ printf("%d %d\n",m[i].a,m[i].b); } return 0; }


测评信息: