QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#74712#5176. 多控制反转SegmentTree100 ✓2ms3460kbC++201.8kb2023-02-03 14:21:252023-02-03 14:21:27

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 15
Accepted

Test #1:

score: 15
Accepted
time: 0ms
memory: 3456kb

input:

0 2 1 1

output:

1
1 0

result:

ok OK.

Test #2:

score: 0
Accepted
time: 2ms
memory: 3324kb

input:

13 28 105 1

output:

80
3 6 0 13
3 7 1 6
3 8 2 7
3 9 3 8
3 10 4 9
3 5 14 10
3 10 4 9
3 9 3 8
3 8 2 7
3 7 1 6
3 6 0 13
3 7 1 6
3 8 2 7
3 9 3 8
3 10 4 9
3 5 14 10
3 10 4 9
3 9 3 8
3 8 2 7
3 7 1 6
3 0 6 14
3 1 7 0
3 2 8 1
3 3 9 2
3 4 10 3
3 11 12 4
3 4 10 3
3 3 9 2
3 2 8 1
3 1 7 0
3 0 6 14
3 1 7 0
3 2 8 1
3 3 9 2
3 4 10 3
...

result:

ok OK.

Test #3:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

5 12 41 1

output:

16
3 2 0 5
3 1 6 2
3 2 0 5
3 1 6 2
3 0 2 6
3 3 4 0
3 0 2 6
3 3 4 0
3 2 0 5
3 1 6 2
3 2 0 5
3 1 6 2
3 0 2 6
3 3 4 0
3 0 2 6
3 3 4 0

result:

ok OK.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3328kb

input:

20 42 161 1

output:

136
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7 16
3 16 6 15
3 15 5 14
3 14 4 13
3 13 3 12
3 12 2 11
3 11 1 10
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7...

result:

ok OK.

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #5:

score: 10
Accepted
time: 0ms
memory: 3312kb

input:

48 98 385 2

output:

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

result:

ok OK.

Test #6:

score: 0
Accepted
time: 0ms
memory: 3400kb

input:

41 84 329 2

output:

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

result:

ok OK.

Test #7:

score: 0
Accepted
time: 2ms
memory: 3336kb

input:

50 102 401 2

output:

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

result:

ok OK.

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #8:

score: 10
Accepted
time: 0ms
memory: 3380kb

input:

0 2 1 3

output:

1
1 0

result:

ok OK.

Test #9:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

19 40 153 3

output:

128
3 9 0 19
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 20 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3 11 2 10
3 10 1 9
3 9 0 19
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 20 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3...

result:

ok OK.

Test #10:

score: 0
Accepted
time: 0ms
memory: 3340kb

input:

47 96 377 3

output:

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

result:

ok OK.

Test #11:

score: 0
Accepted
time: 0ms
memory: 3336kb

input:

25 52 201 3

output:

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

result:

ok OK.

Test #12:

score: 0
Accepted
time: 2ms
memory: 3424kb

input:

50 102 401 3

output:

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

result:

ok OK.

Subtask #4:

score: 10
Accepted

Test #13:

score: 10
Accepted
time: 2ms
memory: 3320kb

input:

0 2 1 4

output:

1
1 0

result:

ok OK.

Test #14:

score: 0
Accepted
time: 2ms
memory: 3300kb

input:

18 20 325 4

output:

120
3 9 0 18
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 19 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3 11 2 10
3 10 1 9
3 9 0 18
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 19 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3...

result:

ok OK.

Test #15:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

14 16 197 4

output:

88
3 7 0 14
3 8 1 7
3 9 2 8
3 10 3 9
3 11 4 10
3 12 5 11
3 6 15 12
3 12 5 11
3 11 4 10
3 10 3 9
3 9 2 8
3 8 1 7
3 7 0 14
3 8 1 7
3 9 2 8
3 10 3 9
3 11 4 10
3 12 5 11
3 6 15 12
3 12 5 11
3 11 4 10
3 10 3 9
3 9 2 8
3 8 1 7
3 0 7 15
3 1 8 0
3 2 9 1
3 3 10 2
3 4 11 3
3 12 13 4
3 4 11 3
3 3 10 2
3 2 9 1
...

