Why the hack it gives me always "wrong answer test set skipped"?
It works on my local machine but on the server, it seems the answer is wrong,
why??
Am I not considering the input?
look this is my code for 2018 Burger Optimization problem
from itertools import permutations
def burger():
output = {}
for repeat in range(1, int(input())+ 1):
ingredients = int(input())
distance_ingredients = [int(x) for x in input().split()]
totpermutations = permutations(distance_ingredients)
value = 999999
if len(distance_ingredients) > 4:
for distance in totpermutations:
value = min(value, (distance[0] - 0) ** 2 + (distance[1] - 1)
** 2 + sum(
[(i - 2) ** 2 for i in distance[2:-2]]) + (distance[-2] -
1) ** 2 + (distance[-1] - 0) ** 2)
if len(distance_ingredients) == 4:
for distance in totpermutations:
value = min(value, (distance[0] - 0) ** 2 + (distance[1] - 1)
** 2 + (distance[-2] - 1) ** 2 + (
distance[-1] - 0) ** 2)
if len(distance_ingredients) == 3:
for distance in totpermutations:
value = min(value, (distance[0] - 0) ** 2 + (distance[1] - 1)
** 2 + (distance[-1] - 0) ** 2)
if len(distance_ingredients) == 2:
for distance in totpermutations:
value = min(value, (distance[0] - 0) ** 2 + (distance[1] - 1)
** 2)
if len(distance_ingredients) == 1:
for distance in totpermutations:
value = min(value, (distance[0] - 0) ** 2)
output[repeat] = "Case #{}: {}".format(repeat, value)
# print("Case #{}: {}".format(repeat, value))
return "\n".join(output.values())
print(burger())
Why the server doesn't like any of my submission, also others exercises, same
thing.
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/0cd30879-3358-49c1-aad3-473f528d284a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.