1443: [蓝桥杯]买不到的数目 【中 / 思维 / 数论】

在这里插入图片描述
http://oj.ecustacm.cn/problem.php?id=1443

有现有得结论,暴力过不了。
在这里插入图片描述

(a-1)*(b-1)-1
#include<cstdio>
#include<iostream>
using namespace std;
int main(void)
{
    
    
	int a,b; cin>>a>>b;
	cout<<(a-1)*(b-1)-1<<endl;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/bettle_king/article/details/115416846