CSES - Datatähti 2025 loppu - Results
Submission details
Task:Leikkijät
Sender:adex720
Submission time:2025-01-18 15:38:11 +0200
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
#40
#50
#60
Test results
testverdicttimegroup
#10.00 s1, 2, 5, 6details
#20.00 s1, 2, 3, 5, 6details
#30.00 s1, 2, 5, 6details
#40.00 s1, 2, 4, 5, 6details
#50.00 s2, 5, 6details
#60.00 s2, 3, 5, 6details
#70.00 s2, 5, 6details
#80.00 s2, 4, 5, 6details
#90.00 s5, 6details
#100.03 s6details
#110.00 s1, 2, 5, 6details
#120.02 s6details
#130.00 s3, 5, 6details
#140.00 s3, 5, 6details
#150.00 s4, 5, 6details
#160.00 s5, 6details
#170.02 s6details
#180.00 s4, 5, 6details
#190.00 s5, 6details
#200.02 s6details
#210.02 s6details
#220.00 s5, 6details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:17:19: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   17 |         if (a & 1 == 0)
      |                 ~~^~~~

Code

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t, a, b;
    cin >> t;

    for (int i = 0; i < t; i++)
    {
        cin >> a >> b;
        if (a & 1 == 0)
        {
            if (b == 1)
            {
                cout << a + 1;
                continue;
            }

            if (a + 2 == b)
            {
                cout << b;
                continue;
            }

            cout << -1;
        }
    }
}

Test details

Test 1

Group: 1, 2, 5, 6

Verdict:

input
1000
42 100
73 94
1 13
31 100
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 2

Group: 1, 2, 3, 5, 6

Verdict:

input
1000
54 3
42 44
30 1
52 3
...

correct output
54
44
31
52
15
...

user output
(empty)

Test 3

Group: 1, 2, 5, 6

Verdict:

input
1000
27 25
81 65
45 43
87 23
...

correct output
-1
-1
-1
139
-1
...

user output
(empty)

Test 4

Group: 1, 2, 4, 5, 6

Verdict:

input
1000
55 63
39 71
95 96
61 69
...

correct output
65
75
-1
72
98
...

user output
(empty)

Test 5

Group: 2, 5, 6

Verdict:

input
1000
222 56
871 832
207 364
919 980
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 6

Group: 2, 3, 5, 6

Verdict:

input
1000
892 3
332 334
820 822
42 1
...

correct output
892
334
822
43
108
...

user output
(empty)

Test 7

Group: 2, 5, 6

Verdict:

input
1000
77 93
319 575
509 381
675 707
...

correct output
98
607
574
713
919
...

user output
(empty)

Test 8

Group: 2, 4, 5, 6

Verdict:

input
1000
969 985
233 489
403 659
427 555
...

correct output
992
500
777
565
261
...

user output
(empty)

Test 9

Group: 5, 6

Verdict:

input
1000
10375 364462
501875 499131
495774 7544
133830 316225
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 10

Group: 6

Verdict:

input
100000
771321 298762
20752 494590
633649 443015
748804 831912
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 11

Group: 1, 2, 5, 6

Verdict:

input
900
1 1
1 2
1 3
1 4
...

correct output
-1
-1
3
-1
5
...

user output
(empty)

Test 12

Group: 6

Verdict:

input
90000
1 1
1 2
1 3
1 4
...

correct output
-1
-1
3
-1
5
...

user output
(empty)

Test 13

Group: 3, 5, 6

Verdict:

input
1000
237542 859435
965750 179154
972602 758585
453450 751662
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 14

Group: 3, 5, 6

Verdict:

input
1000
773164 1
870426 1
309736 309738
957602 957604
...

correct output
773165
870427
309738
957604
513118
...

user output
(empty)

Test 15

Group: 4, 5, 6

Verdict:

input
1000
178896 591355
54364 110987
361539 818612
275401 926643
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 16

Group: 5, 6

Verdict:

input
1000
704481 704465
696919 688727
941011 949203
171023 171025
...

correct output
-1
-1
951785
-1
-1
...

user output
(empty)

Test 17

Group: 6

Verdict:

input
100000
67901 133437
637521 637537
742567 742569
864043 864044
...

correct output
148638
637540
-1
-1
652457
...

user output
(empty)

Test 18

Group: 4, 5, 6

Verdict:

input
1000
650375 650377
181841 443985
750137 750138
256969 322505
...

correct output
-1
484136
-1
341476
850152
...

user output
(empty)

Test 19

Group: 5, 6

Verdict:

input
1000
1 3
1 5
1 9
1 17
...

correct output
3
5
10
20
40
...

user output
(empty)

Test 20

Group: 6

Verdict:

input
100000
1 3
1 5
1 9
1 17
...

correct output
3
5
10
20
40
...

user output
(empty)

Test 21

Group: 6

Verdict:

input
100000
999999 1
999999 3
999999 5
999999 7
...

correct output
1000002
1000005
1000000
1000011
1000001
...

user output
(empty)

Test 22

Group: 5, 6

Verdict:

input
1000
999999 1
999999 3
999999 5
999999 7
...

correct output
1000002
1000005
1000000
1000011
1000001
...

user output
(empty)