#include<iostream> #include<stdio.h> #include<string> #include<cstring> #include<algorithm> #include<vector> #include<queue> #include<map> #define INF 0x3f3f3f using namespace std; typedef struct node { char n[25]; float h; }node; bool cmp_q(node x, node y) { if(y.h==x.h) { if(strcmp(x.n,y.n)<0) return 1; else return 0; } else return x.h<y.h; } int main() { node stu[205]; int n,i=0; int ant; while(~scanf("%d",&n)) { memset(stu,0,sizeof(stu)); i=0; while(n--) { scanf("%s",stu[i].n); scanf("%f",&stu[i].h); i++; } sort(stu,stu+i,cmp_q); for(int j=0;j<i;j++) { if(strcmp(stu[j].n,"GodChong")==0) { ant=j+1; break; } } printf("%d %d\n",ant/25+1,ant%25); } } |
Double click to view unformatted code.