Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Codeforces #325 Div2
# #325 Div2 A. Alena's Schedule
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
lesson = 0
rest = 0
a.each do |i|
if i == 1 then
if rest == 1 and lesson > 0 then
lesson += 1
end
rest = 0
lesson += 1
else
rest += 1
end
end
puts lesson
@whatalnk

This comment has been minimized.

Copy link
Owner Author

commented Nov 5, 2015

  • A
  • B
  • C
  • D
  • E
  • F
@whatalnk

This comment has been minimized.

Copy link
Owner Author

commented Nov 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.