Back to General discussions forum
Taking the example of entry 26 and 136 the checker informs us of two solutions, however there are three,
the third is: 9 GIRLS 2 PIGS of 59 BREAST. my code has calculated the values correctly but obviously it gives
error, I allow myself to share it.
import math
loops=int(input())
for i in range(loops):
A,B=map(int,input().split())
PosiblesSoluciones=0
for n in range(B):
if n!=4:
cerdos=(A-B)/(4-n)
chicas=(B-n*cerdos)/2
if int(chicas)==chicas and int(cerdos)==cerdos and cerdos>=0 and chicas>=0:
#print("girls",chicas," picgs", cerdos," . sum: ")
PosiblesSoluciones+=1
print(PosiblesSoluciones,"")
I hope that this situation can be resolved promptly.
Hi Friend and thanks for your message!
I hope that this situation can be resolved promptly.
I think I can help. The statement says: "We also assume this number [of breasts] is even for pigs", e.g. solution with 59 is not suitable.
Sorry for it is not highlighted. I can add this (as repetition) to example explanation if you think it will help other colleagues...
By the way it's amusing to read the variable names in, eh... Spanish? I think we have some words loaned from Spanish :)
Have a good day and my congratulations on such a high rank!
MULTIVAC
Position: #484 (among top 1.3%)
Very Good! :)
thank you very much! yepp i am from Colombia, thats spanish.
Добавьте пожалуйста в описание критерий четности грудей свиней. "Любое количество грудей" очень путает.
Please add the note about even number of breasts, it's confusing otherwise.
Внизу под входными данными уже есть заметка по этому поводу: / there is a note on this alread, at the bottom
Note: of course we assume that all pigs have the same number of breasts... We also assume this number is even for pigs (as for most mammals)...
Проморгал, прошу прощения. / ah, sorry, never mind
Friends, please prefer English (no worry if with mistakes), at least until subforums for local languages are implemented :)
Not that anything is wrong with Russian particularly - it's just a bit impolite to talk in the language others don't understand well (either Russian or Indonesian etc).
Or feel free to contact me directly via VK.