|
|
back to boardWhy "Wrong Answer" what is wrong with my program? I used Python code below: n = input() list = n.split() n = int(list[0]) k = len(list[1]) if (n < k): p = k else: p = n
i=2 num = n - k if (n>=1 and n<=10) and (k>=1 and k<=20) and (num > 0): if((n%k) == 0): while(num>k): p = p*num num = n-i*k i=i+1 p = p*k else: while(num>(n%k)): p = p*num num = n-i*k i=i+1 p = p*(n%k) print(p) Edited by author 17.06.2022 20:39 Re: Why "Wrong Answer" Don't confuse it, (n mod k) or k are not the final factors!! skip these lines p = p*k and p = p*(n%k) |
|
|