#include <bits/stdc++.h>
using namespace std;
vector<int> smallest_sums(int n, vector<int> a, vector<int> b) {
vector<int> v;
for (int j = 0; j < min(90, n); j++) {
for (int i = j; i < n; i++) {
v.push_back(a[j] + b[i]);
if (i != j) v.push_back(b[j] + a[i]);
}
}
sort(v.begin(), v.end());
return vector<int> (v.begin(), v.begin() + n);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
2 ms |
468 KB |
Output is correct |
23 |
Correct |
6 ms |
848 KB |
Output is correct |
24 |
Correct |
6 ms |
848 KB |
Output is correct |
25 |
Correct |
6 ms |
848 KB |
Output is correct |
26 |
Correct |
21 ms |
2504 KB |
Output is correct |
27 |
Correct |
22 ms |
2504 KB |
Output is correct |
28 |
Correct |
22 ms |
2504 KB |
Output is correct |
29 |
Correct |
2 ms |
468 KB |
Output is correct |
30 |
Correct |
7 ms |
848 KB |
Output is correct |
31 |
Correct |
6 ms |
848 KB |
Output is correct |
32 |
Correct |
7 ms |
848 KB |
Output is correct |
33 |
Correct |
20 ms |
2504 KB |
Output is correct |
34 |
Correct |
21 ms |
2504 KB |
Output is correct |
35 |
Correct |
25 ms |
2504 KB |
Output is correct |
36 |
Correct |
23 ms |
2504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
2 ms |
468 KB |
Output is correct |
23 |
Correct |
6 ms |
848 KB |
Output is correct |
24 |
Correct |
6 ms |
848 KB |
Output is correct |
25 |
Correct |
6 ms |
848 KB |
Output is correct |
26 |
Correct |
21 ms |
2504 KB |
Output is correct |
27 |
Correct |
22 ms |
2504 KB |
Output is correct |
28 |
Correct |
22 ms |
2504 KB |
Output is correct |
29 |
Correct |
2 ms |
468 KB |
Output is correct |
30 |
Correct |
7 ms |
848 KB |
Output is correct |
31 |
Correct |
6 ms |
848 KB |
Output is correct |
32 |
Correct |
7 ms |
848 KB |
Output is correct |
33 |
Correct |
20 ms |
2504 KB |
Output is correct |
34 |
Correct |
21 ms |
2504 KB |
Output is correct |
35 |
Correct |
25 ms |
2504 KB |
Output is correct |
36 |
Correct |
23 ms |
2504 KB |
Output is correct |
37 |
Correct |
196 ms |
17084 KB |
Output is correct |
38 |
Correct |
673 ms |
67272 KB |
Output is correct |
39 |
Correct |
684 ms |
67296 KB |
Output is correct |
40 |
Correct |
669 ms |
67384 KB |
Output is correct |
41 |
Correct |
894 ms |
133252 KB |
Output is correct |
42 |
Correct |
832 ms |
133268 KB |
Output is correct |
43 |
Correct |
904 ms |
133288 KB |
Output is correct |
44 |
Correct |
190 ms |
17084 KB |
Output is correct |
45 |
Correct |
662 ms |
67232 KB |
Output is correct |
46 |
Correct |
738 ms |
67224 KB |
Output is correct |
47 |
Correct |
611 ms |
67248 KB |
Output is correct |
48 |
Correct |
867 ms |
133296 KB |
Output is correct |
49 |
Correct |
836 ms |
133292 KB |
Output is correct |
50 |
Execution timed out |
1033 ms |
133232 KB |
Time limit exceeded |
51 |
Halted |
0 ms |
0 KB |
- |