QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75977#5461. Paddle StarchenshiCompile Error//C++1.2kb2023-02-06 21:53:472023-02-06 21:53:50

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-06 21:53:50]
  • 评测
  • [2023-02-06 21:53:47]
  • 提交

answer

//https://cdn.luogu.com.cn/upload/image_hosting/bce60lzi.png
//https://cdn.luogu.com.cn/upload/image_hosting/30e80xrq.png
//https://cdn.luogu.com.cn/upload/image_hosting/kejvnuf4.png
#include<cstdio>
#include<cmath>
using namespace std;
const long double PI=acosl(-1);
int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
inline long double calc(long double x,long double alpha,long double beta){
	return x*x*sinl(alpha)*sinl(beta)/sinl(PI-alpha-beta);
}
int main(){
	for(scanf("%d",&T);T--;printf("%.9Lf\n",ans)){
		scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&alpha,&beta);alpha=alpha/180*PI;t=beta=beta/180*PI;
		if(l1<l2){
			gamma=alpha-asinl(l1*sinl(alpha)/l2);
			if(PI-beta<gamma) beta=PI-gamma;
		}
		ans=(l1+l2)*(l1+l2)*alpha+l2*l2*beta;
		if(l1<l2&&PI-t<gamma) beta=t,t=l1*sinl(alpha)/sinl(alpha-(PI-beta)),ans+=l2*t*sinl(gamma-(PI-beta));
		if(beta>PI/2){
			if(l2>l1*cosl(PI-beta)) l2=l1*cosl(PI-beta),l3=l1*sinl(beta);
			else l3=sqrtl(l1*l1+l2*l2-2*l1*l2*cosl(PI-beta));
			gamma=asinl(l2*sinl(beta)/l3);
			if(gamma<2*alpha) ans+=l1*l2*sinl(beta)-l3*l3*asinl(l2*sinl(beta)/l3);
			else ans+=l1*l2*sinl(beta)-l1*l3*sinl(gamma-2*alpha)-l3*l3*2*alpha+
			l1*l3*sinl(gamma-2*alpha)-calc(l3,gamma-2*alpha,asinl(l1*sinl(beta)/l3));
		}
	}
	return 0;
}

Details

answer.code:8:39: error: ‘long double gamma’ redeclared as different kind of entity
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                       ^~~~~
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:571,
                 from /usr/include/c++/11/cstdio:41,
                 from answer.code:4:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:241:1: note: previous declaration ‘double gamma(double)’
  241 | __MATHCALL (gamma,, (_Mdouble_));
      | ^~~~~~~~~~
answer.code: In function ‘int main()’:
answer.code:14:54: error: reference to ‘beta’ is ambiguous
   14 |                 scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&alpha,&beta);alpha=alpha/180*PI;t=beta=beta/180*PI;
      |                                                      ^~~~
In file included from /usr/include/c++/11/cmath:1927,
                 from answer.code:5:
/usr/include/c++/11/bits/specfun.h:343:5: note: candidates are: ‘template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)’
  343 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
answer.code:8:34: note:                 ‘long double beta’
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                  ^~~~
answer.code:14:81: error: reference to ‘beta’ is ambiguous
   14 |                 scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&alpha,&beta);alpha=alpha/180*PI;t=beta=beta/180*PI;
      |                                                                                 ^~~~
In file included from /usr/include/c++/11/cmath:1927,
                 from answer.code:5:
/usr/include/c++/11/bits/specfun.h:343:5: note: candidates are: ‘template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)’
  343 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
answer.code:8:34: note:                 ‘long double beta’
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                  ^~~~
answer.code:14:86: error: reference to ‘beta’ is ambiguous
   14 |                 scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&alpha,&beta);alpha=alpha/180*PI;t=beta=beta/180*PI;
      |                                                                                      ^~~~
In file included from /usr/include/c++/11/cmath:1927,
                 from answer.code:5:
/usr/include/c++/11/bits/specfun.h:343:5: note: candidates are: ‘template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)’
  343 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
answer.code:8:34: note:                 ‘long double beta’
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                  ^~~~
answer.code:16:30: error: assignment of function ‘double gamma(double)’
   16 |                         gamma=alpha-asinl(l1*sinl(alpha)/l2);
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:17:31: error: reference to ‘beta’ is ambiguous
   17 |                         if(PI-beta<gamma) beta=PI-gamma;
      |                               ^~~~
In file included from /usr/include/c++/11/cmath:1927,
                 from answer.code:5:
/usr/include/c++/11/bits/specfun.h:343:5: note: candidates are: ‘template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)’
  343 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
answer.code:8:34: note:                 ‘long double beta’
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                  ^~~~
answer.code:17:43: error: reference to ‘beta’ is ambiguous
   17 |                         if(PI-beta<gamma) beta=PI-gamma;
      |                                           ^~~~
In file included from /usr/include/c++/11/cmath:1927,
                 from answer.code:5:
/usr/include/c++/11/bits/specfun.h:343:5: note: candidates are: ‘template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)’
  343 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
answer.code:8:34: note:                 ‘long double beta’
    8 | int T;long double l1,l2,l3,alpha,beta,gamma,t,ans;
      |                                  ^~~~
answer.code:17:50: error: invalid operands of types ‘const long double’ and ‘double(double) noexcept’ to binary ‘operator-’
   17 |                         if(PI-beta<gamma) beta=PI-gamma;
      |                                                ~~^~~~~~
      |                                                |  |
      |                                                |  double(double) noexcept
      |                                                const long double
answer.code:19:49: error: reference to ‘beta’ is ambiguous
   19 |                 ans=(l1+l2)*(l1+l2)*alpha+l2*l2*beta;
...