Your output
48
System message
Exited with return code 0
Your output
2
System message
Exited with return code 0
Your output
12
System message
Exited with return code 0
Your output
297
System message
Exited with return code 0
Submission ID | Problem | Status | Score | Time | Memory | Code / Answer files | User | Submit time |
---|---|---|---|---|---|---|---|---|
#18163 | #57. 每日任務 Daily Mission | Accepted | 100 | 810 ms | 2140 K | C++ 17 / 533 B | HKSCF2023-022 | 2023-07-15 15:13:44 |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#define ll long long
using namespace std;
vector<ll> V;
ll n, cnt = 0, A[200000], dp[200000];
int main() {
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> A[i];
}
sort(A, A + n);
for (int i = 0; i < n; ++i) {
if (A[i] > cnt + 1) {
cout << cnt + 1 << endl;
return 0;
}
cnt += A[i];
}
cout << cnt + 1 << '\n';
}
Your output
48
System message
Exited with return code 0
Your output
2
System message
Exited with return code 0
Your output
12
System message
Exited with return code 0
Your output
297
System message
Exited with return code 0
Your output
48
System message
Exited with return code 0
Your output
2
System message
Exited with return code 0
Your output
12
System message
Exited with return code 0
Your output
297
System message
Exited with return code 0
Your output
1763
System message
Exited with return code 0
Your output
853
System message
Exited with return code 0
94
10 49 14 12 27 23 25 23 17 13 19 1 6 8 2 18 17 23 23 14 11 14 1 1 10 2 12 2 9 17 4 3 51 52 15 23
<149 bytes omitted>
Your output
1530
System message
Exited with return code 0
493
3 5 1 1 8 2 1 6 1 3 2 1 6 3 4 1 2 5 3 2 2 3 7 1 4 2 11 2 7 3 4 2 4 2 2 2 5 2 5 3 6 1 1 2 5 3 3 1
<928 bytes omitted>
Your output
1978
System message
Exited with return code 0
877
1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1
<1658 bytes omitted>
Your output
953
System message
Exited with return code 0
1922
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1
<3749 bytes omitted>
Your output
2001
System message
Exited with return code 0
2000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<3905 bytes omitted>
Your output
2001
System message
Exited with return code 0
Your output
1024
System message
Exited with return code 0
Your output
2048
System message
Exited with return code 0
20
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288
Your output
1048576
System message
Exited with return code 0
29
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2
<70 bytes omitted>
Your output
536870912
System message
Exited with return code 0
Your output
48
System message
Exited with return code 0
Your output
2
System message
Exited with return code 0
Your output
12
System message
Exited with return code 0
Your output
297
System message
Exited with return code 0
Your output
1763
System message
Exited with return code 0
Your output
853
System message
Exited with return code 0
94
10 49 14 12 27 23 25 23 17 13 19 1 6 8 2 18 17 23 23 14 11 14 1 1 10 2 12 2 9 17 4 3 51 52 15 23
<149 bytes omitted>
Your output
1530
System message
Exited with return code 0
493
3 5 1 1 8 2 1 6 1 3 2 1 6 3 4 1 2 5 3 2 2 3 7 1 4 2 11 2 7 3 4 2 4 2 2 2 5 2 5 3 6 1 1 2 5 3 3 1
<928 bytes omitted>
Your output
1978
System message
Exited with return code 0
877
1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1
<1658 bytes omitted>
Your output
953
System message
Exited with return code 0
1922
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1
<3749 bytes omitted>
Your output
2001
System message
Exited with return code 0
2000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<3905 bytes omitted>
Your output
2001
System message
Exited with return code 0
Your output
1024
System message
Exited with return code 0
Your output
2048
System message
Exited with return code 0
20
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288
Your output
1048576
System message
Exited with return code 0
29
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2
<70 bytes omitted>
Your output
536870912
System message
Exited with return code 0
30
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2
<80 bytes omitted>
Your output
1073741824
System message
Exited with return code 0
2127
5059570 569700433 806431662 781669463 169065993 701953063 939155635 579816057 127813190 1989805
<20754 bytes omitted>
Your output
1042074992108
System message
Exited with return code 0
22905
240541707 227409131 433416478 685346829 819315210 484763086 236512049 887542996 613083819 3769
<226195 bytes omitted>
Your output
11375707640172
System message
Exited with return code 0
54470
577279446 750838456 663029421 360438188 573750548 672784477 678743584 936752454 954554014 8760
<538237 bytes omitted>
Your output
27114831761015
System message
Exited with return code 0
159379
976409421 250650118 421653057 724935506 120104032 547412854 947887672 709870676 30178795 6887
<1575937 bytes omitted>
Your output
79673555983003
System message
Exited with return code 0
199998
676635684 106344327 103654894 304004394 476965277 902487108 473401831 646687246 84331263 7165
<1977518 bytes omitted>
Your output
99904452090076
System message
Exited with return code 0