diff --git a/.vscode/launch.json b/.vscode/launch.json index 83d2af0..a7af34f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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", diff --git a/CCC/tandemBike.py b/CCC/tandemBike.py index 5b52987..65e9653 100644 --- a/CCC/tandemBike.py +++ b/CCC/tandemBike.py @@ -28,3 +28,6 @@ sum+=intMax print(sum) + +# what is the time complexity? +# O(n) \ No newline at end of file diff --git a/acsl/fibImagine.py b/acsl/fibImagine.py new file mode 100644 index 0000000..9772d08 --- /dev/null +++ b/acsl/fibImagine.py @@ -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 + + + \ No newline at end of file diff --git a/acsl/play.py b/acsl/play.py new file mode 100644 index 0000000..24132ad --- /dev/null +++ b/acsl/play.py @@ -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 +