aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-03-24 16:49:35 +0800
committercrupest <crupest@outlook.com>2021-03-24 16:49:35 +0800
commit5ed699bac1424848709cda05b3528b2470c487be (patch)
treec2f3251d3195a960dae2a2e6373cfba745669442
parentfd283dd620b1836ce3057735fab1a4518ecba5c3 (diff)
downloadcrupest-5ed699bac1424848709cda05b3528b2470c487be.tar.gz
crupest-5ed699bac1424848709cda05b3528b2470c487be.tar.bz2
crupest-5ed699bac1424848709cda05b3528b2470c487be.zip
import(solutions): Add acwing 2067.
-rw-r--r--works/solutions/acwing/2067.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/works/solutions/acwing/2067.cpp b/works/solutions/acwing/2067.cpp
new file mode 100644
index 0000000..3ebd61d
--- /dev/null
+++ b/works/solutions/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;
+}