1064 - Network

All about problems in Volume 10. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
remerson
New poster
Posts: 4
Joined: Sun Jun 05, 2011 6:32 pm

1064 - Network

Post by remerson » Sat Feb 22, 2014 2:47 pm

I can follow the sample I/O but I can see more than one algorithm that gives the same output. E.g. "optimistic packet passing/as-soon-as-possible" or "buffering full message re-assembly."

Could someone please explain the output for these test cases:

Code: Select all

1 1
1
1 1 1
2 2
1 1
2 1 1
1 1 1
2 4
4 4
1 1 2
2 1 2
1 3 4
2 3 4
2 4
4 4
2 3 4
1 3 4
2 1 2
1 1 2
3 6
6 6 6
3 1 3
1 4 6
2 3 6
3 4 6
2 1 2
1 1 3
0 0
My program (wrong) gives:

Code: Select all

Case 1: 0

Case 2: 0

Case 3: 4

Case 4: 4

Case 5: 10

Particularly, cases 3 and 5 I think are wrong but do not understand why.

I am processing in each packet in turn, passing a packet as soon as possible and passing all packets for a message in-order. As each packet is processed, I track the current buffer size (either increasing it if buffering the packet or decreasing it if passing previously buffered packets). My output is the high watermark buffer size after processing all the packets.

I'm reasonably confident my approach is completely, totally and utterly wrong (!) but cannot see why. Any clues?

Many thanks in advance for any help!

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 1064 - Network

Post by brianfry713 » Mon Feb 24, 2014 10:40 pm

AC output for your input:

Code: Select all

Case 1: 0

Case 2: 0

Case 3: 2

Case 4: 4

Case 5: 7

On case 3:
1 1 2 pass
2 1 2 buff
1 3 4 pass
2 1 2 exits buff
2 3 4 pass

On case 5:
3 1 3 pass
1 4 6 buff
2 3 6 buff
3 4 6 pass
2 1 2 pass
2 3 6 exits buff
1 1 3 pass
1 4 6 exits buff

My code is AC 0.252 sec and considers all possible orderings of the messages passing the buffer. Remember that "Note that unlike actual buffering systems, the process for this problem can look ahead at all incoming packets to make its decisions."
Check input and AC output for thousands of problems on uDebug!

remerson
New poster
Posts: 4
Joined: Sun Jun 05, 2011 6:32 pm

Re: 1064 - Network

Post by remerson » Sat Mar 01, 2014 1:21 pm

Thank you very much Brian - I understand now.

anacharsis
Learning poster
Posts: 69
Joined: Mon Feb 09, 2015 1:56 am

Re: 1064 - Network

Post by anacharsis » Thu Jun 11, 2015 8:56 pm

Some I/O

In:

Code: Select all

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

AC out:

Code: Select all

Case 1: 10

Case 2: 2

Case 3: 7

Case 4: 4

Case 5: 4

Case 6: 5

Case 7: 4

Case 8: 6

Case 9: 9

Case 10: 6

Case 11: 9

Case 12: 4

Case 13: 7

Case 14: 8

Case 15: 6

Case 16: 4

Case 17: 6

Case 18: 9

Case 19: 6

Case 20: 5

Case 21: 3

Case 22: 0

Case 23: 4

Case 24: 4

Case 25: 4

Last edited by anacharsis on Thu Jun 11, 2015 8:58 pm, edited 1 time in total.

anacharsis
Learning poster
Posts: 69
Joined: Mon Feb 09, 2015 1:56 am

Re: 1064 - Network

Post by anacharsis » Thu Jun 11, 2015 8:57 pm

More I/O

In:

Code: Select all

