Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3337 | 邓程允 | 打字比赛 | C++ | Wrong Answer | 12 MS | 284 KB | 607 | 2024-05-18 12:01:28 |
# include<iostream> # include<cstdio> # include<algorithm> using namespace std; struct Student{ int id; int S; int Zq; double zf(){ return Zq*S*0.01; } }; Student s[3001]; bool cmp(Student a,Student b){ if(a.zf()!=b.zf())return a.zf()>b.zf(); else return a.id>b.id; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ s[i].id=i; cin>>s[i].S>>s[i].Zq; } sort(s+1,s+n+1,cmp); for(int i=1;i<=n;i++){ cout<<s[i].id<<" "; printf("%.2f",s[i].zf()); cout<<endl; } return 0; }
------Input------
1212 60 40 114 83 153 81 170 93 105 27 156 21 95 57 46 14 119 10 58 29 130 61 40 80 42 9 54 29 110 12 47 11 167 80 34 82 132 84 198 16 148 60 162 61 179 7 177 96 174 41 117 82 34 44 83 36 41 45 17 3 159 45 43 15 148 16 75 89 171 17 90 7 59 26 50 35 163 93 39 88 195 91 134 21 48 63 195 34 17 39 185 100 144 23 110 66 147 62 77 96 132 37 88 9 141 85 61 6 168 5 72 39 166 45 170 86 142 91 33 32 64 34 104 86 170 81 184 88 28 22 94 14 151 36 31 55 83 3 114 36 153 20 173 81 94 16 171 33 18 5 116 4 31 80
------Answer-----
435 195.02 320 193.06 784 186.24 738 186.12 46 185.00 1143 182.28 765 182.16 270 181.09 584 179.27 41 177.45 1116 176.72 637 174.84 753 172.96 1134 172.80 542 172.48 400 172.02 944 171.99 1020 170.88 905 170.28 24 169.92 503 168.56 144 167.91 747 167.32 316 166.32 1185 165.44 318 165.17 64 161.92 1096 161.68 4 158.10 1011 155.52 851 155.31 603 155.00 349 154.80 625 154.16 621 153.90 577 152.47 1177 151.68 39 151.59 912 151.47 491 150.89 199 150.72 810 150.48 696 150.41 460 150.35 581 150.30 1145
------Your output-----
435 195.02 320 193.06 784 186.24 738 186.12 46 185.00 1143 182.28 765 182.16 270 181.09 584 179.27 41 177.45 1116 176.72 637 174.84 753 172.96 1134 172.80 542 172.48 400 172.02 944 171.99 1020 170.88 905 170.28 24 169.92 503 168.56 144 167.91 747 167.32 316 166.32 1185 165.44 318 165.17 64 161.92 1096 161.68 4 158.10 1011 155.52 851 155.31 603 155.00 349 154.80 625 154.16 621 153.90 577 152.47 1177 151.68 39 151.59 912 151.47 491 150.89 199 150.72 810 150.48 696 150.41 460 150.35 581 150.30 1145