QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209115#5271. Focusing on Costsucup-team1004WA 0ms3628kbC++14997b2023-10-10 10:19:202023-10-10 10:19:21

Judging History

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

  • [2023-10-10 10:19:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2023-10-10 10:19:20]
  • 提交

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(b,a);
		ans.push_back("atan");
		ans.push_back("cos");
		ans.push_back("atan");
		ans.push_back("cos");
	}else{
		dfs(a,b-a);
		ans.push_back("atan");
		ans.push_back("sin");
	}
}
int main(){
	cin>>a>>b;
	dfs(a*a,b*b);
	cout<<ans.size()<<endl;
	for(string x:ans)cout<<x<<' ';
	cout<<endl;
	return 0;
}

詳細信息

Test #1:

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

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: 3628kb

input:

2 1

output:

11
cos atan sin atan sin atan sin atan cos atan cos 

result:

wrong answer Final result is 0.7453559925, expected 2.0000000000, absolute error = 1.2546440075