acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(37)讨论(6)提交记录(2333)
  • 帮我改改答辩代码呗

    byd

    userId_undefined

    094com普尼

    倔强青铜
    54阅读
    2回复
    2点赞
  • 不知道为什么是RE

    #include<iostream> #include<algorithm> using namespace std; struct stu{ string name; int id; double y,x,e,sum; }a[105]; bool cmp(stu x,stu y){ if(x.sum != y.sum) return x.sum> y.sum; else if(x.y!=y.y) return x.y>y.y; else return x.id<y.id; } int main() { int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i].name>>a[i].y>>a[i].x>>a[i].e; a[i].id=i; a[i].sum=a[i].y+a[i].x+a[i].e; }

    userId_undefined

    明日香

    倔强青铜
    37阅读
    3回复
    0点赞
  • 所以为什么第5、8、10测试点不对

    三个测试点趋势了(doge),大佬帮忙改一改(功德+1145141919810)

    userId_undefined

    ACOI

    倔强青铜
    38阅读
    0回复
    0点赞
  • 就发定义的结构体,和判断函数

    userId_undefined

    回来看看

    倔强青铜
    18阅读
    0回复
    1点赞
  • 为啥第十个老是过不了

    /#include<bits/stdc++.h> using namespace std; struct stu{ char name[200]; long long id; long long a,b,c,s; } student[100000]; bool cmp(stu a,stu b){ if(a.s!=b.s){ return a.s>b.s; } if(a.a!=b.a){ return a.a>b.a; } return a.id<b.id; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>student[i].name>>student[i].a>>student[i].b>>student[i].c; student[i].id=i; student[i].s=student[i].a+student[i].b+student[i].c; } sort(student****tudent+n+1,cmp); for(int i=1;i<=n;i++){ cout<<student[i].name<<" "<<student[i].s<<endl; } return 0; }/

    userId_undefined

    月落乌啼

    倔强青铜
    12阅读
    1回复
    0点赞
  • 有点坑

    这题不能用快排(需要稳定的排序算法)

    userId_undefined

    A(Hello world!)

    秩序白银
    6阅读
    1回复
    0点赞
首页