Skip to content

Instantly share code, notes, and snippets.

@koogawa
Created August 18, 2021 00:16
Show Gist options
  • Save koogawa/4a2de9795dc0a045dfe066fd47b867cb to your computer and use it in GitHub Desktop.
Save koogawa/4a2de9795dc0a045dfe066fd47b867cb to your computer and use it in GitHub Desktop.
import Foundation
let input = readLine()!.split(separator:" ").map { Int(String($0))! }
var (N, X, Y) = (input[0], input[1], input[2])
var ans = 0
for _ in 2..<N {
ans = (X + Y) % 100
X = Y
Y = ans
}
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment