Changes
3 changed files (+7/-1)
-
-
@@ -26,6 +26,8 @@ int x5 = Integer.parseInt(st.nextToken());int y5 = Integer.parseInt(st.nextToken()); int x6 = Integer.parseInt(st.nextToken()); int y6 = Integer.parseInt(st.nextToken()); br.close(); // the visible area is the sum of the visible area of the first billboard and the second billboard int combinedArea = visibleArea(x1, y1, x2, y2, x5, y5, x6, y6) + visibleArea(x3, y3, x4, y4, x5, y5, x6, y6);
-
-
-
@@ -17,6 +17,8 @@ day[i] = Integer.parseInt(st.nextToken());cow[i] = st.nextToken(); change[i] = Integer.parseInt(st.nextToken()); } br.close(); // the milk variables track the amount of milk that each cows was last known to produce int bessieMilk = 7, elsieMilk = 7, mildredMilk = 7;
-
@@ -41,7 +43,7 @@ }} // compute the highest milk total and see which cows produced the most milk int highestMilk = Math.max(bessieMilk, Math.max(elsieMilk, mildredMilk)); boolean bessieOnNext = bessieMilk == highestMilk; boolean bessieOnNext = (bessieMilk == highestMilk); boolean elsieOnNext = elsieMilk == highestMilk; boolean mildredOnNext = mildredMilk == highestMilk; if(bessieOn != bessieOnNext || elsieOn != elsieOnNext || mildredOn != mildredOnNext) {
-
-
-
@@ -27,6 +27,8 @@ st = new StringTokenizer(br.readLine());for(int i = 1; i <= n; i++) { finalLocs[i] = Integer.parseInt(st.nextToken()); } br.close(); // allocate an array to store the original locations of all cows int[] originalLocations = new int[n+1];
-