/01타일.swift Secret
Created
April 5, 2023 10:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let n = Int(readLine()!)! | |
var cache = [Int](repeating: 0, count: 1_000_001) | |
cache[1] = 1 | |
cache[2] = 2 | |
for i in 3...1_000_000 { | |
cache[i] = cache[i - 1] + cache[i - 2] | |
cache[i] %= 15746 | |
} | |
print(cache[n]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment