diff options
author | crupest <crupest@outlook.com> | 2021-03-24 16:49:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-03-24 16:49:35 +0800 |
commit | e42e763aebf9028b4dcdfec31e33dd9e4377601b (patch) | |
tree | 4f29e99951e4335ce18aab37d3d47fa7c2f826ca | |
parent | 592edbe3584d88b92367b4a661f4c4082b3f382c (diff) | |
download | solutions-e42e763aebf9028b4dcdfec31e33dd9e4377601b.tar.gz solutions-e42e763aebf9028b4dcdfec31e33dd9e4377601b.tar.bz2 solutions-e42e763aebf9028b4dcdfec31e33dd9e4377601b.zip |
Add acwing 2067.
-rw-r--r-- | acwing/2067.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/acwing/2067.cpp b/acwing/2067.cpp new file mode 100644 index 0000000..3ebd61d --- /dev/null +++ b/acwing/2067.cpp @@ -0,0 +1,22 @@ +#include <iostream>
+
+int n, m;
+long long f[31][31];
+
+int main() {
+ std::cin >> n >> m;
+
+ f[1][1] = 1;
+
+ for (int r = 1; r <= n; r++) {
+ for (int c = 1; c <= m; c++) {
+ if (!(r == 1 && c == 1) && !(r % 2 == 0 && c % 2 == 0)) {
+ f[r][c] = f[r - 1][c] + f[r][c - 1];
+ }
+ }
+ }
+
+ std::cout << f[n][m];
+
+ return 0;
+}
|