QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#88608#5742. Garbage Disposalgalaxias#WA 2ms3772kbC++14603b2023-03-16 18:57:322023-03-16 18:57:35

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-16 18:57:35]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3772kb
  • [2023-03-16 18:57:32]
  • 提交

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)