QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606769#1393. Skierowany graf acykliczny [C]3un_larryfunc10 ✓0ms1644kbC++204.8kb2024-10-03 12:05:122024-10-03 12:05:13

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #2:

score: 1
Accepted
time: 0ms
memory: 1544kb

input:

1

output:

2
2 -1
-1 -1

result:

ok n = 2, k = 1

Test #3:

score: 1
Accepted
time: 0ms
memory: 1644kb

input:

2

output:

3
2 3
3 -1
-1 -1

result:

ok n = 3, k = 2

Test #4:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

3

output:

4
2 4
3 4
4 -1
-1 -1

result:

ok n = 4, k = 3

Test #5:

score: 1
Accepted
time: 0ms
memory: 1588kb

input:

4

output:

5
2 4
3 4
4 5
5 -1
-1 -1

result:

ok n = 5, k = 4

Test #6:

score: 1
Accepted
time: 0ms
memory: 1596kb

input:

5

output:

5
2 3
3 4
4 5
5 -1
-1 -1

result:

ok n = 5, k = 5

Test #7:

score: 1
Accepted
time: 0ms
memory: 1608kb

input:

10

output:

7
2 4
3 4
4 7
5 7
6 7
7 -1
-1 -1

result:

ok n = 7, k = 10

Test #8:

score: 1
Accepted
time: 0ms
memory: 1612kb

input:

20

output:

9
2 3
3 4
4 9
5 7
6 7
7 -1
8 9
9 -1
-1 -1

result:

ok n = 9, k = 20

Test #9:

score: 1
Accepted
time: 0ms
memory: 1592kb

input:

50

output:

11
2 3
3 4
4 11
5 7
6 7
7 11
8 9
9 10
10 11
11 -1
-1 -1

result:

ok n = 11, k = 50

Test #10:

score: 1
Accepted
time: 0ms
memory: 1540kb

input:

75

output:

12
2 4
3 4
4 -1
5 7
6 7
7 12
8 9
9 10
10 12
11 12
12 -1
-1 -1

result:

ok n = 12, k = 75

Test #11:

score: 1
Accepted
time: 0ms
memory: 1632kb

input:

90

output:

13
2 4
3 4
4 -1
5 7
6 7
7 -1
8 10
9 10
10 13
11 13
12 13
13 -1
-1 -1

result:

ok n = 13, k = 90

Subtask #2:

score: 1
Accepted

Test #12:

score: 1
Accepted
time: 0ms
memory: 1532kb

input:

128

output:

14
2 3
3 4
4 14
5 7
6 7
7 -1
8 9
9 10
10 14
11 13
12 13
13 14
14 -1
-1 -1

result:

ok n = 14, k = 128

Test #13:

score: 1
Accepted
time: 0ms
memory: 1644kb

input:

256

output:

16
2 4
3 4
4 16
5 7
6 7
7 16
8 10
9 10
10 16
11 13
12 13
13 -1
14 16
15 16
16 -1
-1 -1

result:

ok n = 16, k = 256

Test #14:

score: 1
Accepted
time: 0ms
memory: 1584kb

input:

512

output:

18
2 3
3 4
4 18
5 6
6 7
7 18
8 9
9 10
10 18
11 13
12 13
13 -1
14 16
15 16
16 -1
17 18
18 -1
-1 -1

result:

ok n = 18, k = 512

Test #15:

score: 1
Accepted
time: 0ms
memory: 1592kb

input:

127

output:

14
2 4
3 4
4 14
5 7
6 7
7 -1
8 9
9 10
10 14
11 13
12 13
13 14
14 -1
-1 -1

result:

ok n = 14, k = 127

Test #16:

score: 1
Accepted
time: 0ms
memory: 1640kb

input:

255

output:

16
2 4
3 4
4 -1
5 7
6 7
7 16
8 10
9 10
10 16
11 13
12 13
13 -1
14 16
15 16
16 -1
-1 -1

result:

ok n = 16, k = 255

Test #17:

score: 1
Accepted
time: 0ms
memory: 1584kb

input:

511

output:

18
2 4
3 4
4 18
5 6
6 7
7 18
8 9
9 10
10 18
11 13
12 13
13 -1
14 16
15 16
16 -1
17 18
18 -1
-1 -1

result:

ok n = 18, k = 511

Test #18:

score: 1
Accepted
time: 0ms
memory: 1628kb

input:

377

output:

17
2 3
3 4
4 17
5 6
6 7
7 17
8 9
9 10
10 17
11 13
12 13
13 17
14 16
15 16
16 17
17 -1
-1 -1

