You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Project contains all examples and description is pdf format)
3
+
### Practice Problem for Google Hash Code 2017
7
4
8
5
### Introduction
6
+
9
7
Did you know that at any given time, someone is cutting pizza somewhere around the world? The decision
10
8
about how to cut the pizza sometimes is easy, but sometimes it’s really hard: you want just the right amount
11
9
of tomatoes and mushrooms on each slice. If only there was a way to solve this problem using technology...
@@ -41,27 +39,18 @@ lines terminated with a single ‘\n’ character at the end of each line (UNIX-
41
39
42
40
The file consists of:
43
41
- one line containing the following natural numbers separated by single spaces:
44
-
- R (1 ≤ R ≤ 1000) is the number of rows
45
-
- C (1 ≤ C ≤ 1000) is the number of columns
46
-
- L (1 ≤ L ≤ 1000) is the minimum number of each ingredient cells in a slice
47
-
- H (1 ≤ H ≤ 1000) is the maximum total number of cells of a slice
48
-
49
-
*Google 2017, All rights reserved.*
42
+
- R (1 ≤ R ≤ 1000) is the number of rows
43
+
- C (1 ≤ C ≤ 1000) is the number of columns
44
+
- L (1 ≤ L ≤ 1000) is the minimum number of each ingredient cells in a slice
45
+
- H (1 ≤ H ≤ 1000) is the maximum total number of cells of a slice
50
46
51
-
R lines describing the rows of the pizza (one after another). Each of these lines contains C
47
+
-R lines describing the rows of the pizza (one after another). Each of these lines contains C
52
48
characters describing the ingredients in the cells of the row (one cell after another). Each character
53
49
is either ‘M’ (for mushroom) or ‘T’ (for tomato).
54
50
55
51
**Example**
56
52
57
-
- 3 5 1 6
58
-
- TTTTT
59
-
- TMMMT
60
-
- TTTTT
61
-
62
-
3 rows, 5 columns, min 1 of each ingredient per slice, max 6 cells per slice
63
-
64
-
**Example input file.**
53
+

65
54
66
55
**Submissions**
67
56
@@ -72,23 +61,11 @@ The file must consist of:
72
61
- U lines describing the slices. Each of these lines must contain the following natural numbers separated by single spaces:
73
62
- r 1 , c 1 , r 2 , c 2 describe a slice of pizza delimited by the rows r (0 ≤ r1,r2 < R, 0 ≤ c1, c2 < C) 1 and r 2 and the columns c 1 and c 2 , including the cells of the delimiting rows and columns. The rows ( r 1 and r 2 ) can be given in any order. The columns ( c 1 and c 2 ) can be given in any order too.
74
63
75
-
**Example**
76
-
77
-
- 0 0 2 1
78
-
- 0 2 2 2
79
-
- 0 3 2 4
80
64
81
-
3 slices.
82
-
- First slice between rows (0,2) and columns (0,1).
83
-
- Second slice between rows (0,2) and columns (2,2).
84
-
- Third slice between rows (0,2) and columns (3,4).
0 commit comments