ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#206267 | #1080. 分数线划定 | kevinwww188 | 100 | 16ms | 1252kb | C++11 | 613b | 2024-07-21 18:00:00 | 2024-07-21 20:01:47 |
answer
#include<bits/stdc++.h>
using namespace std;
struct stu{
int num,score;
};
bool cmp(stu a,stu b){
if(a.score!=b.score) return a.score<b.score;
else return a.num>b.num;
}
bool cmp1(stu a,stu b){
return a.score>b.score;
}
int main() {
int n,m;
cin>>n>>m;
stu a[n];
int x=m*1.5,cnt=n;
for(int i=0;i<n;i++) cin>>a[i].num>>a[i].score;
sort(a,a+n,cmp1);
int y=a[x-1].score;
for(int i=0;i<n;i++){
if(a[i].score<y){
cnt--;
a[i].score=0;
}
}
cout<<y<<' '<<cnt<<endl;
sort(a,a+n,cmp);
for(int i=n-1;i>n-cnt-1;i--) cout<<a[i].num<<' '<<a[i].score<<endl;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 5ms
memory: 1252kb
input:
5000 1548 9703 97 4681 54 1011 83 4922 79 7792 99 1429 76 5852 90 5672 59 8531 60 5511 84 6120 87 97...
output:
76 2390 1064 99 1079 99 1098 99 1105 99 1110 99 1275 99 1282 99 1310 99 1498 99 1662 99 1877 99 1939...
result:
ok 2391 lines
Test #2:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
99 48 3080 87 1232 75 1768 67 7798 92 6343 74 1134 73 4782 61 3743 54 1377 79 5197 89 2059 56 3131 6...
output:
65 78 1443 99 2809 99 1746 98 4065 97 2797 96 6045 96 7319 96 9230 95 7937 94 2489 92 3205 92 7798 9...
result:
ok 79 lines
Test #3:
score: 10
Accepted
time: 0ms
memory: 1216kb
input:
80 7 7868 94 2542 85 6021 98 7131 83 1740 76 2848 66 7492 61 9693 64 3893 87 1484 91 2015 62 4786 97...
output:
92 11 4409 99 6021 98 4786 97 7148 97 6598 96 5601 95 7868 94 3353 93 7342 93 4607 92 5451 92
result:
ok 12 lines
Test #4:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
92 28 4523 62 5973 57 8309 58 6808 68 8928 80 3174 62 7609 65 3957 52 2836 71 1951 62 7794 51 1411 8...
output:
76 42 2818 99 5800 99 3706 98 1330 97 1352 97 3178 97 3740 97 4511 97 5357 97 3386 96 1081 95 5659 9...
result:
ok 43 lines
Test #5:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
57 22 5387 58 4067 72 5770 78 5027 59 3957 65 1790 92 8744 53 3487 79 7336 62 1930 69 9259 57 7485 8...
output:
72 34 2949 99 4746 98 4957 98 7659 97 9720 97 5224 96 6960 95 8711 95 5449 94 7706 94 8661 94 1790 9...
result:
ok 35 lines
Test #6:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
54 24 5339 50 3108 65 6558 72 9587 67 8442 98 5689 79 3352 58 6652 57 2620 52 5208 71 6919 96 3688 8...
output:
66 36 8442 98 9041 98 6919 96 9932 94 8110 93 2654 91 4329 91 6646 91 2652 90 1077 89 1888 84 5765 8...
result:
ok 37 lines
Test #7:
score: 10
Accepted
time: 0ms
memory: 1228kb
input:
2299 471 8085 56 6063 52 6755 64 7818 68 7855 51 6178 71 2108 51 9822 61 9405 60 7351 55 6933 87 227...
output:
84 724 1051 99 1112 99 1114 99 1288 99 1547 99 1606 99 1813 99 1964 99 2031 99 2166 99 2330 99 2510 ...
result:
ok 725 lines
Test #8:
score: 10
Accepted
time: 0ms
memory: 1236kb
input:
3616 1052 3955 97 2595 55 7287 74 3912 91 4181 66 9515 59 6222 79 8148 75 8635 92 2204 80 4444 94 13...
output:
78 1634 1183 99 1305 99 1348 99 1372 99 1419 99 1557 99 1613 99 1759 99 1929 99 1956 99 2097 99 2253...
result:
ok 1635 lines
Test #9:
score: 10
Accepted
time: 6ms
memory: 1240kb
input:
4111 467 1884 82 9299 83 7034 61 6247 53 9375 98 4382 61 2331 72 2119 90 8344 67 8724 67 1193 92 467...
output:
91 737 1029 99 1669 99 2025 99 2035 99 2084 99 2107 99 2131 99 2362 99 2392 99 2521 99 2667 99 2787 ...
result:
ok 738 lines
Test #10:
score: 10
Accepted
time: 5ms
memory: 1252kb
input:
5000 354 9979 66 2649 64 3718 89 9779 59 4695 65 3553 68 7987 78 4781 53 6017 75 3550 77 5016 71 783...
output:
94 581 1124 99 1236 99 1402 99 1526 99 1697 99 1891 99 1896 99 1915 99 1983 99 2421 99 2438 99 2598 ...
result:
ok 582 lines