UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212132#3815. 种树Alex9876Compile Error//Python3455b2024-10-13 11:28:342024-10-13 12:56:12

answer

#include<bits/stdc++.h>
int C(int a,int b)
{
	double res=1;
	for(int c=a;c>a-b;c-=1){res=1.0*res*c;}
	for(int v=1;v<b+1;v+=1){res=1.0*res/v;}
	return int(res);
}
int main()
{
    int a,b,c,t=0;
    std::cin>>a>>b>>c;
    if(c>ceil(1.0*a*b/2))
	{
		std::cout<<0;
		return 0;
	}
	if(c==1)
	{
		std::cout<<a*b;
		return 0;
	}
    t=C(ceil(a*b/2.0),c);
    if(a*b%2==0){t*=2;}
    else{t+=C(a*b/2,c);}
    std::cout<<t;
	return 0;
}

Details

  File "answer.code", line 2
    int C(int a,int b)
        ^
SyntaxError: invalid syntax