QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89027 | #5742. Garbage Disposal | chiranko# | WA | 2ms | 3304kb | C++14 | 443b | 2023-03-18 13:15:46 | 2023-03-18 13:15:48 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int T;cin>>T;
while(T--)
{
int l,r;cin>>l>>r;
if(l==r)cout<<"-1\n";
else if((r-l)%2==0&&l%2==0)cout<<"-1\n";
else
{
int now=l;
while(now+2<r)
{
cout<<now+1<<' '<<now<<' ';
now+=2;
}
if(now+2==r)cout<<now+1<<' '<<now+2<<' '<<now<<"\n";
else cout<<now+1<<' '<<now<<"\n";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3284kb
input:
3 1 5 10 13 100 100
output:
2 1 4 5 3 11 10 13 12 -1
result:
ok 3 cases (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3304kb
input:
2 1 1 10 12
output:
-1 -1
result:
wrong answer Jury found answer but participant didn't (test case 1)