cf div2_199_b(水题也注意)

      给出巨形0~w,0~h.在里面找出四个顶点为整数的菱形个数。

   看到了题就毫不犹豫的去枚举,悲剧了吧。都没看数据范围,我真傻!

 #include<iostream>
using namespace std;

long long wg(long long w, long long h)
{
    long long countw = 0;
    long long counth = 0;
    for(int i = 2; i <= w; i+=2)
    {
        countw += ( w - i + 1 );
    }
    for(int i = 2; i <= h; i+=2)
    {
        counth += ( h - i + 1 );
    
    return countw * count_h;
}


int main()
{
   long long w = 0, h = 0;
   cin >> w >> h;
   cout<<wg(w, h)<<endl;
   return 0;
}

你可能感兴趣的:(cf div2_199_b(水题也注意))