Mohammad has recently visited Switzerland. As heloves his friends very much, he decided to buy somechocolate for them, but as this fine chocolate is very expensive(You know Mohammad is a little BIT stingy!),he could only afford buying one chocolate,…
https://vjudge.net/problem/UVA-10970 题意: 把一个m行n列的矩形巧克力切成mn个1×1的方块,需要切几刀. 思路: 可以考虑用动态规划的方法去做,当然,最简单的是直接找到规律,直接计算出来. #include<iostream> #include<algorithm> #include<string> #include<cstring> using namespace std; int n, m; ][]; int dp…