6 86
44 22 56 22 20 46 
6 8 8
6 30 31
3 16 17
1 3 5
6 23 25
1 12 13
3 3 6
2 6 7
5 18 20
6 19 22
2 8 9
3 28 29
6 32 33
5 10 10
3 11 12
6 41 42
1 1 2
2 13 14
4 1 4
3 42 45
3 54 56
2 18 19
5 13 14
3 13 15
6 11 11
4 16 19
1 30 33
3 30 30
3 37 37
6 9 10
5 1 2
2 5 5
6 28 29
1 11 11
6 43 45
2 20 22
1 40 43
3 31 34
6 15 18
3 22 25
6 26 27
4 14 14
1 10 10
3 52 52
3 35 36
4 15 15
4 20 22
1 36 39
4 11 13
5 15 17
2 15 17
1 44 44
6 36 36
6 5 5
3 53 53
5 7 9
4 7 10
6 34 35
6 1 4
3 38 39
2 1 4
3 26 27
1 17 18
2 10 12
1 19 22
6 12 14
5 3 6
1 25 25
1 34 35
3 8 8
3 7 7
6 46 46
6 37 40
1 14 16
3 1 2
3 46 48
1 23 24
3 9 10
3 49 51
1 26 29
3 40 41
4 5 6
6 6 7
5 11 12
3 18 21
1 6 9
6 88
40 22 29 45 51 38 
3 16 17
5 32 32
1 12 14
2 10 12
4 9 12
1 17 17
1 3 5
1 34 37
6 27 27
3 18 20
4 15 17
2 9 9
5 33 35
4 41 44
5 4 5
5 43 45
5 47 49
1 6 7
2 1 4
1 18 18
5 41 42
6 31 34
6 13 14
2 13 16
3 13 15
1 8 11
4 45 45
2 5 7
1 25 28
6 9 11
4 22 24
6 6 7
3 8 10
3 25 26
4 35 37
6 1 4
4 18 21
1 19 20
6 19 20
4 3 6
3 21 24
5 15 17
5 46 46
4 34 34
3 1 3
1 31 33
1 15 16
4 1 2
6 12 12
5 36 38
4 7 8
2 22 22
5 29 31
4 40 40
6 38 38
5 39 40
4 13 14
5 22 25
6 28 30
1 2 2
3 11 12
6 15 18
3 27 29
5 6 8
5 50 51
6 21 23
2 8 8
5 26 28
6 8 8
1 1 1
5 11 14
2 19 21
4 38 39
6 24 26
6 35 37
2 17 18
5 1 2
3 4 7
5 18 21
4 28 30
4 31 33
6 5 5
1 21 24
5 9 10
1 38 40
1 29 30
5 3 3
4 25 27
6 98
37 50 27 53 31 37 
2 32 32
1 30 33
1 22 23
3 19 21
6 4 6
1 7 9
4 9 11
6 20 22
4 30 32
5 8 11
4 18 19
2 14 16
3 3 3
2 23 24
4 26 27
5 22 25
6 1 3
1 34 35
1 5 6
5 30 31
1 24 27
1 28 29
1 1 4
4 45 47
6 14 16
3 9 11
4 41 44
1 14 15
6 37 37
5 5 5
3 22 25
4 50 50
2 12 12
4 16 16
3 4 6
2 31 31
4 33 33
3 26 27
4 22 24
5 15 17
5 12 14
4 38 40
4 28 29
3 7 8
2 29 30
4 6 7
4 51 53
6 29 32
2 7 9
2 25 25
1 10 11
3 16 18
5 26 29
4 5 5
1 16 16
4 25 25
6 10 12
2 33 36
5 1 3
2 10 11
1 12 13
4 8 8
6 35 36
1 17 17
2 40 42
6 33 34
4 34 37
5 18 21
2 47 49
2 4 4
2 21 22
6 28 28
4 12 15
6 27 27
5 4 4
3 1 2
2 13 13
4 20 21
2 17 20
4 48 49
2 50 50
1 36 36
2 43 46
2 1 3
2 38 39
4 17 17
2 26 28
6 17 19
6 23 26
1 37 37
2 37 37
3 12 15
5 6 7
6 7 9
6 13 13
4 1 4
2 5 6
1 18 21
6 124
61 32 48 60 48 58 
3 35 38
2 12 12
6 17 19
3 17 18
5 33 35
2 1 3
3 19 19
1 42 43
1 44 45
1 27 28
4 1 4
5 1 2
4 47 49
4 18 19
5 23 23
4 26 28
4 38 40
3 14 14
3 29 30
1 40 41
4 58 60
4 41 44
2 26 29
1 35 37
5 43 44
3 32 34
4 50 50
3 43 44
5 11 11
5 32 32
6 39 42
4 45 46
2 19 22
1 30 31
6 12 14
6 20 23
6 43 46
6 8 11
6 47 47
1 11 14
5 36 38
6 15 15
5 39 42
2 25 25
3 1 3
6 51 51
5 10 10
2 8 10
3 45 48
5 21 22
3 25 28
6 16 16
4 57 57
5 7 9
1 20 22
6 24 27
5 24 27
1 26 26
6 5 7
4 12 13
3 41 42
2 16 16
2 11 11
2 23 24
3 20 23
4 34 37
4 8 11
2 4 7
1 25 25
5 3 6
1 60 61
3 8 8
1 55 56
1 5 8
3 24 24
4 22 24
5 12 13
2 30 32
4 20 21
5 47 48
3 13 13
3 9 12
1 32 32
6 35 37
5 46 46
1 57 59
4 53 56
4 14 17
1 52 54
5 45 45
3 39 40
3 15 16
2 13 15
6 28 30
5 14 17
4 25 25
3 4 7
3 31 31
6 1 4
5 18 20
6 48 50
1 38 39
1 46 47
1 33 34
6 55 58
6 38 38
1 48 51
4 33 33
6 31 34
1 16 19
1 15 15
1 3 4
4 5 6
6 52 54
4 7 7
2 17 18
1 29 29
4 51 52
1 2 2
5 28 31
1 23 24
1 1 1
4 29 32
1 9 10
6 108
60 26 53 42 32 48 
1 1 4
5 28 28
1 38 38
5 10 13
6 24 25
6 5 6
3 51 51
3 13 16
1 29 30
5 24 24
3 26 29
3 52 53
4 33 35
1 58 60
1 49 52
2 20 22
3 37 40
6 7 8
1 6 9
5 3 4
3 4 6
1 5 5
1 45 45
6 33 34
3 1 2
3 19 19
4 42 42
4 25 26
3 3 3
1 13 15
3 41 44
5 25 27
6 1 4
4 6 9
4 1 3
4 27 30
3 47 50
1 55 57
4 12 14
6 20 23
1 31 33
2 23 26
1 54 54
3 25 25
2 9 11
2 12 15
3 18 18
1 18 18
1 42 44
1 21 23
4 17 18
5 1 1
4 19 19
1 39 41
4 11 11
1 35 37
4 20 22
4 23 23
4 39 41
6 14 15
5 8 9
4 10 10
2 1 3
3 45 46
6 45 48
1 16 17
3 7 10
1 27 27
1 28 28
2 16 19
5 20 23
5 31 32
1 26 26
1 10 12
4 24 24
6 37 40
5 5 7
4 32 32
6 16 19
6 11 12
6 9 10
5 18 19
3 30 32
5 2 2
4 37 38
3 17 17
6 26 28
1 24 25
4 15 16
6 41 44
1 34 34
6 35 36
4 31 31
3 11 12
3 22 24
4 36 36
3 33 36
6 13 13
5 14 17
1 53 53
2 7 8
2 4 6
4 4 5
1 46 48
6 29 32
1 19 20
3 20 21
5 29 30
6 109
41 45 40 36 41 56 
4 22 23
4 5 5
5 17 17
5 7 10
5 31 33
2 12 14
3 6 7
6 33 36
2 30 33
1 25 25
6 28 28
3 10 13
6 12 14
3 1 2
4 17 17
4 32 32
1 30 30
4 13 15
1 32 32
6 45 45
1 18 21
1 40 41
3 21 24
6 5 8
6 4 4
2 39 39
1 34 35
5 19 20
5 16 16
5 27 27
6 19 20
4 24 27
6 42 44
2 22 25
4 16 16
5 18 18
6 9 10
3 32 35
2 21 21
3 38 39
2 6 8
1 13 16
5 14 15
5 34 36
4 18 18
3 17 20
6 26 27
5 4 4
1 10 12
6 41 41
4 10 10
1 36 39
1 26 29
4 11 12
6 47 50
2 9 11
3 9 9
3 25 27
3 40 40
1 17 17
5 28 30
4 28 31
6 24 25
6 46 46
1 22 24
5 21 23
2 43 45
5 40 41
5 1 3
2 36 38
3 8 8
2 15 17
6 37 38
3 36 37
6 1 3
3 28 29
6 15 18
1 33 33
5 11 13
2 2 5
3 3 5
1 31 31
6 29 32
3 14 16
5 5 6
6 39 40
6 23 23
2 40 42
6 11 11
4 8 9
4 1 4
5 24 26
4 19 21
6 55 56
2 28 29
6 21 22
6 54 54
4 6 7
1 3 6
1 1 2
2 1 1
5 37 39
2 34 35
2 26 27
3 30 31
6 51 53
4 33 36
1 7 9
2 18 20
6 116
58 62 34 60 23 47 
6 1 2
4 1 2
4 8 11
3 18 21
1 51 51
2 29 31
3 23 26
5 11 12
5 16 18
2 47 47
1 42 45
1 39 41
4 29 30
6 36 39
6 41 41
4 60 60
4 39 40
6 5 5
6 47 47
5 23 23
2 56 57
1 12 14
5 13 15
6 15 18
1 56 58
4 58 59
4 52 54
2 37 37
6 11 14
4 14 17
1 52 55
3 31 32
2 1 2
4 25 28
1 23 26
3 2 4
6 23 26
2 61 62
6 8 10
1 18 18
2 58 60
2 52 53
6 31 32
1 33 35
2 18 19
1 29 29
2 48 49
5 4 6
3 22 22
1 36 37
5 19 22
1 15 17
4 18 18
2 22 24
2 50 51
3 1 1
6 27 30
4 21 21
3 34 34
5 7 10
6 42 43
2 8 10
4 55 57
6 3 4
3 10 11
2 11 14
4 7 7
3 27 30
3 12 13
3 14 15
1 38 38
3 16 17
2 20 21
4 34 34
4 44 47
2 42 42
6 6 7
4 48 51
6 44 46
2 28 28
4 19 20
4 3 6
1 2 4
6 33 35
4 12 13
1 48 50
5 1 3
2 15 17
1 46 47
1 1 1
3 8 9
4 41 43
4 35 36
1 9 10
2 55 55
6 40 40
6 19 22
4 37 38
2 43 46
3 33 33
1 5 8
2 25 27
2 6 6
4 22 24
1 19 22
2 32 32
2 33 36
1 30 32
2 38 41
1 27 28
4 31 33
2 3 5
2 7 7
3 5 7
1 11 11
2 54 54
6 121
25 47 54 56 48 42 
5 35 37
3 34 36
5 18 18
4 38 38
4 48 48
1 23 25
3 50 50
3 39 42
5 25 27
5 1 1
3 17 18
4 56 56
4 47 47
2 1 4
1 10 11
6 40 42
3 51 52
4 52 52
1 20 22
6 28 29
5 19 21
1 17 17
5 48 48
4 51 51
5 6 8
1 2 2
1 1 1
4 42 44
2 28 29
2 17 19
5 13 15
4 25 27
2 8 11
5 30 30
4 31 31
2 20 21
3 24 25
6 10 11
5 16 17
5 38 40
2 43 44
2 5 7
2 25 27
2 36 37
5 32 34
3 26 27
3 12 15
5 41 43
4 28 30
1 6 7
4 36 37
6 24 27
3 10 11
4 41 41
6 23 23
4 45 46
4 32 33
3 19 20
1 12 12
2 12 15
6 16 19
6 20 22
2 22 24
4 53 55
3 8 9
3 21 22
1 18 19
2 38 40
2 30 33
3 54 54
4 49 49
4 11 14
3 53 53
4 34 35
5 22 24
3 30 33
3 1 1
1 8 9
6 33 35
5 9 11
3 43 43
4 5 6
6 36 37
1 13 16
2 41 42
3 6 7
5 31 31
4 7 10
5 28 29
3 48 48
5 2 2
6 38 39
4 15 18
6 6 9
3 2 5
6 1 2
4 23 24
3 28 28
5 5 5
4 3 4
4 39 40
4 19 22
4 50 50
6 3 4
2 16 16
4 1 2
6 5 5
5 3 4
5 44 47
3 16 16
2 34 35
6 12 15
3 49 49
3 29 29
6 30 32
5 12 12
2 45 47
3 44 47
3 37 38
3 23 23
1 3 5
6 104
22 54 57 28 36 63 
3 17 20
5 21 23
5 5 8
6 2 4
3 5 8
6 8 11
3 14 16
6 12 12
6 37 40
3 2 2
4 23 23
1 6 8
5 24 24
6 49 51
4 12 14
6 24 26
2 14 17
5 35 36
3 48 51
2 24 24
5 25 25
3 46 46
5 15 15
3 1 1
2 4 5
3 36 38
5 20 20
2 18 21
2 48 51
5 26 27
3 55 57
6 16 19
2 36 39
6 32 33
1 22 22
3 39 42
3 3 4
1 10 10
4 15 18
1 14 14
5 10 10
5 1 4
1 4 5
2 31 34
4 4 4
2 1 3
1 1 3
3 32 35
2 25 26
6 53 55
5 11 14
6 41 44
4 5 5
4 2 2
6 60 62
6 20 22
3 52 53
5 9 9
6 52 52
6 5 7
2 12 12
2 45 47
5 33 34
4 6 8
6 29 31
1 9 9
4 27 28
2 13 13
5 16 19
6 23 23
3 9 11
3 54 54
2 35 35
4 1 1
5 28 30
6 34 36
2 9 11
1 11 13
6 63 63
6 45 48
2 40 41
6 56 59
2 42 44
3 47 47
3 21 24
3 25 27
2 28 30
1 15 17
2 52 54
2 22 23
2 6 8
4 3 3
6 1 1
3 28 31
3 43 45
6 27 28
4 24 26
1 18 21
4 19 22
4 9 11
5 31 32
6 13 15
2 27 27
3 12 13
6 113
42 24 50 59 59 33 
6 1 1
1 41 42
4 53 55
5 22 25
6 14 17
4 1 2
2 3 4
3 4 4
4 4 4
6 30 32
6 2 2
4 41 44
2 5 8
6 24 25
3 9 10
3 22 24
1 4 6
6 4 6
5 26 27
3 39 39
5 32 35
4 28 30
4 37 40
3 13 14
2 21 21
5 43 43
5 41 42
6 28 29
1 2 2
4 45 48
2 22 22
5 7 7
4 36 36
3 5 8
5 40 40
1 18 19
2 23 24
5 50 50
3 32 33
2 9 10
5 55 57
1 26 26
1 12 13
4 22 23
2 18 20
2 1 2
3 35 37
4 33 35
1 3 3
4 15 18
3 15 18
1 23 25
2 17 17
2 11 13
4 49 52
4 19 21
3 44 46
6 33 33
5 10 13
4 9 9
5 14 17
4 3 3
5 58 58
2 14 16
6 9 9
4 31 32
1 8 11
5 36 36
6 23 23
4 24 27
1 20 21
1 34 37
5 6 6
1 22 22
5 18 21
6 26 27
6 18 20
3 11 12
5 53 54
3 38 38
1 1 1
4 5 8
5 8 9
4 14 14
1 31 33
6 3 3
5 28 31
1 14 17
3 48 48
3 47 47
5 37 39
3 19 21
3 29 31
6 7 8
6 21 22
4 57 59
5 51 52
5 59 59
1 38 40
6 10 13
4 10 13
3 40 43
3 49 50
1 27 30
1 7 7
5 46 49
3 1 3
3 34 34
3 25 28
5 4 5
5 1 3
5 44 45
4 56 56
6 94
33 60 23 58 30 23 
5 5 7
5 23 24
4 46 48
2 10 11
5 21 22
1 12 12
6 20 20
5 28 30
1 6 8
1 9 9
4 9 12
4 13 16
2 7 7
1 4 5
1 1 3
2 45 45
4 41 43
2 35 36
3 19 21
1 28 30
2 20 20
1 31 33
4 40 40
2 15 18
6 13 13
1 13 16
2 6 6
3 13 15
3 1 1
6 3 6
4 20 23
4 44 44
4 17 19
6 22 23
1 17 17
1 22 24
2 1 2
5 19 20
5 12 15
4 49 49
4 25 28
6 17 19
4 58 58
3 2 5
4 50 52
2 59 60
3 22 23
5 1 4
2 30 30
4 7 8
2 12 14
1 18 21
2 53 55
2 46 46
3 6 9
4 1 3
4 35 38
1 25 27
5 25 27
1 10 11
2 47 50
3 16 18
2 32 34
2 21 23
3 10 10
6 14 16
2 51 52
4 45 45
2 27 29
4 29 32
4 39 39
2 31 31
2 37 37
6 21 21
2 8 9
6 9 10
5 8 11
4 6 6
6 7 8
6 1 2
4 33 34
2 41 44
2 56 58
2 38 40
4 4 5
5 16 18
4 53 54
2 24 26
2 19 19
4 55 57
4 24 24
3 11 12
2 3 5
6 11 12
6 104
30 48 60 49 41 28 
3 59 59
6 11 11
3 41 43
4 19 20
4 29 29
3 21 23
6 26 28
1 1 1
6 17 20
6 6 7
1 9 11
5 40 41
2 5 7
2 40 43
6 1 3
2 10 11
1 25 25
3 37 39
4 18 18
5 16 18
6 13 16
3 1 3
4 21 24
2 39 39
5 13 15
1 29 30
4 45 46
2 1 4
4 34 37
4 11 13
4 14 17
3 13 14
4 31 33
3 26 29
5 1 4
1 23 24
4 38 40
3 24 25
3 53 55
2 44 45
3 44 46
5 8 8
5 30 31
2 48 48
2 37 38
3 10 12
3 56 58
1 8 8
4 41 44
5 5 6
4 5 5
6 12 12
6 4 4
3 47 47
2 27 28
1 26 28
2 33 34
5 27 29
2 46 47
2 8 9
2 14 14
3 30 33
5 7 7
3 40 40
3 34 36
4 47 48
5 34 36
1 13 15
2 12 13
4 25 28
1 20 22
6 24 25
5 37 39
3 19 19
3 52 52
1 2 3
4 49 49
1 16 19
6 21 23
3 4 6
2 22 23
3 48 51
2 35 36
4 9 10
3 20 20
2 29 32
1 12 12
3 15 18
6 5 5
3 7 9
4 1 4
5 23 26
6 8 10
5 9 10
2 15 18
2 24 26
5 32 33
1 4 7
3 60 60
4 30 30
2 19 21
4 6 8
5 11 12
5 19 22
6 71
41 35 30 31 27 22 
3 18 20
3 29 30
3 13 13
2 16 17
4 14 15
1 38 39
2 28 28
3 1 4
2 29 32
4 12 13
6 11 13
4 19 21
4 30 30
4 28 29
2 21 24
1 41 41
1 25 26
1 27 28
2 35 35
1 6 8
3 10 12
2 25 27
5 25 27
6 7 10
6 14 17
1 35 37
2 9 11
5 13 13
3 25 28
5 16 19
1 9 12
4 6 7
5 4 7
1 30 33
4 8 11
4 22 23
1 4 5
1 1 3
5 12 12
6 21 21
1 21 24
4 16 18
2 5 8
4 24 27
3 5 7
1 17 20
6 18 20
1 34 34
1 29 29
4 31 31
6 22 22
2 1 4
3 8 9
5 14 15
2 33 34
4 1 3
1 14 16
2 18 20
3 14 17
2 12 15
5 22 24
3 24 24
6 4 6
5 1 3
3 21 23
1 40 40
6 1 3
1 13 13
5 8 11
5 20 21
4 4 5
6 92
20 59 36 36 40 43 
6 19 22
5 34 36
4 20 20
2 42 45
2 12 14
1 7 9
4 24 27
3 4 7
2 5 7
6 40 42
6 11 13
2 28 31
2 24 25
2 38 41
2 46 47
4 19 19
4 34 36
5 22 24
1 10 10
3 32 32
3 15 18
2 48 49
1 16 18
5 1 4
2 10 11
2 33 35
2 32 32
2 8 9
5 13 13
5 25 26
6 15 18
3 9 12
5 21 21
5 7 7
6 1 3
6 38 39
3 8 8
6 31 32
2 20 23
5 8 8
1 19 20
6 43 43
2 59 59
4 17 18
2 53 55
5 27 29
6 7 9
2 15 16
5 16 17
2 50 52
2 17 19
1 14 15
1 3 6
3 13 14
4 13 16
5 37 38
6 23 25
6 27 30
6 14 14
6 26 26
2 56 58
3 28 31
4 4 4
2 36 37
6 33 34
5 5 6
3 1 1
4 1 3
4 9 12
6 35 37
3 2 3
3 27 27
1 1 2
5 12 12
5 14 15
4 28 29
4 21 23
5 9 10
6 10 10
4 30 33
5 11 11
4 5 8
2 26 27
6 4 6
5 18 20
5 30 33
5 39 40
2 1 4
3 23 26
3 19 22
1 11 13
3 33 36
6 91
35 63 22 28 47 31 
1 18 21
5 5 5
2 58 59
6 5 7
4 13 16
2 24 25
3 8 11
3 18 18
2 11 12
1 7 9
1 22 25
3 16 17
4 19 22
2 1 3
1 28 31
3 22 22
2 28 30
2 31 32
5 29 29
1 35 35
4 9 12
5 4 4
6 16 17
2 56 57
2 48 49
6 27 27
2 36 37
1 32 34
3 2 5
5 27 28
2 50 53
3 19 21
5 1 3
2 45 46
5 41 44
4 17 17
6 23 23
6 28 28
5 15 16
4 1 4
2 33 33
5 47 47
5 22 25
1 1 2
2 42 44
2 20 23
5 34 37
5 46 46
6 8 10
3 12 15
6 1 4
4 18 18
6 24 26
5 30 33
2 34 35
5 10 11
5 45 45
4 26 28
2 40 41
6 21 22
2 7 7
1 26 27
2 54 54
2 47 47
5 38 40
1 10 12
6 18 20
5 21 21
1 13 13
1 3 6
3 1 1
6 11 13
6 14 15
2 55 55
5 26 26
2 13 14
2 15 16
1 14 17
5 6 9
2 17 19
5 12 14
4 23 25
5 17 20
2 8 10
4 5 8
2 26 27
2 38 39
2 60 63
3 6 7
2 4 6
6 29 31
6 91
33 30 23 55 46 40 
4 53 55
2 27 29
4 49 52
6 28 31
4 40 41
3 22 23
2 16 16
2 23 26
5 41 42
1 10 10
3 4 4
5 27 29
4 28 29
2 10 12
6 23 25
5 30 30
4 30 32
5 44 44
4 21 24
6 1 2
6 18 20
6 33 34
1 27 28
3 5 6
3 7 7
5 31 31
3 19 21
4 45 47
1 33 33
6 39 40
1 19 19
6 26 27
5 35 38
6 35 38
5 45 46
5 17 18
2 30 30
3 13 14
1 15 18
6 3 3
3 8 9
5 26 26
1 23 23
3 18 18
5 39 40
3 15 16
6 16 17
5 13 16
6 21 22
6 32 32
5 32 34
5 19 21
5 8 8
4 17 20
4 13 16
4 33 36
1 24 26
2 13 15
5 9 12
2 20 22
4 37 39
2 1 3
6 5 8
4 10 12
1 11 14
1 7 9
2 17 19
1 5 6
1 20 22
5 4 4
6 4 4
5 5 7
4 25 27
4 6 9
5 1 3
1 31 32
5 22 25
4 2 5
3 10 12
1 29 30
4 48 48
2 4 7
3 1 3
2 8 9
3 17 17
6 9 12
5 43 43
4 42 44
1 1 4
6 13 15
4 1 1
6 113
60 24 33 35 53 58 
3 29 32
6 45 46
6 17 20
5 28 28
6 26 26
2 12 14
3 19 21
3 27 27
2 18 19
6 58 58
5 51 51
6 29 31
4 13 15
1 17 19
1 49 49
5 22 22
5 33 34
5 48 50
5 39 39
4 6 8
2 1 3
5 45 45
2 15 17
3 5 7
5 46 47
5 19 21
3 28 28
2 24 24
1 41 44
5 24 25
4 4 4
3 22 23
1 46 48
1 58 60
6 32 34
1 1 3
2 20 23
1 31 31
5 8 10
2 4 7
6 8 11
5 35 38
6 1 3
6 56 57
5 26 27
6 52 55
1 6 8
3 8 11
6 5 7
5 23 23
1 14 15
4 5 5
6 49 51
4 23 26
3 16 17
5 6 7
6 15 16
4 27 27
1 34 37
1 20 23
3 3 4
6 44 44
5 14 16
6 23 25
3 18 18
5 52 53
5 12 12
1 32 33
6 21 22
1 9 9
4 17 20
5 29 32
1 54 56
1 16 16
4 1 3
1 4 5
1 24 26
5 41 41
4 16 16
2 8 10
1 50 53
1 57 57
6 12 14
6 27 28
1 10 13
6 47 48
4 21 22
6 35 36
5 42 44
6 4 4
4 31 32
5 5 5
4 28 30
5 1 1
6 42 43
1 45 45
4 33 35
5 17 18
3 1 2
5 13 13
3 24 26
4 11 12
5 40 40
6 39 41
4 9 10
1 27 30
5 11 11
5 2 4
3 12 15
3 33 33
1 38 40
6 37 38
2 11 11
6 125
39 58 44 57 44 60 
1 10 10
4 7 7
2 51 51
2 39 41
2 52 53
3 22 22
2 50 50
5 1 4
6 55 57
5 18 19
2 32 34
2 5 5
6 58 60
6 6 6
5 42 43
6 24 24
4 57 57
1 25 28
1 39 39
2 16 18
6 1 2
6 19 20
6 25 28
2 54 57
4 15 17
5 39 41
3 23 26
4 21 21
1 36 38
2 19 22
2 27 29
3 18 18
6 7 9
6 47 50
5 25 28
3 31 33
2 48 49
2 58 58
4 53 53
3 41 44
5 13 14
3 34 37
4 18 18
5 31 34
4 5 6
1 29 29
4 34 34
6 3 5
1 15 17
1 23 23
4 46 49
4 43 45
6 21 23
5 15 17
2 23 23
6 14 15
5 23 24
3 15 17
3 6 9
4 22 25
4 26 26
3 30 30
3 27 27
2 14 14
3 3 5
3 10 12
4 8 9
1 1 4
6 10 10
2 6 6
5 29 30
1 8 9
6 16 17
1 19 22
2 42 45
6 18 18
6 38 39
1 24 24
1 11 14
1 6 7
5 10 12
3 19 21
4 10 13
6 44 46
1 33 35
2 37 38
5 38 38
2 12 13
5 44 44
5 5 7
2 46 47
4 1 4
5 35 37
3 1 2
4 54 56
4 27 29
6 40 41
3 28 29
6 11 13
1 5 5
2 24 26
3 13 14
3 38 40
4 19 19
4 50 52
2 7 8
6 51 54
2 35 36
6 29 29
2 9 11
6 30 33
4 30 33
2 15 15
5 8 9
1 18 18
5 20 22
2 30 31
2 1 4
4 39 42
1 30 32
4 35 38
6 42 43
4 20 20
6 34 37
4 14 14
6 121
63 59 42 30 38 57 
1 4 5
2 45 47
4 30 30
3 22 25
2 11 11
5 7 10
6 30 31
4 11 13
2 41 44
5 20 21
6 34 37
2 26 28
3 2 2
1 19 22
3 3 6
1 29 30
6 17 19
1 18 18
6 9 9
1 7 8
5 27 28
1 11 11
6 53 54
1 1 3
5 32 34
1 53 53
2 23 23
2 29 31
5 22 22
4 7 10
3 30 33
1 13 15
3 34 37
5 11 12
1 40 41
1 59 62
6 46 49
3 17 18
6 51 52
2 6 8
6 1 4
3 26 29
1 23 23
2 36 39
4 2 5
4 21 22
5 4 6
2 58 58
2 51 51
5 14 16
1 48 49
2 40 40
3 38 38
1 31 32
2 48 50
4 19 20
1 45 46
3 7 10
1 24 25
2 59 59
2 9 10
1 38 39
2 13 13
6 20 23
3 19 21
5 29 31
5 23 25
1 50 52
1 57 58
5 38 38
6 29 29
6 25 28
1 12 12
2 25 25
6 16 16
2 2 5
1 16 17
4 23 26
6 42 45
3 1 1
1 42 44
2 24 24
6 32 33
6 38 41
5 1 3
2 52 53
1 47 47
2 54 57
6 24 24
3 15 16
3 41 42
3 14 14
4 14 15
1 26 28
3 11 13
5 17 19
2 14 17
1 9 10
1 54 56
1 63 63
2 18 18
5 35 37
2 19 22
1 6 6
6 55 57
4 16 18
6 14 15
1 36 37
6 50 50
4 1 1
2 12 12
1 33 35
3 39 40
2 1 1
2 32 35
4 27 29
6 5 8
5 13 13
6 10 13
5 26 26
4 6 6
6 93
20 39 47 21 40 58 
1 7 7
5 7 10
4 6 8
3 27 30
2 9 11
3 6 7
1 17 17
3 23 23
6 35 35
1 1 4
6 40 41
3 32 34
5 15 17
2 4 4
3 46 47
3 13 14
2 1 3
1 12 14
2 35 38
3 19 22
4 3 5
6 31 31
6 19 21
1 19 20
1 10 11
2 12 14
6 26 27
2 31 34
3 12 12
3 24 26
5 11 14
5 4 5
2 22 23
6 52 55
1 15 16
1 5 6
4 13 15
6 57 57
2 18 21
6 56 56
6 22 25
4 20 21
5 24 26
6 34 34
6 36 39
6 29 29
4 16 17
6 30 30
6 49 49
6 9 9
6 16 18
6 14 15
3 1 4
2 27 30
2 15 17
4 18 19
3 37 39
3 31 31
5 19 22
6 10 13
6 32 33
6 5 7
6 8 8
2 5 5
5 27 27
5 18 18
5 28 31
6 50 51
5 1 3
2 39 39
3 40 43
3 18 18
6 28 28
1 8 9
6 1 4
1 18 18
2 6 8
4 1 2
2 24 26
3 8 11
5 37 40
5 23 23
3 35 36
5 6 6
5 32 35
3 15 17
4 9 12
3 44 45
6 58 58
6 42 45
6 46 48
3 5 5
5 36 36
0 0

