QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#89027#5742. Garbage Disposalchiranko#WA 2ms3304kbC++14443b2023-03-18 13:15:462023-03-18 13:15:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-18 13:15:48]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3304kb
  • [2023-03-18 13:15:46]
  • 提交

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)