2659: [Beijing wc2012]算不出的算式

来源:互联网 发布:腾讯上班知乎 编辑:程序博客网 时间:2024/06/06 05:52

题目链接

题目大意:给出p,q求这个求

题解:跪啊
丢链接跑1
2

我的收获:考虑几何意义

#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<algorithm>#include<iostream>using namespace std;typedef long long LL;int main(){    LL p,q;    cin>>p>>q;    if (p==q) cout<<(p-1)*(p+1)/4;        else  cout<<(p-1)*(q-1)/4;    return 0;}