# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123227 | 2019-06-30T13:54:41 Z | cvele | Kisik (COCI19_kisik) | C++14 | 2000 ms | 54808 KB |
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cctype> #include <cstring> #include <climits> #include <iomanip> #include <bitset> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <list> #include <map> using namespace std; const int N = 1000005; int n, k; vector < pair <int, int> > vec; multiset <int> ms; int main() { cin >> n >> k; for (int i = 0; i < n; i++) { int w, h; cin >> w >> h; vec.push_back({h, w}); } sort(vec.begin(), vec.end()); int pos = 0; long long ans = 2e18, sum = 0; for (int i = 1; i < N; i++) { while (pos < vec.size() && vec[pos].first <= i) { sum += vec[pos].second; ms.insert(vec[pos].second); pos++; } while (ms.size() > k) { sum -= *ms.rbegin(); ms.erase(--ms.end()); } if (ms.size() == k) { ans = min(ans, sum * i); } } cout << ans << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 380 KB | Output is correct |
3 | Correct | 6 ms | 256 KB | Output is correct |
4 | Correct | 6 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 7 ms | 408 KB | Output is correct |
3 | Correct | 7 ms | 380 KB | Output is correct |
4 | Correct | 6 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 7 ms | 376 KB | Output is correct |
4 | Correct | 7 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 7 ms | 376 KB | Output is correct |
3 | Correct | 6 ms | 376 KB | Output is correct |
4 | Correct | 7 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 387 ms | 5704 KB | Output is correct |
2 | Correct | 1223 ms | 21148 KB | Output is correct |
3 | Correct | 1247 ms | 40824 KB | Output is correct |
4 | Correct | 1135 ms | 38004 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 689 ms | 11228 KB | Output is correct |
2 | Correct | 131 ms | 5612 KB | Output is correct |
3 | Correct | 271 ms | 9672 KB | Output is correct |
4 | Correct | 981 ms | 27736 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 433 ms | 12720 KB | Output is correct |
2 | Correct | 723 ms | 9692 KB | Output is correct |
3 | Correct | 569 ms | 7700 KB | Output is correct |
4 | Execution timed out | 2071 ms | 54808 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 549 ms | 11864 KB | Output is correct |
2 | Correct | 1819 ms | 31364 KB | Output is correct |
3 | Correct | 473 ms | 15220 KB | Output is correct |
4 | Correct | 1398 ms | 46688 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1020 ms | 11412 KB | Output is correct |
2 | Correct | 1271 ms | 36044 KB | Output is correct |
3 | Correct | 915 ms | 25444 KB | Output is correct |
4 | Correct | 607 ms | 22108 KB | Output is correct |