result:

ok OK.

Test #16:

score: 0
Accepted
time: 2ms
memory: 3328kb

input:

20 22 401 4

output:

136
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7 16
3 16 6 15
3 15 5 14
3 14 4 13
3 13 3 12
3 12 2 11
3 11 1 10
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7...

result:

ok OK.

Subtask #5:

score: 20
Accepted

Dependency #4:

100%
Accepted

Test #17:

score: 20
Accepted
time: 2ms
memory: 3396kb

input:

18 20 325 5

output:

120
3 9 0 18
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 19 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3 11 2 10
3 10 1 9
3 9 0 18
3 10 1 9
3 11 2 10
3 12 3 11
3 13 4 12
3 14 5 13
3 15 6 14
3 16 7 15
3 8 19 16
3 16 7 15
3 15 6 14
3 14 5 13
3 13 4 12
3 12 3 11
3...

result:

ok OK.

Test #18:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

17 19 290 5

output:

112
3 8 0 17
3 9 1 8
3 10 2 9
3 11 3 10
3 12 4 11
3 13 5 12
3 14 6 13
3 7 18 14
3 14 6 13
3 13 5 12
3 12 4 11
3 11 3 10
3 10 2 9
3 9 1 8
3 8 0 17
3 9 1 8
3 10 2 9
3 11 3 10
3 12 4 11
3 13 5 12
3 14 6 13
3 7 18 14
3 14 6 13
3 13 5 12
3 12 4 11
3 11 3 10
3 10 2 9
3 9 1 8
3 0 8 18
3 1 9 0
3 2 10 1
3 3 ...

result:

ok OK.

Test #19:

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

input:

20 22 401 5

output:

136
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7 16
3 16 6 15
3 15 5 14
3 14 4 13
3 13 3 12
3 12 2 11
3 11 1 10
3 10 0 20
3 11 1 10
3 12 2 11
3 13 3 12
3 14 4 13
3 15 5 14
3 16 6 15
3 17 7 16
3 18 8 17
3 9 21 18
3 18 8 17
3 17 7...

result:

ok OK.

Subtask #6:

score: 10
Accepted

Test #20:

score: 10
Accepted
time: 2ms
memory: 3328kb

input:

14 16 393 6

output:

88
3 7 0 14
3 8 1 7
3 9 2 8
3 10 3 9
3 11 4 10
3 12 5 11
3 6 15 12
3 12 5 11
3 11 4 10
3 10 3 9
3 9 2 8
3 8 1 7
3 7 0 14
3 8 1 7
3 9 2 8
3 10 3 9
3 11 4 10
3 12 5 11
3 6 15 12
3 12 5 11
3 11 4 10
3 10 3 9
3 9 2 8
3 8 1 7
3 0 7 15
3 1 8 0
3 2 9 1
3 3 10 2
3 4 11 3
3 12 13 4
3 4 11 3
3 3 10 2
3 2 9 1
...

result:

ok OK.

Test #21:

score: 0
Accepted
time: 0ms
memory: 3304kb

input:

39 41 1093 6

output:

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

result:

ok OK.

Test #22:

score: 0
Accepted
time: 2ms
memory: 3372kb

input:

0 2 1 6

output:

1
1 0

result:

ok OK.

Test #23:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

50 52 1401 6

output:

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

result:

ok OK.

Subtask #7:

score: 10
Accepted

Dependency #2:

100%
Accepted

Dependency #4:

100%
Accepted

Test #24:

score: 10
Accepted
time: 0ms
memory: 3340kb

input:

93 95 745 7

output:

