Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Apr 16, 2024
1 parent 907cc67 commit 35a73e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/midi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
parts = []
for _ in range(n):
parts.append(input())
print("".join(p[::-1] for p in parts[::-1]))
8 changes: 8 additions & 0 deletions src/numberfun.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for _ = 1, io.read("*n") do
a, b, c = io.read("*n", "*n", "*n")
if a + b == c or a * b == c or a - b == c or b - a == c or a == b * c or b == a * c then
print("Possible")
else
print("Impossible")
end
end
10 changes: 10 additions & 0 deletions src/offworldrecords.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
n, c, p = io.read("*n", "*n", "*n")
ans = 0
for _ = 1, n do
h = io.read("*n")
if h > c + p then
ans = ans + 1
c, p = h, c
end
end
print(ans)

0 comments on commit 35a73e8

Please sign in to comment.