-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEuler_Problem-071.py
97 lines (93 loc) · 1.41 KB
/
Euler_Problem-071.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env python3
# transpiled with BefunCompile v1.3.0 (c) 2017
def td(a,b):
return ((0)if(b==0)else(a//b))
def tm(a,b):
return ((0)if(b==0)else(a%b))
s=[]
def sp():
global s
if (len(s) == 0):
return 0
return s.pop()
def sa(v):
global s
s.append(v)
def sr():
global s
if (len(s) == 0):
return 0
return s[-1]
x0=0
x1=1000000
x2=0
x3=1
x4=1
x5=63
x6=63
x7=63
x8=63
def _0():
sa(1)
sa(0)
return 1
def _1():
return (5)if(sp()!=0)else(2)
def _2():
global x5
global t0
global x6
x5=sr()
t0=(sr()*3)/7
x6=t0
t0=t0*7
t0=t0-(x5*3)
return (3)if(t0>0)else(8)
def _3():
global x7
global t0
global x8
global x5
global x4
global x3
x7=t0
x8=x5*7
return (4)if((x4*x8)>(x3*x7))else(5)
def _4():
global x4
global x7
global x3
global x8
global x0
global x6
global x2
global x5
x4=x7
x3=x8
x0=x6
x2=x5
return 5
def _5():
global x1
return (7)if((sr()-x1)!=0)else(6)
def _6():
global x0
global x2
print(x0,end=" ",flush=True)
print(" /",end="",flush=True)
print(chr(10),end="",flush=True)
print(x2,end=" ",flush=True)
sp();
return 9
def _7():
sa(sp()+1)
sa((0)if((sr()*3)%7!=0)else(1))
return 1
def _8():
global t0
t0=t0*-1
return 3
m=[_0,_1,_2,_3,_4,_5,_6,_7,_8]
c=0
while c<9:
c=m[c]()