result:

ok n = 17, k = 377

Test #19:

score: 1
Accepted
time: 0ms
memory: 1604kb

input:

610

output:

18
2 4
3 4
4 18
5 6
6 7
7 18
8 10
9 10
10 18
11 13
12 13
13 18
14 16
15 16
16 18
17 18
18 -1
-1 -1

result:

ok n = 18, k = 610

Test #20:

score: 1
Accepted
time: 0ms
memory: 1592kb

input:

987

output:

20
2 4
3 4
4 -1
5 6
6 7
7 20
8 10
9 10
10 20
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 20
20 -1
-1 -1

result:

ok n = 20, k = 987

Test #21:

score: 1
Accepted
time: 0ms
memory: 1624kb

input:

376

output:

17
2 4
3 4
4 17
5 6
6 7
7 17
8 9
9 10
10 17
11 13
12 13
13 17
14 16
15 16
16 17
17 -1
-1 -1

result:

ok n = 17, k = 376

Test #22:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

609

output:

18
2 4
3 4
4 -1
5 6
6 7
7 18
8 10
9 10
10 18
11 13
12 13
13 18
14 16
15 16
16 18
17 18
18 -1
-1 -1

result:

ok n = 18, k = 609

Test #23:

score: 1
Accepted
time: 0ms
memory: 1596kb

input:

986

output:

20
2 3
3 4
4 20
5 7
6 7
7 20
8 10
9 10
10 20
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 20
20 -1
-1 -1

result:

ok n = 20, k = 986

Subtask #3:

score: 1
Accepted

Test #24:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

4095

output:

23
2 4
3 4
4 -1
5 7
6 7
7 -1
8 9
9 10
10 23
11 13
12 13
13 23
14 15
15 16
16 23
17 19
18 19
19 23
20 21
21 22
22 23
23 -1
-1 -1

result:

ok n = 23, k = 4095

Test #25:

score: 1
Accepted
time: 0ms
memory: 1628kb

input:

8191

output:

25
2 4
3 4
4 25
5 7
6 7
7 -1
8 10
9 10
10 25
11 13
12 13
13 -1
14 15
15 16
16 25
17 19
18 19
19 -1
20 21
21 22
22 25
23 25
24 25
25 -1
-1 -1

result:

ok n = 25, k = 8191

Test #26:

score: 1
Accepted
time: 0ms
memory: 1608kb

input:

16383

output:

27
2 4
3 4
4 -1
5 7
6 7
7 27
8 9
9 10
10 27
11 13
12 13
13 -1
14 16
15 16
16 27
17 19
18 19
19 27
20 22
21 22
22 27
23 25
24 25
25 27
26 27
27 -1
-1 -1

result:

ok n = 27, k = 16383

Subtask #4:

score: 1
Accepted

Test #27:

score: 1
Accepted
time: 0ms
memory: 1632kb

input:

10945

output:

26
2 4
3 4
4 26
5 7
6 7
7 -1
8 10
9 10
10 26
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 -1
20 22
21 22
22 -1
23 24
24 25
25 26
26 -1
-1 -1

result:

ok n = 26, k = 10945

Test #28:

score: 1
Accepted
time: 0ms
memory: 1584kb

input:

17710

output:

27
2 4
3 4
4 27
5 6
6 7
7 27
8 9
9 10
10 27
11 13
12 13
13 27
14 15
15 16
16 27
17 19
18 19
19 -1
20 22
21 22
22 -1
23 24
24 25
25 27
26 27
27 -1
-1 -1

result:

ok n = 27, k = 17710

Test #29:

score: 1
Accepted
time: 0ms
memory: 1628kb

input:

28656

output:

29
2 4
3 4
4 -1
5 7
6 7
7 -1
8 10
9 10
10 29
11 12
12 13
13 29
14 15
15 16
16 29
17 19
18 19
19 -1
20 22
21 22
22 -1
23 25
24 25
25 29
26 28
27 28
28 29
29 -1
-1 -1

result:

ok n = 29, k = 28656

Subtask #5:

score: 1
Accepted

Test #30:

score: 1
Accepted
time: 0ms
memory: 1596kb

input:

4096

output:

23
2 4
3 4
4 23
5 7
6 7
7 -1
8 9
9 10
10 23
11 13
12 13
13 23
14 15
15 16
16 23
17 19
18 19
19 23
20 21
21 22
22 23
23 -1
-1 -1

result:

ok n = 23, k = 4096

Test #31:

score: 1
Accepted
time: 0ms
memory: 1604kb

input:

8192

output:

25
2 3
3 4
4 25
5 7
6 7
7 -1
8 10
9 10
10 25
11 13
12 13
13 -1
14 15
15 16
16 25
17 19
18 19
19 -1
20 21
21 22
22 25
23 25
24 25
25 -1
-1 -1

result:

ok n = 25, k = 8192

Test #32:

score: 1
Accepted
time: 0ms
memory: 1612kb

input:

16384

output:

27
2 4
3 4
4 27
5 7
6 7
7 27
8 9
9 10
10 27
11 13
12 13
13 -1
14 16
15 16
16 27
17 19
18 19
19 27
20 22
21 22
22 27
23 25
24 25
25 27
26 27
27 -1
-1 -1

result:

ok n = 27, k = 16384

Test #33:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

10946

output:

26
2 3
3 4
4 26
5 7
6 7
7 -1
8 10
9 10
10 26
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 -1
20 22
21 22
22 -1
23 24
24 25
25 26
26 -1
-1 -1

result:

ok n = 26, k = 10946

Test #34:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

17711

output:

27
2 3
3 4
4 27
5 6
6 7
7 27
8 9
9 10
10 27
11 13
12 13
13 27
14 15
15 16
16 27
17 19
18 19
19 -1
20 22
21 22
22 -1
23 24
24 25
25 27
26 27
27 -1
-1 -1

result:

ok n = 27, k = 17711

Test #35:

score: 1
Accepted
time: 0ms
memory: 1604kb

input:

28657

output:

29
2 4
3 4
4 29
5 7
6 7
7 -1
8 10
9 10
10 29
11 12
12 13
13 29
14 15
15 16
16 29
17 19
18 19
19 -1
20 22
21 22
22 -1
23 25
24 25
25 29
26 28
27 28
28 29
29 -1
-1 -1

result:

ok n = 29, k = 28657

Subtask #6:

score: 1
Accepted

Test #36:

score: 1
Accepted
time: 0ms
memory: 1540kb

input:

4194303

output:

42
2 4
3 4
4 -1
5 6
6 7
7 42
8 10
9 10
10 42
11 13
12 13
13 42
14 16
15 16
16 42
17 19
18 19
19 42
20 21
21 22
22 42
23 25
24 25
25 -1
26 28
27 28
28 -1
29 31
30 31
31 -1
32 33
33 34
34 42
35 36
36 37
37 42
38 40
39 40
40 42
41 42
42 -1
-1 -1

result:

ok n = 42, k = 4194303

Test #37:

score: 1
Accepted
time: 0ms
memory: 1580kb

input:

8388607

output:

44
2 4
3 4
4 44
5 7
6 7
7 44
8 10
9 10
10 -1
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 -1
20 21
21 22
22 44
23 25
24 25
25 44
26 28
27 28
28 -1
29 31
30 31
31 -1
32 34
33 34
34 44
35 36
36 37
37 44
38 40
39 40
40 -1
41 42
42 43
43 44
44 -1
-1 -1

result:

ok n = 44, k = 8388607

Test #38:

score: 1
Accepted
time: 0ms
memory: 1604kb

input:

16777215

output:

46
2 4
3 4
4 -1
5 7
6 7
7 -1
8 10
9 10
10 46
11 13
12 13
13 -1
14 16
15 16
16 -1
17 19
18 19
19 -1
20 22
21 22
22 46
23 25
24 25
25 -1
26 28
27 28
28 46
29 31
30 31
31 -1
32 33
33 34
34 46
35 37
36 37
37 46
38 40
39 40
40 46
41 43
42 43
43 46
44 46
45 46
46 -1
-1 -1

result:

ok n = 46, k = 16777215

Subtask #7:

score: 1
Accepted

Test #39:

score: 1
Accepted
time: 0ms
memory: 1636kb

input:

5702886

output:

43
2 4
3 4
4 -1
5 7
6 7
7 -1
8 10
9 10
10 -1
11 13
12 13
13 -1
14 15
15 16
16 43
17 18
18 19
19 43
20 22
21 22
22 43
23 25
24 25
25 -1
26 27
27 28
28 43
29 31
30 31
31 43
32 34
33 34
34 -1
35 36
36 37
37 43
38 40
39 40
40 43
41 43
42 43
43 -1
-1 -1

result:

ok n = 43, k = 5702886

Test #40:

score: 1
Accepted
time: 0ms
memory: 1544kb

