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
{{ message }}
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: src/convention2.java
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -34,17 +34,21 @@ public int compare(cow arg0, cow arg1) {
34
34
intmaxsenority;
35
35
System.out.println(time);
36
36
while(cows_eaten < N) {
37
+
if(theline.isEmpty()) {
37
38
tc = time.get(cows_eaten);
39
+
}else {
40
+
tc = theline.remove(0);
41
+
}
38
42
maxsenority = -1;
39
43
cownextcow = newcow(-1,-1); // Not guarented to have a conflicting time
40
44
intj = 0;
41
45
while(true) {
42
-
j++;
43
-
if(time.get(cows_eaten + j).x >= tc.x+tc.y || theline.contains(time.get(cows_eaten + j))) { // If after the current cow is finsihed then all cows after it we don't have to worry about
46
+
cows_eaten++;
47
+
if(time.get(cows_eaten).x >= tc.x+tc.y || theline.contains(time.get(cows_eaten))) { // If after the current cow is finsihed then all cows after it we don't have to worry about
0 commit comments