Submission #871884

# Submission time Handle Problem Language Result Execution time Memory
871884 2023-11-11T19:11:00 Z tvladm2009 Event Hopping 2 (JOI21_event2) C++17
0 / 100
19 ms 1628 KB
#include <bits/stdc++.h>
 
using i64 = long long;
 
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n, k;
    std::cin >> n >> k;
    std::vector<int> l(n), r(n);
    for (int i = 0; i < n; i++) {
        std::cin >> l[i] >> r[i];
    }
    int last = 0;
    for (int i = 0; i < n; i++) {
        if (l[i] >= last) {
            last = r[i];
            k--;
            std::cout << i + 1 << "\n";
        }
        if (k == 0) {
            break;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 19 ms 1628 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 19 ms 1628 KB Output isn't correct
5 Halted 0 ms 0 KB -