input:

9227464

output:

44
2 4
3 4
4 44
5 6
6 7
7 44
8 9
9 10
10 44
11 13
12 13
13 -1
14 16
15 16
16 -1
17 18
18 19
19 44
20 22
21 22
22 -1
23 25
24 25
25 44
26 27
27 28
28 44
29 31
30 31
31 -1
32 34
33 34
34 -1
35 37
36 37
37 44
38 39
39 40
40 44
41 42
42 43
43 44
44 -1
-1 -1

result:

ok n = 44, k = 9227464

Test #41:

score: 1
Accepted
time: 0ms
memory: 1548kb

input:

14930351

output:

46
2 3
3 4
4 46
5 6
6 7
7 46
8 9
9 10
10 46
11 13
12 13
13 -1
14 15
15 16
16 46
17 19
18 19
19 46
20 21
21 22
22 46
23 25
24 25
25 46
26 28
27 28
28 46
29 30
30 31
31 46
32 34
33 34
34 -1
35 37
36 37
37 -1
38 40
39 40
40 46
41 43
42 43
43 -1
44 46
45 46
46 -1
-1 -1

result:

ok n = 46, k = 14930351

Subtask #8:

score: 1
Accepted

Test #42:

score: 1
Accepted
time: 0ms
memory: 1640kb

input:

134217728

output:

52
2 3
3 4
4 52
5 6
6 7
7 52
8 9
9 10
10 52
11 12
12 13
13 52
14 16
15 16
16 -1
17 19
18 19
19 -1
20 21
21 22
22 52
23 24
24 25
25 52
26 27
27 28
28 52
29 30
30 31
31 52
32 34
33 34
34 52
35 37
36 37
37 52
38 40
39 40
40 -1
41 43
42 43
43 -1
44 46
45 46
46 52
47 49
48 49
49 -1
50 52
51 52
52 -1
-1 -1

result:

ok n = 52, k = 134217728

Test #43:

score: 1
Accepted
time: 0ms
memory: 1576kb

input:

268435456

output:

54
2 4
3 4
4 54
5 6
6 7
7 54
8 9
9 10
10 54
11 12
12 13
13 54
14 16
15 16
16 54
17 19
18 19
19 -1
20 22
21 22
22 54
23 24
24 25
25 54
26 27
27 28
28 54
29 30
30 31
31 54
32 34
33 34
34 -1
35 37
36 37
37 -1
38 40
39 40
40 54
41 43
42 43
43 -1
44 45
45 46
46 54
47 49
48 49
49 -1
50 52
51 52
52 -1
53 5...

result:

ok n = 54, k = 268435456

Test #44:

score: 1
Accepted
time: 0ms
memory: 1600kb

input:

536870912

output:

56
2 3
3 4
4 56
5 7
6 7
7 56
8 9
9 10
10 56
11 12
12 13
13 56
14 16
15 16
16 -1
17 19
18 19
19 56
20 21
21 22
22 56
23 25
24 25
25 56
26 27
27 28
28 56
29 30
30 31
31 56
32 34
33 34
34 56
35 37
36 37
37 -1
38 39
39 40
40 56
41 43
42 43
43 -1
44 46
45 46
46 56
47 49
48 49
49 56
50 52
51 52
52 -1
53 5...

result:

ok n = 56, k = 536870912

Subtask #9:

score: 1
Accepted

Test #45:

score: 1
Accepted
time: 0ms
memory: 1636kb

input:

267914296

output:

54
2 4
3 4
4 54
5 7
6 7
7 -1
8 9
9 10
10 54
11 12
12 13
13 54
14 15
15 16
16 54
17 19
18 19
19 -1
20 22
21 22
22 -1
23 25
24 25
25 54
26 28
27 28
28 54
29 31
30 31
31 -1
32 34
33 34
34 54
35 37
36 37
37 -1
38 40
39 40
40 -1
41 43
42 43
43 -1
44 45
45 46
46 54
47 49
48 49
49 -1
50 52
51 52
52 -1
53 5...

result:

ok n = 54, k = 267914296

Test #46:

score: 1
Accepted
time: 0ms
memory: 1632kb

input:

433494437

output:

55
2 3
3 4
4 55
5 7
6 7
7 55
8 10
9 10
10 55
11 13
12 13
13 -1
14 15
15 16
16 55
17 19
18 19
19 55
20 22
21 22
22 -1
23 25
24 25
25 55
26 27
27 28
28 55
29 31
30 31
31 -1
32 34
33 34
34 -1
35 36
36 37
37 55
38 39
39 40
40 55
41 43
42 43
43 55
44 46
45 46
46 -1
47 49
48 49
49 -1
50 52
51 52
52 55
53 ...

