QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#89029 | #5742. Garbage Disposal | chiranko# | AC ✓ | 11ms | 3448kb | C++14 | 492b | 2023-03-18 13:19:40 | 2023-03-18 13:19:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T;cin>>T;
while(T--)
{
int l,r;cin>>l>>r;
if(l==r&&l==1)cout<<"1\n";
else 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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3276kb
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: 0
Accepted
time: 0ms
memory: 3276kb
input:
2 1 1 10 12
output:
1 -1
result:
ok 2 cases (2 test cases)
Test #3:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
2 9 13 3 9
output:
10 9 12 13 11 4 3 6 5 8 9 7
result:
ok 2 cases (2 test cases)
Test #4:
score: 0
Accepted
time: 7ms
memory: 3396kb
input:
1995 98 155 50 112 64 145 20 54 30 103 81 82 63 145 40 45 61 99 78 99 18 51 13 25 59 140 68 149 64 136 68 91 39 64 95 150 9 77 60 158 68 97 51 111 54 98 69 123 19 91 1 24 89 171 20 80 79 131 38 115 1 72 22 87 27 55 34 132 22 54 3 10 45 139 89 139 22 25 62 155 96 102 61 92 12 40 95 193 52 96 19 72 74...
output:
99 98 101 100 103 102 105 104 107 106 109 108 111 110 113 112 115 114 117 116 119 118 121 120 123 122 125 124 127 126 129 128 131 130 133 132 135 134 137 136 139 138 141 140 143 142 145 144 147 146 149 148 151 150 153 152 155 154 -1 65 64 67 66 69 68 71 70 73 72 75 74 77 76 79 78 81 80 83 82 85 84 8...
result:
ok 1995 cases (1995 test cases)
Test #5:
score: 0
Accepted
time: 9ms
memory: 3316kb
input:
3904 968371485 968371509 701765963 701765970 549469142 549469161 619248225 619248243 427650297 427650314 881057515 881057554 339671073 339671118 868458958 868458991 114108035 114108078 452441415 452441459 293666096 293666097 947100230 947100278 884912210 884912225 655580789 655580816 741243970 74124...
output:
968371486 968371485 968371488 968371487 968371490 968371489 968371492 968371491 968371494 968371493 968371496 968371495 968371498 968371497 968371500 968371499 968371502 968371501 968371504 968371503 968371506 968371505 968371508 968371509 968371507 701765964 701765963 701765966 701765965 701765968 ...
result:
ok 3904 cases (3904 test cases)
Test #6:
score: 0
Accepted
time: 7ms
memory: 3304kb
input:
18198 138241663 138241672 676972526 676972530 867876844 867876846 913955531 913955534 469993046 469993048 39688638 39688643 385261575 385261579 219784069 219784069 421044508 421044509 944566390 944566399 315592591 315592593 669733711 669733712 162886080 162886082 639609426 639609435 253660314 253660...
output:
138241664 138241663 138241666 138241665 138241668 138241667 138241670 138241669 138241672 138241671 -1 -1 913955532 913955531 913955534 913955533 -1 39688639 39688638 39688641 39688640 39688643 39688642 385261576 385261575 385261578 385261579 385261577 -1 421044509 421044508 944566391 944566390 9445...
result:
ok 18198 cases (18198 test cases)
Test #7:
score: 0
Accepted
time: 4ms
memory: 3332kb
input:
33298 777553849 777553849 334785771 334785773 573997215 573997216 138324260 138324264 802919250 802919253 965739697 965739697 791382357 791382357 510284693 510284693 7617431 7617434 344396965 344396966 776009722 776009725 934122341 934122342 456295677 456295677 637264010 637264014 915858631 91585863...
output:
-1 334785772 334785773 334785771 573997216 573997215 -1 802919251 802919250 802919253 802919252 -1 -1 -1 7617432 7617431 7617434 7617433 344396966 344396965 776009723 776009722 776009725 776009724 934122342 934122341 -1 -1 915858632 915858631 915858634 915858635 915858633 831424102 831424103 8314241...
result:
ok 33298 cases (33298 test cases)
Test #8:
score: 0
Accepted
time: 11ms
memory: 3300kb
input:
100000 450870929 450870929 501636706 501636706 821521310 821521310 505533172 505533172 86310682 86310682 271914160 271914160 87365014 87365014 346659996 346659996 96507146 96507146 359291557 359291557 278510610 278510610 34039227 34039227 247994589 247994589 620007867 620007867 13110207 13110207 403...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 100000 cases (100000 test cases)
Test #9:
score: 0
Accepted
time: 4ms
memory: 3284kb
input:
7428 999999999 999999999 999999995 999999995 999999959 999999989 999999956 999999971 999999991 999999997 999999976 999999983 999999993 999999995 999999973 999999994 999999960 999999976 999999962 999999982 999999982 999999984 999999952 999999974 999999961 999999982 999999971 999999984 999999964 99999...
output:
-1 -1 999999960 999999959 999999962 999999961 999999964 999999963 999999966 999999965 999999968 999999967 999999970 999999969 999999972 999999971 999999974 999999973 999999976 999999975 999999978 999999977 999999980 999999979 999999982 999999981 999999984 999999983 999999986 999999985 999999988 9999...
result:
ok 7428 cases (7428 test cases)
Test #10:
score: 0
Accepted
time: 0ms
memory: 3348kb
input:
4 448340770 448421332 36161242 36163421 238130212 238145382 116964981 116966401
output:
-1 36161243 36161242 36161245 36161244 36161247 36161246 36161249 36161248 36161251 36161250 36161253 36161252 36161255 36161254 36161257 36161256 36161259 36161258 36161261 36161260 36161263 36161262 36161265 36161264 36161267 36161266 36161269 36161268 36161271 36161270 36161273 36161272 36161275 ...
result:
ok 4 cases (4 test cases)
Test #11:
score: 0
Accepted
time: 10ms
memory: 3284kb
input:
3 266069635 266148372 400267267 400268652 643992400 644010207
output:
266069636 266069635 266069638 266069637 266069640 266069639 266069642 266069641 266069644 266069643 266069646 266069645 266069648 266069647 266069650 266069649 266069652 266069651 266069654 266069653 266069656 266069655 266069658 266069657 266069660 266069659 266069662 266069661 266069664 266069663 ...
result:
ok 3 cases (3 test cases)
Test #12:
score: 0
Accepted
time: 10ms
memory: 3312kb
input:
1 196118330 196213437
output:
196118331 196118330 196118333 196118332 196118335 196118334 196118337 196118336 196118339 196118338 196118341 196118340 196118343 196118342 196118345 196118344 196118347 196118346 196118349 196118348 196118351 196118350 196118353 196118352 196118355 196118354 196118357 196118356 196118359 196118358 ...
result:
ok 1 cases (1 test case)
Test #13:
score: 0
Accepted
time: 5ms
memory: 3280kb
input:
1 194387582 194487581
output:
194387583 194387582 194387585 194387584 194387587 194387586 194387589 194387588 194387591 194387590 194387593 194387592 194387595 194387594 194387597 194387596 194387599 194387598 194387601 194387600 194387603 194387602 194387605 194387604 194387607 194387606 194387609 194387608 194387611 194387610 ...
result:
ok 1 cases (1 test case)
Test #14:
score: 0
Accepted
time: 2ms
memory: 3284kb
input:
1 79388006 79488005
output:
79388007 79388006 79388009 79388008 79388011 79388010 79388013 79388012 79388015 79388014 79388017 79388016 79388019 79388018 79388021 79388020 79388023 79388022 79388025 79388024 79388027 79388026 79388029 79388028 79388031 79388030 79388033 79388032 79388035 79388034 79388037 79388036 79388039 793...
result:
ok 1 cases (1 test case)
Test #15:
score: 0
Accepted
time: 3ms
memory: 3336kb
input:
1 621198489 621298488
output:
621198490 621198489 621198492 621198491 621198494 621198493 621198496 621198495 621198498 621198497 621198500 621198499 621198502 621198501 621198504 621198503 621198506 621198505 621198508 621198507 621198510 621198509 621198512 621198511 621198514 621198513 621198516 621198515 621198518 621198517 ...
result:
ok 1 cases (1 test case)