Posted by vollmond on Sun 20 Jul 18:45
report abuse | download | new post
- //SearchEngines - Google codejam
- class Timetable {
- println "Usage: <command> <path to input>"
- }
- processData()
- }
- timeForNums = true
- testCase++
- seenFirstLine = true
- }
- timeForNums = false
- numTripsFromA--
- numTripsFromB--
- }
- }
- }
- }
- }
- processData()
- }
- def startA = 0
- def startB = 0
- availA = 0
- availB = 0
- def curTime
- sortTrips()
- //println "turnaround = ${turnaround} \n $trips"
- curTime = trip.depart
- updateTimes(curTime)
- availA--
- startA++
- }
- availB--
- startB++
- }
- }
- }
- println "Case #${testCase}: ${startA} ${startB}"
- }
- availB++
- availA++
- }
- }
- }
- }
- minutes += turnaround
- hours++
- minutes -= 60
- }
- minutes = "0${minutes}"
- }
- hours = "0${hours}"
- }
- return "${hours}:${minutes}"
- }
- def tmp
- swapped = false
- (trips[i].depart == trips[i+1].depart && trips[i].arrive > trips[i+1].arrive)) {
- swapped = true
- tmp = trips[i]
- trips[i] = trips[i+1]
- trips[i+1] = tmp
- }
- }
- }
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.