Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 6, 2023
1 parent f297364 commit 1970d9a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/kcuddlanod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
a, b = input().split()
a = list(a)[::-1]
for i in range(len(a)):
if a[i] == "5":
a[i] = "2"
elif a[i] == "2":
a[i] = "5"
b = list(b)[::-1]
for i in range(len(b)):
if b[i] == "5":
b[i] = "2"
elif b[i] == "2":
b[i] = "5"
a, b = int("".join(a)), int("".join(b))
if a > b:
print(1)
else:
print(2)
13 changes: 13 additions & 0 deletions src/pascal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import math

n = int(input())

f = False
for i in range(2, math.ceil(math.sqrt(n)) + 1):
if n % i == 0:
f = True
break
if f:
print(n - n // i)
else:
print(n - 1)
8 changes: 8 additions & 0 deletions src/pubrunda.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n = int(input())
m = {}
for _ in range(n):
name, k, t = input().split()
m[name] = (int(k) + 1) * int(t)

ans = max(m, key=lambda k: m[k])
print(ans, m[ans])
3 changes: 3 additions & 0 deletions src/reduplikation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s = input()
n = int(input())
print(s * n)

0 comments on commit 1970d9a

Please sign in to comment.