QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#209108#5271. Focusing on Costsucup-team1004WA 0ms3420kbC++141.0kb2023-10-10 10:13:232023-10-10 10:13:24

Judging History

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

  • [2023-10-10 10:13:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3420kb
  • [2023-10-10 10:13:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<typename T>
ostream& operator << (ostream &out,const vector<T>&x){
	if(x.empty())return out<<"[]";
	out<<'['<<x[0];
	for(int len=x.size(),i=1;i<len;i++)out<<','<<x[i];
	return out<<']';
}
template<typename T>
vector<T> ary(const T *a,int l,int r){
	return vector<T>{a+l,a+1+r};
}
template<typename T>
void debug(T x){
	cerr<<x<<'\n';
}
template<typename T,typename ...S>
void debug(T x,S ...y){
	cerr<<x<<' ',debug(y...);
}
int a,b;
vector<string>ans;
void dfs(int a,int b){
	int g=__gcd(a,b);
	a/=g,b/=g;
	if(a==1&&b==1){
		return ans.push_back("cos");
	}
	if(a>b){
		dfs(a-b,b);
		ans.push_back("atan");
		ans.push_back("cos");
		ans.push_back("atan");
		ans.push_back("cos");
		ans.push_back("asin");
		ans.push_back("tan");
	}else{
		dfs(a,b-a);
		ans.push_back("atan");
		ans.push_back("sin");
	}
}
int main(){
	cin>>a>>b;
	dfs(a,b);
	cout<<ans.size()<<endl;
	for(string x:ans)cout<<x<<' ';
	cout<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3420kb

input:

1 1

output:

1
cos 

result:

ok OK, a/b = 1/1, ops = 1, error = 0.000000e+00

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3420kb

input:

2 1

output:

7
cos atan cos atan cos asin tan 

result:

wrong answer Final result is 1.4142135624, expected 2.0000000000, absolute error = 0.5857864376