import time import sys str = open('c:\inputs\in4_4.txt','r') i =str.readline() list1 =i.split(",") t1=time.clock() def power(x,n): count=0 if n==0: return 1 elif n==1: return x elif n==2: return x*x else: if n%2==0: return power( power(x,n/2) ,2 ) else: return power( power(x,n/2) , 2 ) * x list1= repr(power(int(list1[0]),int(list1[1]))) mem=sys.getsizeof(list1)+24 t2=time.clock() t=t2-t1 fout = open('out_24_sec4_4.txt','w') for i in range(len(list1)-1): fout.write(list1[i]) fout.write('\n'+'6 , '+repr(t)+','+repr(mem)) fout.close()