QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#625501#5742. Garbage Disposalship2077WA 0ms3808kbC++23652b2024-10-09 19:33:482024-10-09 19:33:48

Judging History

你现在查看的是最新测评结果

  • [2024-10-09 19:33:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3808kb
  • [2024-10-09 19:33:48]
  • 提交

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)