UVa 10970 Big Chocolate Posted on 2015-11-22 | In ACM | | Visitors 题目链接UVa 10970 方法:机智题 题目分析题目大意mn的巧克力,分成mn块1*1的,问最少需要多少刀 解析找规律,很容易发现,m*n-1就是所要的结果 代码1234567891011121314151617181920212223242526#include <set>#include <map>#include <stack>#include <cmath>#include <queue>#include <cstdio>#include <string>#include <vector>#include <iomanip>#include <cstring>#include <iostream>#include <algorithm>#define PI acos(-1)#define debug printf("Hi----------\n")#define eps 1e-8#define INF 0x3f3f3f3f#pragma comment(linker, "/STACK:1024000000,1024000000")typedef long long ll;using namespace std;#define maxn 10005int main(){ int n,m; while (scanf("%d%d",&n,&m)!=EOF) { cout<<m*n-1<<endl; }}