Compare commits
4 Commits
7bbb5bcb4f
...
8a8cfa5c43
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a8cfa5c43 | |||
| db736b30b3 | |||
| 0d0ebece77 | |||
| ef9eb28323 |
22
prsteni.py
Normal file
22
prsteni.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import math
|
||||||
|
|
||||||
|
n = int(input())
|
||||||
|
radii = list(map(int, input().split()))
|
||||||
|
|
||||||
|
prev_r = None
|
||||||
|
prev_n = 1
|
||||||
|
prev_d = 1
|
||||||
|
for r in radii:
|
||||||
|
if prev_r is None:
|
||||||
|
prev_r = r
|
||||||
|
continue
|
||||||
|
|
||||||
|
n = prev_r * prev_n
|
||||||
|
d = r * prev_d
|
||||||
|
gcd = math.gcd(n, d)
|
||||||
|
n = n // gcd
|
||||||
|
d = d // gcd
|
||||||
|
print(f"{n}/{d}")
|
||||||
|
prev_n = n
|
||||||
|
prev_d = d
|
||||||
|
prev_r = r
|
||||||
23
ptice.py
Normal file
23
ptice.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
ADRIAN = "ABC" * 34
|
||||||
|
BRUNO = "BABC" * 25
|
||||||
|
GORAN = "CCAABB" * 17
|
||||||
|
|
||||||
|
n = int(input())
|
||||||
|
answers = input()
|
||||||
|
adrian_score = bruno_score = goran_score = 0
|
||||||
|
for i in range(n):
|
||||||
|
if answers[i] == ADRIAN[i]:
|
||||||
|
adrian_score += 1
|
||||||
|
if answers[i] == BRUNO[i]:
|
||||||
|
bruno_score += 1
|
||||||
|
if answers[i] == GORAN[i]:
|
||||||
|
goran_score += 1
|
||||||
|
|
||||||
|
max_score = max((adrian_score, bruno_score, goran_score))
|
||||||
|
print(max_score)
|
||||||
|
if adrian_score == max_score:
|
||||||
|
print("Adrian")
|
||||||
|
if bruno_score == max_score:
|
||||||
|
print("Bruno")
|
||||||
|
if goran_score == max_score:
|
||||||
|
print("Goran")
|
||||||
3
quickestimate.py
Normal file
3
quickestimate.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
n = int(input())
|
||||||
|
for _ in range(n):
|
||||||
|
print(len(input()))
|
||||||
20
racingalphabet.py
Normal file
20
racingalphabet.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import math
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_distance(aphorism: str) -> int:
|
||||||
|
tokens = "ABCDEFGHIJKLMNOPQRSTUVWXYZ '"
|
||||||
|
prev_s = aphorism[0]
|
||||||
|
total_distance = 0
|
||||||
|
for s in aphorism:
|
||||||
|
current_distance = (tokens.index(prev_s) - tokens.index(s)) % 28
|
||||||
|
if current_distance > 14:
|
||||||
|
current_distance = 28 - current_distance
|
||||||
|
prev_s = s
|
||||||
|
total_distance += current_distance
|
||||||
|
return 60 * math.pi / 28 * total_distance
|
||||||
|
|
||||||
|
|
||||||
|
n = int(input())
|
||||||
|
for _ in range(n):
|
||||||
|
aphorism = input()
|
||||||
|
print(calculate_distance(aphorism) / 15 + len(aphorism))
|
||||||
Reference in New Issue
Block a user