result:

ok n = 55, k = 433494437

Test #47:

score: 1
Accepted
time: 0ms
memory: 1548kb

input:

701408733

output:

56
2 4
3 4
4 -1
5 6
6 7
7 56
8 10
9 10
10 -1
11 13
12 13
13 -1
14 15
15 16
16 56
17 18
18 19
19 56
20 22
21 22
22 -1
23 24
24 25
25 56
26 28
27 28
28 -1
29 31
30 31
31 56
32 34
33 34
34 56
35 36
36 37
37 56
38 39
39 40
40 56
41 43
42 43
43 56
44 45
45 46
46 56
47 49
48 49
49 -1
50 52
51 52
52 56
53 ...

result:

ok n = 56, k = 701408733

Subtask #10:

score: 1
Accepted

Test #48:

score: 1
Accepted
time: 0ms
memory: 1536kb

input:

1000000000

output:

57
2 4
3 4
4 57
5 7
6 7
7 -1
8 10
9 10
10 -1
11 13
12 13
13 -1
14 16
15 16
16 57
17 19
18 19
19 -1
20 22
21 22
22 57
23 24
24 25
25 57
26 28
27 28
28 -1
29 31
30 31
31 -1
32 34
33 34
34 -1
35 36
36 37
37 57
38 40
39 40
40 -1
41 43
42 43
43 -1
44 45
45 46
46 57
47 49
48 49
49 -1
50 51
51 52
52 57
53 ...

result:

ok n = 57, k = 1000000000

Test #49:

score: 1
Accepted
time: 0ms
memory: 1576kb

input:

999999999

output:

57
2 4
3 4
4 -1
5 7
6 7
7 -1
8 10
9 10
10 -1
11 13
12 13
13 -1
14 16
15 16
16 57
17 19
18 19
19 -1
20 22
21 22
22 57
23 24
24 25
25 57
26 28
27 28
28 -1
29 31
30 31
31 -1
32 34
33 34
34 -1
35 36
36 37
37 57
38 40
39 40
40 -1
41 43
42 43
43 -1
44 45
45 46
46 57
47 49
48 49
49 -1
50 51
51 52
52 57
53 ...

result:

ok n = 57, k = 999999999

Test #50:

score: 1
Accepted
time: 0ms
memory: 1632kb

input:

999999998

output:

57
2 3
3 4
4 57
5 6
6 7
7 57
8 9
9 10
10 57
11 12
12 13
13 57
14 16
15 16
16 -1
17 19
18 19
19 -1
20 22
21 22
22 57
23 24
24 25
25 57
26 28
27 28
28 -1
29 31
30 31
31 -1
32 34
33 34
34 -1
35 36
36 37
37 57
38 40
39 40
40 -1
41 43
42 43
43 -1
44 45
45 46
46 57
47 49
48 49
49 -1
50 51
51 52
52 57
53 5...

result:

ok n = 57, k = 999999998

Test #51:

score: 1
Accepted
time: 0ms
memory: 1604kb

input:

536870911

output:

56
2 4
3 4
4 56
5 7
6 7
7 56
8 9
9 10
10 56
11 12
12 13
13 56
14 16
15 16
16 -1
17 19
18 19
19 56
20 21
21 22
22 56
23 25
24 25
25 56
26 27
27 28
28 56
29 30
30 31
31 56
32 34
33 34
34 56
35 37
36 37
37 -1
38 39
39 40
40 56
41 43
42 43
43 -1
44 46
45 46
46 56
47 49
48 49
49 56
50 52
51 52
52 -1
53 5...

result:

ok n = 56, k = 536870911

Test #52:

score: 1
Accepted
time: 0ms
memory: 1632kb

input:

536870913

output:

56
2 4
3 4
4 -1
5 6
6 7
7 56
8 9
9 10
10 56
11 12
12 13
13 56
14 16
15 16
16 -1
17 19
18 19
19 56
20 21
21 22
22 56
23 25
24 25
25 56
26 27
27 28
28 56
29 30
30 31
31 56
32 34
33 34
34 56
35 37
36 37
37 -1
38 39
39 40
40 56
41 43
42 43
43 -1
44 46
45 46
46 56
47 49
48 49
49 56
50 52
51 52
52 -1
53 5...

result:

ok n = 56, k = 536870913