QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#19600#2290. Kinking CablesJohnAlfnovWA 3ms3740kbC++20945b2022-02-06 12:50:202022-05-06 06:16:37

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-06 06:16:37]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3740kb
  • [2022-02-06 12:50:20]
  • 提交

answer

#include<bits/stdc++.h>
#define eps 1e-6
using namespace std;
int main(){
	int n,m;
	double l;
	cin>>n>>m>>l;
	vector<pair<double,double>>g;
	if(l<sqrt(1.0*n*n+1.0*m*m)+eps){
		g.emplace_back(make_pair(0,0));
		g.emplace_back(make_pair(n,m));
	}else if(l<n+m){
		double a=(1.0*n*n+1.0*m*m-1.0*l*l)/(2.0*n-2.0*l);
		g.emplace_back(make_pair(0,0));
		g.emplace_back(make_pair(a,0));
		g.emplace_back(make_pair(n,m));
	}else{
		g.emplace_back(make_pair(0,0));
		g.emplace_back(make_pair(n,0));
		l-=n;
		for(int i=0;i<m;){
			if(l<m+eps){
				g.emplace_back(make_pair(n,m));
				break;
			}
			double di=min(n+0.0,(l-m)/2);
			l-=2*di+2;
			g.emplace_back(make_pair(n,i+1));
			g.emplace_back(make_pair(n-di,i+1));
			g.emplace_back(make_pair(n-di,i+2));
			g.emplace_back(make_pair(n,i+2));
			i+=2;
		}
	}
	printf("%d\n",(signed)g.size());
	for(auto pi:g)printf("%.6f %.6f\n",pi.first,pi.second);
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3740kb

input:

79 78
1980.7712136406

output:

51
0.000000 0.000000
79.000000 0.000000
79.000000 1.000000
0.000000 1.000000
0.000000 2.000000
79.000000 2.000000
79.000000 3.000000
0.000000 3.000000
0.000000 4.000000
79.000000 4.000000
79.000000 5.000000
0.000000 5.000000
0.000000 6.000000
79.000000 6.000000
79.000000 7.000000
0.000000 7.000000
0...

result:

wrong answer Output path has length 1958.771214000, should have length 1980.771213641