1
0
This commit is contained in:
2026-02-04 11:15:03 +08:00
commit 8b20a5dd21
125 changed files with 4177 additions and 0 deletions

6
problems/p15/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "p15"
version = "0.1.0"
edition = "2024"
[dependencies]

14
problems/p15/src/main.rs Normal file
View File

@@ -0,0 +1,14 @@
fn path(n: u16) {
let mut map: Vec<Vec<u64>> = vec![vec![1; n as usize]; n as usize];
for i in 1..n as usize {
for j in 1..n as usize {
map[i][j] = map[i - 1][j] + map[i][j - 1];
}
}
println!("{}", map[(n - 1) as usize][(n - 1) as usize]);
}
fn main() {
path(21);
}