QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#83942#2133. NativesZuqa#AC ✓2ms3516kbC++201.1kb2023-03-04 16:39:572023-03-04 16:40:01

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-04 16:40:01]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3516kb
  • [2023-03-04 16:39:57]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define el '\n'
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
typedef unsigned long long ull;

template<typename T, typename X>
using hashTable = gp_hash_table<T, X>;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937_64 for long long
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

void doWork()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i = 0; i < n; i++)
        cin >> v[i];

    sort(v.rbegin(), v.rend());

    ll sum = 0;
    for(int i = 0; i < n / 2; i++)
        sum += v[i];
    cout << sum;

}

signed main()
{
    FIO
    int T = 1;
//    cin >> T;
    for(int i = 1; i <= T; i++)
        doWork();
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3348kb

input:

6
2 4 1 3 3 5

output:

12

result:

ok 1 number(s): "12"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

2
1 1

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3424kb

input:

2
1000 1

output:

1000

result:

ok 1 number(s): "1000"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3440kb

input:

5
1 1 2 2 3

output:

5

result:

ok 1 number(s): "5"

Test #5:

score: 0
Accepted
time: 0ms
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: 3488kb

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: 0ms
memory: 3512kb

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: 1ms
memory: 3432kb

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: 3448kb

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: 2ms
memory: 3444kb

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: 2ms
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: 0ms
memory: 3500kb

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: 2ms
memory: 3480kb

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: 3352kb

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: 3392kb

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: 3444kb

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: 3352kb

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: 0ms
memory: 3352kb

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: 3356kb

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: 3504kb

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: 0ms
memory: 3396kb

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: 3516kb

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: 2ms
memory: 3440kb

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: 3504kb

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: 0ms
memory: 3516kb

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"