0
What's problem with my code working well still not matching results of last input
me=input() agent=int(input()) names=input() names1=names.split(" ") names1.append(me) names1.sort() aav=names1.index(me) n="" x="" for i in range(0,int(aav)+1,agent ): n=n+str(i) n.split(" ") n=list(n) for j in n: j=int(j)+1 x=j*20 print (x)
4 ответов
+ 3
Tharyabha Manek
You can solve this just using math, no loops are needed.
Add 1 to your index 'aav' and divide by the number of agents (round up if not a whole number) to get the group block you will be in. Then multiply that number by 20.
+ 1
ChaoticDawg thanks for your consern :)
i will recreate it like you said later
currently i want to understand problem in my code
edit:it worked thanks:)
0
Simon Sauter sir you should ignore me i don't think i will follow any rules except legal i like my foolishness so either enjoy me or ignore me