File tree 1 file changed +18
-6
lines changed
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 4
4
num_tests = int (lines [index ].strip ())
5
5
index += 1 #move to blank line
6
6
7
+ ms = list ()
7
8
while index < len (lines ):
9
+ global ms
8
10
index += 1 #move past blank line
9
11
size_strip = float (lines [index ].strip ())
10
12
index += 1 #move past size strip line
29
31
#get new random val
30
32
num_empty = sum ([1 for x in frequencies if x == 0 ])
31
33
if new_nums == nums :
32
- pos = random () % num_empty
33
- if (random () % 10 ) == 0 :
34
+ pos = random_dumb () % num_empty
35
+ if (random_dumb () % 10 ) == 0 :
34
36
new_value = 4
35
37
else :
36
38
new_value = 2
@@ -74,7 +76,7 @@ def move_right(nums):
74
76
new_nums = [0 ]* len (size_strip )
75
77
inPair = False
76
78
pastNum = 0
77
- index = 0
79
+ index = len ( new_nums ) - 1
78
80
pairs = enumerate (nums )
79
81
pairs .reverse ()
80
82
for i , num in pairs :
@@ -83,14 +85,24 @@ def move_right(nums):
83
85
else :
84
86
if inPair and pastNum == num :
85
87
new_nums [index ] = pastNum * 2
86
- index + = 1
88
+ index - = 1
87
89
elif inPair and pastNum != num :
88
90
new_nums [index ] = pastNum
89
- new_nums [index + 1 ] = num
91
+ new_nums [index - 1 ] = num
90
92
inPair = False
91
- index + = 2
93
+ index - = 2
92
94
elif not inPair :
93
95
pastNum = num
94
96
inPair = True
97
+ ir = 43
98
+ last_call_ans = 0
99
+ def random_shit ():
100
+ global ms
101
+ global ir
102
+ c = 1 if ((ir >= 43 ) and last_call_ans < 0 ) else 0
103
+ ans = (x [ir - 22 ] - x [ir - 43 ] - c ) % (2 ** 32 )
104
+ last_call_ans = ans
105
+ ir += 1
106
+ return ans
95
107
96
108
You can’t perform that action at this time.
0 commit comments