commit b474274349064c1a90ff1bf3b8b40fb214c54b12 Author: wonder Date: Fri May 29 13:11:46 2026 +0800 update diff --git a/LC1/.cph/.1.go_7bc78c28150bc04bfd16f4a17ca5134a.prob b/LC1/.cph/.1.go_7bc78c28150bc04bfd16f4a17ca5134a.prob new file mode 100644 index 0000000..0f392b7 --- /dev/null +++ b/LC1/.cph/.1.go_7bc78c28150bc04bfd16f4a17ca5134a.prob @@ -0,0 +1 @@ +{"name":"Local: 1","url":"/home/wonder/code/algrithm/LC1/1.go","tests":[{"id":1780031224656,"input":"5","output":"8"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/home/wonder/code/algrithm/LC1/1.go","group":"local","local":true} \ No newline at end of file diff --git a/LC1/1.go b/LC1/1.go new file mode 100644 index 0000000..9b8cfce --- /dev/null +++ b/LC1/1.go @@ -0,0 +1,16 @@ +package main + +import "fmt" + +func dfs(i int) int { + if i <= 2 { + return i + } + return dfs(i-1) + dfs(i-2) +} + +func main() { + var n int + fmt.Scan(&n) + fmt.Println(dfs(n)) +}