QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#808751 | #8195. Satelity | ucup-team004 | 0 | 1ms | 3612kb | C++23 | 821b | 2024-12-11 01:09:41 | 2024-12-11 01:09:49 |
answer
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<std::array<int, 3>> a(n);
for (int i = 0; i < n; i++) {
int l, r;
std::cin >> l >> r;
a[i] = {r, l, i};
}
std::sort(a.begin(), a.end());
int R = 0;
std::vector<int> ans;
for (auto [r, l, i] : a) {
if (l >= R) {
ans.push_back(i);
R = r;
}
}
std::cout << ans.size() - 1 << "\n";
for (int i = 1; i < ans.size(); i++) {
std::cout << ans[i] + 1 << " " << ans[0] + 1 << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3612kb
input:
100 5340 10200 1 101 1 102 1 104 1 105 1 106 1 107 1 108 1 109 1 116 1 119 1 120 1 123 1 125 1 126 1 127 1 129 1 132 1 133 1 135 1 136 1 137 1 138 1 141 1 144 1 146 1 147 1 148 1 149 1 151 1 155 1 156 1 158 1 159 1 160 1 161 1 163 1 165 1 167 1 168 1 169 1 170 1 172 1 173 1 174 1 175 1 177 1 178 1 1...
output:
1 1 2
result:
wrong answer Token "1" doesn't correspond to pattern "[ABC]*"
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%