acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 资讯
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • C++代码

    #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; struct A { string name; int b,c; }a[200010]; bool cmp( A &x,A &y) { if( x.b != y.b ) return x.b > y.b; if( x.c != y.c ) return x.c < y.c; return x.name > y.name; } int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for( int i = 0; i < n; i++ ) cin >> a[i].name >> a[i].b >> a[i].c; sort( a, a + n, cmp ); for( int i = 0; i < n; i++ ) cout << a[i].name << endl; return 0; }

    userId_undefined
    𓆩༒༺𓂀孙晨睿𓂀༻༒𓆪
    字符串·魔法使ASCII炼金师快排信徒→排序之神冒泡宗师→排序元老倔强青铜
    2阅读
    1回复
    0点赞
  • 高质量题解|A83229.比赛排名

    解题思路 结构体中有 3 个元素,分别是名字(string)、AC 数量(int)以及罚时(int) 排序规则题目中也给了:先假设解决题目数量不一样,按从大到小的方法排序;如果一样,则假设罚时不一样,按从低到高的方法排序(从小到大);如果以上都不符合,则按字典序对名称进行升序排序 代码 时间复杂度 O(n log n)

    userId_undefined
    ༺ཌༀཉི༒SSCD刹༒༃ༀད༻
    3月全勤卷王题解仙人时空双修者秩序白银BUG超度大师GESP1级
    49阅读
    0回复
    2点赞
  • 题解

    27行代码带你解决

    userId_undefined
    小爬虫~
    模拟·模拟练习生8月全勤卷王枚举·枚举小能手倔强青铜多键裁决者维度操控者
    3阅读
    1回复
    1点赞
暂无数据

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

首页