AC out:

Code: Select all

Case 1: 163

Case 2: 175

Case 3: 204

Case 4: 237

Case 5: 223

Case 6: 201

Case 7: 212

Case 8: 221

Case 9: 222

Case 10: 203

Case 11: 170

Case 12: 207

Case 13: 145

Case 14: 189

Case 15: 169

Case 16: 182

Case 17: 220

Case 18: 229

Case 19: 230

Case 20: 168



red_apricot
New poster
Posts: 48
Joined: Sun Jun 22, 2014 6:14 am

Re: 1064 - Network

Post by red_apricot » Thu Nov 26, 2015 6:44 am

How the answer for

Code: Select all

3 9
5 5 5
1 4 4
2 3 4
2 1 2
3 1 1
1 1 3
2 5 5
3 4 5
3 2 3
1 5 5
0 0
can be 6? For ordering "2 1 3" I'm getting 5.

txomin2091
New poster
Posts: 4
Joined: Fri Feb 17, 2017 7:22 pm

Re: 1064 - Network

Post by txomin2091 » Sat May 19, 2018 8:32 pm

the response from my AC code is "Case 1: 5"

the process (note that message_number is represented message_number-1 in this trace):
R #0 4 4 to buffer mem 1 (max 1)
R #1 3 4 to buffer mem 3 (max 3)
R #1 1 2 passed
e #1 3 4 buffer out mem:1
R #2 1 1 to buffer mem 2 (max 3)
R #0 1 3 to buffer mem 5 (max 5)
R #1 5 5 passed
e #0 1 3 buffer out mem:2
e #0 4 4 buffer out mem:1
R #2 4 5 to buffer mem 3 (max 5)
R #2 2 3 to buffer mem 5 (max 5)
R #0 5 5 passed
e #2 1 1 buffer out mem:4
e #2 2 3 buffer out mem:2
e #2 4 5 buffer out mem:0
>> max buff == 5

remember: "Note that unlike actual buffering systems, the process for this problem can look ahead at all incoming packets to make its decisions."

regards

Post Reply

Return to “Volume 10 (1000-1099)”