比赛的的时候因为看别人都是0ms
所以觉得是公示
老是想着推公示,,
其实是暴力l
是枚举h,然后枚举w,因为w可以用公式,这样就不用超时
转自:http://blog.csdn.net/VictorZC8/article/details/51242491
而且还要注意用上(1LL) 要不然很容易错。。。
using namespace std;
#define sf scanf
int main(){
int n,m,k;
while(~scanf("%d%d%d",&n,&m,&k)){
ll ans=0;
for(int h=1;h<=n;++h){
int w=k/2-h;
if(w<=m&&w>0)ans+=(1LL)*(n-h+1)*(2*m-w+1)*w/2;
else if(w>0)ans+=(1LL)*(n-h+1)*(1+m)*m/2;
}
printf("%lld\n",ans);
}
}