|
@ -19,16 +19,16 @@ class bcolors: |
|
|
if len(sys.argv) < 2 or sys.argv[1] != "status": |
|
|
if len(sys.argv) < 2 or sys.argv[1] != "status": |
|
|
results = json.loads(''.join(sys.stdin.readlines())) |
|
|
results = json.loads(''.join(sys.stdin.readlines())) |
|
|
|
|
|
|
|
|
resultsScore = {} |
|
|
|
|
|
with open('scores') as f: |
|
|
|
|
|
for line in f: |
|
|
|
|
|
tmp = line.strip().split(' ') |
|
|
|
|
|
key = tmp[0]+"."+tmp[1] |
|
|
|
|
|
if not key in resultsScore: |
|
|
|
|
|
resultsScore[key] = int(tmp[2]) |
|
|
|
|
|
#else: |
|
|
|
|
|
# print "Score alredy present for " + tmp[0] + " " + tmp[1] |
|
|
|
|
|
f.close() |
|
|
|
|
|
|
|
|
resultsScore = {} |
|
|
|
|
|
with open('scores') as f: |
|
|
|
|
|
for line in f: |
|
|
|
|
|
tmp = line.strip().split(' ') |
|
|
|
|
|
key = tmp[0]+"."+tmp[1] |
|
|
|
|
|
if not key in resultsScore: |
|
|
|
|
|
resultsScore[key] = int(tmp[2]) |
|
|
|
|
|
#else: |
|
|
|
|
|
# print "Score alredy present for " + tmp[0] + " " + tmp[1] |
|
|
|
|
|
f.close() |
|
|
|
|
|
|
|
|
if len(sys.argv) < 2 or sys.argv[1] != "status": |
|
|
if len(sys.argv) < 2 or sys.argv[1] != "status": |
|
|
strategy = "unknown" if len(sys.argv) < 2 else sys.argv[1] |
|
|
strategy = "unknown" if len(sys.argv) < 2 else sys.argv[1] |
|
@ -42,13 +42,14 @@ if len(sys.argv) < 2 or sys.argv[1] != "status": |
|
|
else: |
|
|
else: |
|
|
print "Missing score for " + str(results[i]['problemId']) + " " + str(results[i]['seed']) |
|
|
print "Missing score for " + str(results[i]['problemId']) + " " + str(results[i]['seed']) |
|
|
sys.exit(1) |
|
|
sys.exit(1) |
|
|
|
|
|
problemIdForGlob = str(results[0]['problemId']) + '.' |
|
|
else: |
|
|
else: |
|
|
results=[{'problemId':''}] |
|
|
|
|
|
|
|
|
problemIdForGlob = '' |
|
|
|
|
|
|
|
|
solutionsToSend=[] |
|
|
solutionsToSend=[] |
|
|
scores = {} |
|
|
scores = {} |
|
|
lastProblem = "" |
|
|
lastProblem = "" |
|
|
for solution in sorted(glob.glob(solutionsDir + str(results[0]['problemId']) + '.*'), reverse=True): |
|
|
|
|
|
|
|
|
for solution in sorted(glob.glob(solutionsDir + problemIdForGlob + '*'), reverse=True): |
|
|
problemHash = solution[:solution.rfind(".", 0, solution.rfind(".")) if solution.count('.') == 3 else solution.rfind(".")] |
|
|
problemHash = solution[:solution.rfind(".", 0, solution.rfind(".")) if solution.count('.') == 3 else solution.rfind(".")] |
|
|
if lastProblem != problemHash: |
|
|
if lastProblem != problemHash: |
|
|
lastProblem = problemHash |
|
|
lastProblem = problemHash |
|
@ -80,7 +81,7 @@ else: |
|
|
tags[serverResults[serverResult]['tag']] = 1 |
|
|
tags[serverResults[serverResult]['tag']] = 1 |
|
|
else: |
|
|
else: |
|
|
tags[serverResults[serverResult]['tag']] += 1 |
|
|
tags[serverResults[serverResult]['tag']] += 1 |
|
|
print "Submitted solution: %d"%len(solutionsToSend) |
|
|
|
|
|
|
|
|
print "Submitted solution: %d"%len(serverResults) |
|
|
for solutionToSend in solutionsToSend: |
|
|
for solutionToSend in solutionsToSend: |
|
|
key = str(solutionToSend['problemId'])+"."+str(solutionToSend['seed']) |
|
|
key = str(solutionToSend['problemId'])+"."+str(solutionToSend['seed']) |
|
|
if not key in serverResults: |
|
|
if not key in serverResults: |
|
|