Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Apr 17, 2024
1 parent 35a73e8 commit d58cf22
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/training.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n, s = io.read("*n", "*n")
for _ = 1, n do
a, b = io.read("*n", "*n")
if s >= a and s <= b then
s = s + 1
end
end
print(s)
6 changes: 6 additions & 0 deletions src/training.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
n, s = [int(d) for d in input().split()]
for _ in range(n):
a, b = [int(d) for d in input().split()]
if s >= a and s <= b:
s += 1
print(s)

0 comments on commit d58cf22

Please sign in to comment.