Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Nov 13, 2024
1 parent 65b7eca commit 698219d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/astackofgold.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
w, s = io.read("*n","*n")
print((w - s * (s + 1) // 2 * 29260) // 110)
2 changes: 2 additions & 0 deletions src/astackofgold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
w, s = [int(d) for d in input().split()]
print((w - s * (s + 1) // 2 * 29260) // 110)
19 changes: 19 additions & 0 deletions src/sauna.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
n = io.read("*n")
ma, mb = -1, 200001
for _ = 1, n do
a, b = io.read("*n", "*n")
if a > ma then
ma = a
end
if b < mb then
mb = b
end
if ma > mb then
break
end
end
if ma <= mb then
print(mb - ma + 1, ma)
else
print('bad news')
end

0 comments on commit 698219d

Please sign in to comment.