Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

151 - Power Crisis solution in python

def power_crisis(n,k):
    if n == 1:
        return 1
    else:
        return (power_crisis(n-1,k)+k-1)%n+1

while True:
    n = int(input())
    if n == 0:
        break
    i = 1
    while power_crisis(n-1,i) != 12:
        i += 1
    print(i)
Comment

PREVIOUS NEXT
Code Example
Python :: 151 problem solution 
Python :: get script text selenium python 
Python :: get python ssl certificate location 
Python :: 2 functions at a time py 
Python :: 0x80370102 kali linux 
Python :: python list sum 
Python :: cin python 
Python :: from sklearn.metrics import confusion_matrix pred = model.predict(X_test) pred = np.argmax(pred,axis = 1) y_true = np.argmax(y_test,axis = 1) 
Python :: python stop stdout 
Python :: pandas chesk if object is string or tuple 
Python :: where are docker logs 
Python :: how to divide string in python 
Python :: input check in pygame 
Python :: python last non-zero value in a list 
Python :: python print ling line in print 
Python :: split df coliumn 
Python :: django delete table data 
Python :: iterrows pd 
Python :: come fare aprire una pagina web python 
Python :: defaultdict in python 
Python :: how to omit days pandas datetime 
Python :: :: python 
Python :: *kwargs 
Python :: python if not none in one line 
Python :: How To Remove Elements From a Set using pop() function in python 
Python :: register models in admin 
Python :: Reversing Ints 
Python :: fixed size list in python 
Python :: how delete an entry tkinter 
Python :: python source code 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =