QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#93779 | #5742. Garbage Disposal | maomao90# | WA | 2ms | 3376kb | C++17 | 1.6kb | 2023-04-02 13:14:15 | 2023-04-02 13:14:17 |
Judging History
answer
// Hallelujah, praise the one who set me free
// Hallelujah, death has lost its grip on me
// You have broken every chain, There's salvation in your name
// Jesus Christ, my living hope
#include <bits/stdc++.h>
using namespace std;
#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define RREP(i, s, e) for (int i = (s); i >= (e); i--)
template <class T>
inline bool mnto(T& a, T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T& a, T b) {return a < b ? a = b, 1: 0;}
typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
#define ALL(_a) _a.begin(), _a.end()
#define SZ(_a) (int) _a.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<iii> viii;
#ifndef DEBUG
#define cerr if (0) cerr
#endif
const int INF = 1000000005;
const ll LINF = 1000000000000000005ll;
const int MAXN = 200005;
int t;
int l, r;
int main() {
#ifndef DEBUG
ios::sync_with_stdio(0), cin.tie(0);
#endif
cin >> t;
while (t--) {
cin >> l >> r;
if (l % 2 == 0 && (r - l) % 2 == 0) {
cout << -1 << '\n';
continue;
}
if ((r - l) % 2 == 0) {
for (int i = l; i + 3 <= r; i += 2) {
cout << i + 1 << ' ' << i << ' ';
}
cout << r << ' ' << r - 2 << ' ' << r - 1;
cout << '\n';
} else {
for (int i = l; i <= r; i += 2) {
cout << i + 1 << ' ' << i << ' ';
}
cout << '\n';
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3324kb
input:
3 1 5 10 13 100 100
output:
2 1 5 3 4 11 10 13 12 -1
result:
ok 3 cases (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3376kb
input:
2 1 1 10 12
output:
1 -1 0 -1
result:
wrong output format expected EOF after 2 cases (test case 2)