r/competitivprogramming • u/[deleted] • Apr 03 '20
I solved, but the website isn't accepting.
can someone please tell me why isn't my code acceptable to the website
here's the problem:
https://hack.codingblocks.com/app/practice/6/1051/problem
here's my code:
lister = []N,M,K,S = input().split()lister.append(int(N))lister.append(int(M))lister.append(int(K))lister.append(int(S))INPUT = []for b in range(int(lister[1])):innerINP = []inPut = input().split()for a in range(int(lister[0])):innerINP.append(inPut[a])INPUT.append(innerINP)S = lister[3]flag= Truefor b in range(int(lister[1])):for a in range(int(lister[0])):if (S < int(K)):flag = Falsebreakif(a<=lister[1]-1 and a>0):S -= 1if(INPUT[b][a] == '*'):S += 5elif(INPUT[b][a] == '.'):S -= 2else:breakif(flag == False):breakif(S >= int(lister[2])):print("Yes\n",S)else:print("No")
