0
On Submission Wrong Answer ? What is wrong with my code?
this is my coding question ``` https://www.codechef.com/problems/CIELRCPT ``` this is my code ``` try: for i in range(int(input())): p = int(input()) n = p menu = 0 rem = 0 stri = '' while n > 0: rem = n % 2 stri = stri + str(rem) n = n - rem n = n // 2 stri = stri[::-1] if p in range(1,2049): for j in stri: menu += int(j) print(menu) else: for j in stri: menu += int(j) if menu == 1: print(p//2048) else: print(menu) except: pass ```
2 odpowiedzi
+ 1
I could be wrong but I believe It may detect a syntax error or two somewhere around the stri = " line.
0
I dont see anything wrong. If i put sample inputs. Output Is same as sample Output.
What error do you get?