Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 7faac51

Browse files
committed
A WORKING VERSION
Finally a working VERSION
1 parent 36d0480 commit 7faac51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

convention2.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7655
1+
10

src/convention2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public int compare(cow arg0, cow arg1) {
3636
//System.out.println(time);
3737
while(cows_eaten < N || theline.size() > 0) {
3838
if(theline.isEmpty()) {
39-
tc = time.get(cows_eaten);
39+
tc = time.get(cows_eaten++);
4040
ctime = tc.x;
4141
}else {
4242
tc = theline.remove(0);
@@ -50,9 +50,9 @@ public int compare(cow arg0, cow arg1) {
5050
//cow nextcow = new cow(-1,-1); // Not guaranteed to have a conflicting time
5151
int count = 0;
5252
while(cows_eaten<N &&time.get(cows_eaten).x < ctime) {
53+
theline.add(time.get(cows_eaten));
5354
cows_eaten++;
5455
count ++;
55-
theline.add(time.get(cows_eaten));
5656
}
5757
if(count>0) {theline.sort(cowcompare);}
5858
}

0 commit comments

Comments
 (0)