Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117333 万隽宇 成绩排序 C++ Wrong Answer 1 MS 288 KB 827 2025-04-17 18:49:18

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<algorithm> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct cjd{ string m; int J; }; bool c(cjd x,cjd y){ if(x.J<x.J){ return true; } else if(x.J==y.J){ if(x.m>y.m){ return true; } } return false; } int main(){ int n; cjd a[301]; cin>>n; for(int i=0;i<n;i++){ cin>>a[i].m>>a[i].J; } for(int i=0;i<n-1;i++){ for(int j=0;j<n-1-i;j++){ if(c(a[j],a[j+1])) swap(a[j],a[j+1]); } } for(int i=0;i<n;i++){ cout<<a[i].m<<' '<<a[i].J<<endl; } return 0; }


Run Info:

------Input------
8 bHTYA 48 tYSm 4 jp 13 dXfWE 90 AfEViE 3 VhUh 89 BDJwojFN 29 azQZ 85
------Answer-----
dXfWE 90 VhUh 89 azQZ 85 bHTYA 48 BDJwojFN 29 jp 13 tYSm 4 AfEViE 3
------Your output-----
bHTYA 48 tYSm 4 jp 13 dXfWE 90 AfEViE 3 VhUh 89 BDJwojFN 29 azQZ 85