720
3 46 0 93
3 47 1 46
3 48 2 47
3 49 3 48
3 50 4 49
3 51 5 50
3 52 6 51
3 53 7 52
3 54 8 53
3 55 9 54
3 56 10 55
3 57 11 56
3 58 12 57
3 59 13 58
3 60 14 59
3 61 15 60
3 62 16 61
3 63 17 62
3 64 18 63
3 65 19 64
3 66 20 65
3 67 21 66
3 68 22 67
3 69 23 68
3 70 24 69
3 71 25 70
3 72 26 71
3 73 27 7...

result:

ok OK.

Test #25:

score: 0
Accepted
time: 2ms
memory: 3412kb

input:

82 84 657 7

output:

632
3 41 0 82
3 42 1 41
3 43 2 42
3 44 3 43
3 45 4 44
3 46 5 45
3 47 6 46
3 48 7 47
3 49 8 48
3 50 9 49
3 51 10 50
3 52 11 51
3 53 12 52
3 54 13 53
3 55 14 54
3 56 15 55
3 57 16 56
3 58 17 57
3 59 18 58
3 60 19 59
3 61 20 60
3 62 21 61
3 63 22 62
3 64 23 63
3 65 24 64
3 66 25 65
3 67 26 66
3 68 27 6...

result:

ok OK.

Test #26:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

100 102 801 7

output:

776
3 50 0 100
3 51 1 50
3 52 2 51
3 53 3 52
3 54 4 53
3 55 5 54
3 56 6 55
3 57 7 56
3 58 8 57
3 59 9 58
3 60 10 59
3 61 11 60
3 62 12 61
3 63 13 62
3 64 14 63
3 65 15 64
3 66 16 65
3 67 17 66
3 68 18 67
3 69 19 68
3 70 20 69
3 71 21 70
3 72 22 71
3 73 23 72
3 74 24 73
3 75 25 74
3 76 26 75
3 77 27 ...

result:

ok OK.

Subtask #8:

score: 15
Accepted

Dependency #3:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Test #27:

score: 15
Accepted
time: 1ms
memory: 3460kb

input:

94 96 753 8

output:

728
3 47 0 94
3 48 1 47
3 49 2 48
3 50 3 49
3 51 4 50
3 52 5 51
3 53 6 52
3 54 7 53
3 55 8 54
3 56 9 55
3 57 10 56
3 58 11 57
3 59 12 58
3 60 13 59
3 61 14 60
3 62 15 61
3 63 16 62
3 64 17 63
3 65 18 64
3 66 19 65
3 67 20 66
3 68 21 67
3 69 22 68
3 70 23 69
3 71 24 70
3 72 25 71
3 73 26 72
3 74 27 7...

result:

ok OK.

Test #28:

score: 0
Accepted
time: 0ms
memory: 3348kb

input:

70 72 561 8

output:

536
3 35 0 70
3 36 1 35
3 37 2 36
3 38 3 37
3 39 4 38
3 40 5 39
3 41 6 40
3 42 7 41
3 43 8 42
3 44 9 43
3 45 10 44
3 46 11 45
3 47 12 46
3 48 13 47
3 49 14 48
3 50 15 49
3 51 16 50
3 52 17 51
3 53 18 52
3 54 19 53
3 55 20 54
3 56 21 55
3 57 22 56
3 58 23 57
3 59 24 58
3 60 25 59
3 61 26 60
3 62 27 6...

result:

ok OK.

Test #29:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

100 102 801 8

output:

776
3 50 0 100
3 51 1 50
3 52 2 51
3 53 3 52
3 54 4 53
3 55 5 54
3 56 6 55
3 57 7 56
3 58 8 57
3 59 9 58
3 60 10 59
3 61 11 60
3 62 12 61
3 63 13 62
3 64 14 63
3 65 15 64
3 66 16 65
3 67 17 66
3 68 18 67
3 69 19 68
3 70 20 69
3 71 21 70
3 72 22 71
3 73 23 72
3 74 24 73
3 75 25 74
3 76 26 75
3 77 27 ...

result:

ok OK.

Extra Test:

score: 0
Extra Test Passed