Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
npjd committed Feb 15, 2023
1 parent 284b329 commit 77339c3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch Main",
"request": "launch",
"mainClass": "contest.ccc2023.Main",
"projectName": "competitive-programming_9e37d6"
},
{
"name": "clang++ - Build and debug active file",
"type": "cppdbg",
Expand Down
3 changes: 3 additions & 0 deletions CCC/tandemBike.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
sum+=intMax

print(sum)

# what is the time complexity?
# O(n)
50 changes: 50 additions & 0 deletions acsl/fibImagine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import math


realPartC = 0.01

imagPartC = -0.64


arrSeen = []
counter = 0
realPart = 0
imagPart = 0
def normal_round(num, ndigits=0):
"""
Rounds a float to the specified number of decimal places.
num: the value to round
ndigits: the number of digits to round to
"""
if ndigits == 0:
return int(num + 0.5)
else:
digit_value = 10 ** ndigits
return int(num * digit_value + 0.5) / digit_value
while True:
tempRealPart = realPart
realPart = tempRealPart**2 - imagPart**2
imagPart = tempRealPart * imagPart *2


realPart = realPart + realPartC
imagPart = imagPart + imagPartC

realPart = normal_round(realPart,2)
imagPart = normal_round(imagPart,2)

arrSeen.append((realPart,imagPart))
absValue = math.sqrt(realPart**2 + imagPart**2)
print(arrSeen)
if absValue > 4:
print("ESCAPES",counter+1)
break
elif arrSeen.count((realPart,imagPart)) ==2:
print(realPart,imagPart)
print(counter)
break
else:
counter +=1



11 changes: 11 additions & 0 deletions acsl/play.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fib= [1,2,3,5,8,13,
21, 55, 89, 144,233,377,610
]

for x in range(1,11):
stop = 0
for y in range(0,13):
if stop ==0 and fib[y] %x ==0:
print(x)
stop =1

0 comments on commit 77339c3

Please sign in to comment.