QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#75979#5461. Paddle StarchenshiCompile Error//C++1.2kb2023-02-06 21:54:342023-02-06 21:54:37

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:54:37]
  • 评测
  • [2023-02-06 21:54:34]
  • 提交

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;
}

详细

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: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:19:49: error: reference to ‘beta’ is ambiguous
   19 |                 ans=(l1+l2)*(l1+l2)*alpha+l2*l2*beta;
      |                                                 ^~~~
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:20:39: error: reference to ‘beta’ is ambiguous
   20 |                 if(l1<l2&&PI-t<Gamma) beta=t,t=l1*sinl(alpha)/sinl(alpha-(PI-beta)),ans+=l2*t*sinl(Gamma-(PI-beta));
      |                                       ^~~~
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:20:78: error: reference to ‘beta’ is ambiguous
   20 |                 if(...