acgo题库
  • 首页
  • 题库
  • 学习
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情提交记录(0)
  • 题解

    #include<bits/stdc++.h> using namespace std; struct node{ int y, m; }; bool cmp(node x, node z){ if(x.y==z.y){ return x.m<z.m; } return x.y<z.y; } int main(){ int n; cin>>n; vector<node> a(n); for(int i=0;i<n;i++){ cin>>a[i].y>>a[i].m; } sort(a.begin(),a.end(),cmp); for(int i=0;i<n;i++){ cout<<a[i].y<<" "<<a[i].m<<endl; } return 0; }

    userId_undefined

    ༺ཌༀ凌驾于你之上ༀད༻

    时空双修者题解仙人数组·数组操作员快乐小狗秩序白银字符串·魔法使
    12阅读
    1回复
    1点赞
  • 欢乐赛56 | T4

    基础结构体+判断条件,个人认为应该放T3

    userId_undefined

    i闪天天开心

    8月全勤卷王出道萌新时空双修者秩序白银
    1阅读
    0回复
    1点赞
  • 万能的map

    #include<iostream> #include<map> using namespace std; struct node{ int d,t; bool operator<(const node &o) const{ if(d != o.d) return d < o.d; return t < o.t; } }; map<node,int> mp; int n; int main(){ cin >> n; while(n--){ int x,y; cin >> x >> y; if(mp.count({x,y})) mp[{x,y}]++; else mp[{x,y}] = 1; } for(auto &it : mp){ while(it.second--) cout << it.first.d << " " << it.first.t << endl; } return 0; }

    userId_undefined

    137****0822

    时间刺客空间掌握者时空双修者模拟·模拟练习生
    7阅读
    0回复
    0点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页