Browse Source

new solutions

adaptedStrategy0
kaos 9 years ago
parent
commit
1a2ceda1e4
3 changed files with 16 additions and 13 deletions
  1. +14
    -13
      filterResults.py
  2. +1
    -0
      solutions/1.0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000315.lilik0b
  3. +1
    -0
      solutions/6.0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003261.lilik0b

+ 14
- 13
filterResults.py View File

@ -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:


+ 1
- 0
solutions/1.0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000315.lilik0b View File

@ -0,0 +1 @@
{"seed": 0, "tag": "lilik0b", "solution": "ia! ia!", "problemId": 1}

+ 1
- 0
solutions/6.0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003261.lilik0b View File

@ -0,0 +1 @@
{"seed": 0, "tag": "lilik0b", "solution": "iiiiiiiimmiiiiiimimmiiiimimimmimimimimmimimimeemimeeeemimimimimiiiiiimmeemimimimimiimimimmeemimimimmeeeemimimimmiiiiiipmiimimimeeemmimimmemimimimiiiiiimeeemimimimimeeemimimimmiiiimemimimmiiiipimeeemimimmiiiippmeeeeemimimimiiiimmimimeemimimeeeemimimiiiipmeeemmimmiimimmmimimeemimimimmeeemimiiiiipmiiiimmeeemimimiiiipmmiipmmimmiippimemimeeeemimmiipppmeeeeemimimmiimipmeeeemimimiimmeeeeemimmeemimmeeeemimiiippmiippmiiimmiimimmmmmeeeemimmiippimmimimeemimimimmeemimimimmeemimimimiimimimeeemmimimmmiiiiipimeemimimimmiiiimimmiiiiiiiimiimimimimeeemmimimimmiiiiiimimmemimimimimmimimimeemimiiiiiiiimiiiimimimiimimimmimmimimimimmeeeemimimimimmmimimimimeemimimimimmmemimimmiiiiiiimiimimimmiiiiiimeeeeemimimimimmimimimmmmemimimmeeeemimimimmiimimimmiiiiiipmeeeeemimimimimmiiiiimmemimimimimmmmimimmeeeemimimimimeeemimimimmiimimimeeemmimimmiiiiiiimimiiiiiimimmiiiiiiiimmimimimimiiiimimimeemimimimimmeeemimimimimiiiiiiimiiiimimmemimimimmeemimimimeeemmimimmiiiiiimmiiiipmmiiimmmimimeemimimeeemmimmiiiippmiiiimiiippimiimimeemimimeeeemimimiiiipmeemimimiimiimimmimeeemimimmippipmmiimemimmipimeeeemimmeemimiippimeeeeemimimmmimmmeeeemimimiiipimmiipmemimmeeeemimimiipipimmipppimeeemimmpppmmpmeeeeemimmemm", "problemId": 6}

Loading…
Cancel
Save