QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#60448 | #2133. Natives | Sa3tElSefr# | AC ✓ | 2ms | 3468kb | C++23 | 1.5kb | 2022-11-04 19:59:27 | 2022-11-04 19:59:29 |
Judging History
answer
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
//#pragma GCC optimize("O3")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#define ll long long
#define ld double
using namespace std;
const int N = 1e4 + 5, lg = 19, mod = 998244353;
const int M = 5e2 + 5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
sort(a.begin(), a.end());
int sum = 0;
for (int i = (n + 1) / 2; i < n; ++i) {
sum += a[i];
}
cout << sum << '\n';
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3424kb
input:
6 2 4 1 3 3 5
output:
12
result:
ok 1 number(s): "12"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3288kb
input:
2 1 1
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3312kb
input:
2 1000 1
output:
1000
result:
ok 1 number(s): "1000"
Test #4:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
5 1 1 2 2 3
output:
5
result:
ok 1 number(s): "5"
Test #5:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
7 1 1 1 2 2 3 3
output:
8
result:
ok 1 number(s): "8"
Test #6:
score: 0
Accepted
time: 2ms
memory: 3296kb
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: 2ms
memory: 3276kb
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: 2ms
memory: 3352kb
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: 2ms
memory: 3312kb
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: 2ms
memory: 3436kb
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: 0ms
memory: 3280kb
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: 3316kb
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: 2ms
memory: 3424kb
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: 3456kb
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: 2ms
memory: 3400kb
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: 2ms
memory: 3400kb
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: 2ms
memory: 3284kb
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: 2ms
memory: 3420kb
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: 2ms
memory: 3356kb
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: 2ms
memory: 3324kb
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: 2ms
memory: 3468kb
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: 2ms
memory: 3432kb
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: 2ms
memory: 3332kb
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: 0ms
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 #25:
score: 0
Accepted
time: 2ms
memory: 3436kb
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: 3280kb
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"