# Temperatures puzzle discussion

#716

You complicate too much just append them to one array and do one pass of the values with checking for value. You have constrains for the input just init to value like 10000.

``````result = cur = 10000
for c in tmp:
if abs(c) < cur:
cur = abs(c)
result = c``````

#717

wait, what?

#718

#719

I have exactly the same problem with this.
Maybe itâs a bug so we canât pass this test

Edit: Iâve just figured it out after I replied to you XD

#720

This is the moment where I realize how handy C# is when you are coming from C++.
There is no need to worry about the case if there are no values delivered because a int is 0 per default. Not so in C++âŚ

#721

Bonjour, je dĂŠbute sur codingame, et je ne comprends pas le message dâerreur :
voici mon code, si une bonne Ă˘me passe da

#722

Bonjour, je dĂŠbute sur codingame, et je ne comprends pas le message dâerreur :
SyntaxError: invalid syntax
at Answer.py. not in a function on line 17
(câest la ligne du else if)
voici mon code, si une bonne Ă˘me passe dans les paragesâŚ

``````import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

result = 0

n = int(input())  # the number of temperatures to analyse
for i in input().split():
# t: a temperature expressed as an integer ranging from -273 to 5526
t = int(i)
if math.fabs(t) < math.fabs(result) :
result = t
else if ( math.fabs(t) == math.fabs(result) ) :
if t > result : # found same value, but positive

print ("resultat : ", result)

# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr)

print("result")``````

#723

Itâs elif in Python, not else if.

#724

Itâs elif in Python, not else if.

#725

Thanks !
Iâam Pyhthon beginner, Iâve been found out
Best regards,
SG

#726

It appears that the C++ test cases are broken. Here are my results for the first 2 (âfoundâ is my answer, âexpectedâ is the test caseâs answer):

Simple test case
Standard Output Stream:
1
-2
-8
4
5
0

Failure
Found: 0
Expected: 1

My Explanation: 0 is closer to 0 than 1

Only negative numbers
Standard Output Stream:
-12
-5
-137
-1

Failure
Found: -1
Expected: -5

My Explanation: -1 is closer to 0 than -5

#727

You can have a look at the test cases using the button at the top left corner of the testcases panel:

#728

je confirme la remarque de NewBo merci pour lâinfo.

#729

i check mi code en C#, and it works perfectly, but in two test (3,4), not work, and when i send my answer even test 1 fails. plz check it

#730

There is most likely one (or more) bug(s) in your code. Please check it.

#731

My solution passes all the tests but when I submit, the score computer seems to freeze.

#732

We had an issue yesterday with the submits. Itâs solved.

#733

What are the testcases 7 and 8? they are not shown in the list of cases to execute. it ends at 6.

#734

they are shown in the results panel, arenât they?

#735

results panel yes, and there I was surprised to learn I failed test 7. The test cases panel only goes to 6.