洛谷 3951 小凯的疑惑——找规律/数学

题目:https://www.luogu.org/problemnew/show/P3951html

反正是a*b-a-b。使用裴蜀定理可证?从同余系的角度考虑?反正查一查就知道了。ios

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
long long a,b;
int main()
{
    scanf("%lld%lld",&a,&b);
    printf("%lld\n",a*b-a-b);
    return 0;
}

 

转载于:https://www.cnblogs.com/Narh/p/9620801.htmlpost