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

    ༺ཌༀ等我买把宗师ༀད༻

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

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

    userId_undefined

    i闪天天开心

    出道萌新8月全勤卷王秩序白银时空双修者模拟·模拟练习生快乐小狗
    9阅读
    0回复
    1点赞
  • 不会多维数组?向我看齐!

    userId_undefined

    ☆𝑬-𝑳𝑨𝑹☆

    7月全勤卷王出道萌新冒泡宗师→排序元老模拟·模拟练习生循环·循环打卡人字符串·魔法使
    5阅读
    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

    老杨

    9月全勤卷王时间刺客空间掌握者时空双修者秩序白银快乐小狗
    13阅读
    0回复
    0点赞
  • 题解

    题目知识点虽然是多维数组,但个人感觉还是用结构体更简单

    userId_undefined

    LS_YZY

    出道萌新题解仙人倔强青铜时空双修者模拟·模拟练习生快乐小狗
    0阅读
    0回复
    0点赞
暂无数据

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

首页