QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#87482 | #5742. Garbage Disposal | tekola | WA | 2ms | 3524kb | C++17 | 649b | 2023-03-13 10:35:57 | 2023-03-13 10:35:58 |
Judging History
answer
#include <bits/stdc++.h>
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int t;
std::cin >> t;
void solve();
while (t--) solve();
return 0;
}
void solve() {
int l, r;
std::cin >> l >> r;
if (l == r) {
if (l == 1) std::cout << "1\n";
else std::cout << "-1\n";
} else if (r - l & 1) {
for (int i = l; i <= r; i++) {
std::cout << (i == r ? l : i + 1) << " \n"[i == r];
}
} else if (l & 1) {
std::cout << l + 1 << ' ' << l + r << ' ' << l << ' ';
for (int i = l + 3; i <= r; i++) {
std::cout << (i == r ? l : i + 1) << " \n"[i == r];
}
} else {
std::cout << "-1\n";
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3524kb
input:
3 1 5 10 13 100 100
output:
2 6 1 5 1 11 12 13 10 -1
result:
wrong answer Integer element y[2] equals to 6, violates the range [1, 5] (test case 1)