Posted by vollmond on Sun 20 Jul 03:56
report spam | download | new post
- //SearchEngines - Google codejam
- class SearchEngines {
- println "Usage: <command> <path to input>"
- }
- def numEngines
- def numQueries
- def state
- testCase = 1
- state = "engines"
- engines.add(line)
- numEngines--
- state = "queries"
- }
- queries.add(line)
- numQueries--
- state = "engines"
- processData()
- testCase++
- }
- }
- }
- processData()
- }
- def i = 0
- count++
- engine = getBestEngine()
- }
- queries.remove(0)
- }
- println "Case #${testCase}: ${count}"
- }
- def bestEngine
- def bestCount = 0
- bestCount = count
- bestEngine = engine
- }
- done = true
- count++
- }
- }
- }
- bestCount = count
- bestEngine = engine
- }
- }
- return bestEngine
- }
- }
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.