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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

    userId_undefined

    ༺ཌༀཉི郑则则༃ༀད༻

    倔强青铜题解仙人时空双修者维度操控者ASCII炼金师模拟·模拟练习生
    2阅读
    0回复
    1点赞
  • 题解

    #include<bits/stdc++.h> using namespace std; struct photos{ string g; double t; bool f; } a[50]; bool cmp(photos a,photos b){ if(a.f!=b.f) return a.f>b.f; else if(a.f1&&b.f1) return a.t<b.t; else return a.t>b.t; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i].g>>a[i].t; if(a[i].g=="male") a[i].f=1; else a[i].f=0; } sort(a,a+n,cmp); for(int i=0;i<n;i++) printf("%.2f ",a[i].t); }

    userId_undefined

    ༺ཌༀཉི郑则则༃ༀད༻

    倔强青铜题解仙人时空双修者维度操控者ASCII炼金师模拟·模拟练习生
    1阅读
    0回复
    1点赞
  • A30608.【结构体】【排序】合影效果

    userId_undefined

    毛奕程

    分治·分治练习生
    150阅读
    1回复
    1点赞
  • 题解

    userId_undefined

    zsy

    题解仙人时空双修者BUG超度大师秩序白银快乐小狗
    31阅读
    0回复
    0点赞
  • 不是最优解,但是ac

    #include <bits/stdc++.h> using namespace std; struct stu{ double id; }a[50],b[50]; bool cmp(stu a,stu b){ return a.id>b.id; } bool cmp2(stu a,stu b){ return a.id<b.id; } int main() { int n,ab=0,ba=0; string m; cin>>n; for(int i=0;i<n;i++){ cin>>m; if(m=="male"){ cin>>a[ab].id; ab+=1; }else { cin>>b[ba].id; ba+=1; } } sort(a,a+ab,cmp2); sort(b,b+ba,cmp); for(int i=0;i<ab;i++){ printf("%.2f",a[i].id); cout<<" "; } for(int i=0;i<ba;i++){ printf("%.2f",b[i].id); cout<<" "; } return 0; }

    userId_undefined

    捷风

    出道萌新时间刺客空间掌握者时空双修者题解仙人造物者
    8阅读
    0回复
    2点赞
  • 题解

    userId_undefined

    无敌的鳖佬仔给老爷爷猜猜被

    空间掌握者
    3阅读
    0回复
    0点赞
暂无数据

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

首页