QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#88608 | #5742. Garbage Disposal | galaxias# | WA | 2ms | 3772kb | C++14 | 603b | 2023-03-16 18:57:32 | 2023-03-16 18:57:35 |
Judging History
answer
#include <bits/stdc++.h>
int T , L , R ;
int main() {
scanf("%d" , &T) ;
for (; T-- ;) {
scanf("%d %d" , &L , &R) ;
if (L == R) {puts("-1") ; continue ;}
int ti = (R - L + 1) / 2 - (R - L + 1) % 2 ;
if ((R - L + 1) & 1) {
if (L & 1) {
int a = L , b = L + 1 , c = L + 2 ;
printf("%d %d %d " , c , a , b) ;
for (int i = 0 , p = L + 3 ; i < ti ; ++i , p += 2) printf("%d %d " , p + 1 , p) ;
}
else printf("-1") ;
}
else {
for (int i = 0 , p = L ; i < ti ; ++i , p += 2) printf("%d %d " , p + 1 , p) ;
}
printf("\n") ;
}
return 0 ;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3772kb
input:
3 1 5 10 13 100 100
output:
3 1 2 5 4 11 10 13 12 -1
result:
ok 3 cases (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3528kb
input:
2 1 1 10 12
output:
-1 -1
result:
wrong answer Jury found answer but participant didn't (test case 1)