QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#141535 | #2133. Natives | As3b_team_f_masr# | AC ✓ | 1ms | 3648kb | C++14 | 600b | 2023-08-17 16:06:08 | 2023-08-17 16:06:09 |
Judging History
answer
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
int di[] = {1, 0, -1, 0, 0, 1, -1, 1};
int dj[] = {0, 1, 0, -1, -1, 0, 1, -1};
const ll oo = 1e18, MOD = 1e9 + 7;
const int N = 5e5 + 5, M = 30005;
int t, n, m, ans, a[N];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
//freopen("output.txt", "w", stdout);
cin >> n;
for(int i = 0; i < n ;++i){
cin >> a[i];
ans += a[i];
}
sort(a,a+n);
for(int i = 0; i < (n+1)/2 ;++i) ans -= a[i];
cout << ans;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3456kb
input:
6 2 4 1 3 3 5
output:
12
result:
ok 1 number(s): "12"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
2 1 1
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
2 1000 1
output:
1000
result:
ok 1 number(s): "1000"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
5 1 1 2 2 3
output:
5
result:
ok 1 number(s): "5"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
7 1 1 1 2 2 3 3
output:
8
result:
ok 1 number(s): "8"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
500
result:
ok 1 number(s): "500"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3384kb
input:
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
output:
500000
result:
ok 1 number(s): "500000"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
1000 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...
output:
1000
result:
ok 1 number(s): "1000"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3424kb
input:
1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1...
output:
500000
result:
ok 1 number(s): "500000"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
999 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...
output:
1331
result:
ok 1 number(s): "1331"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
996 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...
output:
1328
result:
ok 1 number(s): "1328"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
10 1 1 1 1 1 1 1 1 1 1
output:
5
result:
ok 1 number(s): "5"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
10 2 2 2 1 1 2 2 2 2 1
output:
10
result:
ok 1 number(s): "10"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
10 187 736 359 818 228 252 846 857 195 521
output:
3778
result:
ok 1 number(s): "3778"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
36
result:
ok 1 number(s): "36"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
73 1 1 1 1 2 1 2 2 2 1 1 1 2 1 2 2 2 1 2 1 1 2 1 1 1 2 1 2 2 2 2 1 1 2 2 1 2 2 2 1 1 2 2 2 1 2 2 1 2 2 1 1 2 1 1 1 1 2 2 2 1 2 1 1 1 2 1 2 1 1 1 1 1
output:
70
result:
ok 1 number(s): "70"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3380kb
input:
73 138 128 426 138 281 902 599 102 540 128 283 825 662 270 193 372 590 439 596 736 763 201 109 660 26 718 755 727 395 181 283 634 279 437 303 881 623 537 627 942 612 90 414 518 799 56 810 910 854 855 546 992 394 736 725 957 354 35 596 67 933 782 225 919 964 527 746 10 590 530 162 208 563
output:
27129
result:
ok 1 number(s): "27129"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
50
result:
ok 1 number(s): "50"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
100 2 2 2 2 1 2 2 2 1 1 2 1 1 2 2 2 1 2 2 1 1 1 2 1 2 1 1 1 1 1 2 2 1 2 1 2 2 2 1 2 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 2 2 1 2 1 1 1 1 1 2 2 1 1 2 1 1 2 2 2 1 1 1 1 2 1 2 2 1 2 2 1 2 2 1 2 2 2 2 1 1 1 2
output:
98
result:
ok 1 number(s): "98"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
100 145 78 461 312 926 863 465 330 997 840 97 722 57 372 882 931 218 752 775 353 469 433 237 940 230 230 718 653 30 298 728 894 836 857 558 83 169 556 229 81 120 290 772 394 303 194 12 818 660 123 26 783 987 845 113 27 779 464 24 788 481 884 363 914 632 779 864 275 580 344 534 904 808 892 333 607 58...
output:
38525
result:
ok 1 number(s): "38525"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
499
result:
ok 1 number(s): "499"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
999 1 2 1 2 1 2 1 2 1 2 1 2 2 1 2 2 2 2 2 2 2 1 1 2 1 1 1 2 1 1 2 1 2 1 2 2 1 1 2 1 2 1 1 1 1 1 1 2 1 1 2 2 2 2 1 1 1 2 1 2 2 2 2 2 2 1 1 2 1 2 2 1 1 1 1 1 1 2 1 2 1 1 2 1 2 2 1 2 2 1 1 1 1 1 2 2 2 1 1 2 2 2 2 1 2 1 2 1 2 1 2 2 1 2 1 1 1 1 1 2 1 2 1 1 2 1 2 2 2 2 1 1 1 1 1 1 2 2 2 2 1 2 2 2 1 1 1 1 ...
output:
978
result:
ok 1 number(s): "978"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
999 40 973 861 582 714 647 273 340 747 29 509 912 115 256 130 139 917 518 278 77 490 830 725 672 913 76 942 64 755 725 869 120 953 422 24 411 381 165 463 277 93 744 945 973 197 122 837 829 470 296 228 406 607 648 78 168 122 875 663 243 425 149 323 497 346 882 428 832 31 778 619 797 606 340 234 944 8...
output:
374188
result:
ok 1 number(s): "374188"
Test #24:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
500
result:
ok 1 number(s): "500"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3428kb
input:
1000 1 2 2 1 2 1 2 1 1 2 2 1 2 1 1 2 2 2 1 1 1 1 1 2 1 1 2 1 1 1 2 1 2 2 2 2 1 1 2 2 2 1 2 1 1 2 2 1 2 1 2 1 2 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 2 1 2 2 2 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 2 2 1 1 2 1 2 1 1 2 2 2 2 2 2 1 1 2 1 1 1 1 1 2 2 2 1 2 1 2 1 1 2 1 1 1 2 2 2 1 1 2 2 1 1 1 2 2 2 1 2 2 1 1 1 2...
output:
1000
result:
ok 1 number(s): "1000"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
1000 783 658 65 804 841 25 133 857 609 625 136 485 282 828 175 706 986 516 654 393 257 963 863 325 284 759 101 321 949 291 341 113 930 566 210 619 250 614 668 323 790 495 524 202 890 54 14 584 928 970 522 744 317 57 906 749 125 263 588 951 687 638 540 469 586 900 415 648 721 17 141 411 244 180 593 6...
output:
375729
result:
ok 1 number(s): "375729"