## Submission #255776

# Submission time Handle Problem Language Result Execution time Memory
255776 2020-08-01T20:15:28 Z dolphingarlic Teams (IOI15_teams) C++14
34 / 100
4000 ms 28132 KB
```#include "teams.h"
#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
using namespace std;

multiset<pair<int, int>> students;

void init(int N, int A[], int B[]) {
FOR(i, 0, N) students.insert({B[i], A[i]});
}

int can(int M, int K[]) {
sort(K, K + M);
vector<pair<int, int>> removed;
FOR(i, 0, M) {
vector<pair<int, int>> to_remove;
for (auto j = students.lower_bound({K[i], 0}); j != students.end(); j++) {
if (K[i] >= (*j).second) to_remove.push_back(*j);
if (to_remove.size() == K[i]) break;
}
if (to_remove.size() != K[i]) {
for (pair<int, int> j : removed) students.insert(j);
return 0;
}
for (pair<int, int> j : to_remove) {
students.erase(students.find(j));
removed.push_back(j);
}
}
for (pair<int, int> j : removed) students.insert(j);
return 1;
}
```

### Compilation message

```teams.cpp: In function 'int can(int, int*)':
teams.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (to_remove.size() == K[i]) break;
~~~~~~~~~~~~~~~~~^~~~~~~
teams.cpp:21:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (to_remove.size() != K[i]) {
~~~~~~~~~~~~~~~~~^~~~~~~```

#### Subtask #1 21.0 / 21.0

# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 3 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 3 ms 384 KB Output is correct
14 Correct 3 ms 384 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 256 KB Output is correct
18 Correct 1 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 1 ms 256 KB Output is correct
23 Correct 1 ms 256 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 256 KB Output is correct
26 Correct 1 ms 256 KB Output is correct

#### Subtask #2 13.0 / 13.0

# Verdict Execution time Memory Grader output
1 Correct 49 ms 5756 KB Output is correct
2 Correct 62 ms 5752 KB Output is correct
3 Correct 49 ms 6508 KB Output is correct
4 Correct 49 ms 6144 KB Output is correct
5 Correct 66 ms 6900 KB Output is correct
6 Correct 55 ms 6524 KB Output is correct
7 Correct 48 ms 5760 KB Output is correct
8 Correct 45 ms 5880 KB Output is correct
9 Correct 60 ms 6904 KB Output is correct
10 Correct 41 ms 6896 KB Output is correct
11 Correct 52 ms 6904 KB Output is correct
12 Correct 53 ms 7044 KB Output is correct
13 Correct 60 ms 6968 KB Output is correct
14 Correct 38 ms 7028 KB Output is correct
15 Correct 42 ms 6016 KB Output is correct
16 Correct 44 ms 5808 KB Output is correct
17 Correct 52 ms 7192 KB Output is correct
18 Correct 57 ms 7028 KB Output is correct

#### Subtask #3 0 / 43.0

# Verdict Execution time Memory Grader output
1 Correct 1012 ms 6364 KB Output is correct
2 Correct 1465 ms 6396 KB Output is correct
3 Execution timed out 4081 ms 7432 KB Time limit exceeded
4 Halted 0 ms 0 KB -

#### Subtask #4 0 / 23.0

# Verdict Execution time Memory Grader output
1 Execution timed out 4070 ms 28132 KB Time limit exceeded
2 Halted 0 ms 0 KB -