QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#625501 | #5742. Garbage Disposal | ship2077 | WA | 0ms | 3808kb | C++23 | 652b | 2024-10-09 19:33:48 | 2024-10-09 19:33:48 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int read(){
int x=0;char ch=getchar();
while (!isdigit(ch)) ch=getchar();
while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
return x;
}
void solve(){
int ql=read(),qr=read();
if (ql==qr) return puts("-1"),void();
if (qr-ql&1){
for (int i=ql;i<=qr;i++)
printf("%d ",i+(i-ql&1?-1:1));
return puts(""),void();
}
if (~ql&1) return puts("-1"),void();
printf("%d %d %d ",ql+1,ql+2,ql);
for (int i=ql+3;i<=qr;i++)
printf("%d ",i+(i-ql&1?1:-1));
puts("");
}
int main(){int T=read();while (T--) solve();return 0;}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3808kb
input:
3 1 5 10 13 100 100
output:
2 3 1 5 4 11 10 13 12 -1
result:
ok 3 cases (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3632kb
input:
2 1 1 10 12
output:
-1 -1
result:
wrong answer Jury found answer but participant didn't (test case 1)