QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#19601#2290. Kinking CablesJohnAlfnovAC ✓4ms3876kbC++20952b2022-02-06 12:56:482022-05-06 06:16:41

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:41]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3876kb
  • [2022-02-06 12:56:48]
  • 提交

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-i+eps){
				g.emplace_back(make_pair(n,m));
				break;
			}
			double di=min(n+0.0,(l-(m-i))/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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3828kb

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:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

33 65
1947.7601065763

output:

119
0.000000 0.000000
33.000000 0.000000
33.000000 1.000000
0.000000 1.000000
0.000000 2.000000
33.000000 2.000000
33.000000 3.000000
0.000000 3.000000
0.000000 4.000000
33.000000 4.000000
33.000000 5.000000
0.000000 5.000000
0.000000 6.000000
33.000000 6.000000
33.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #3:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

51 51
555.0803652025

output:

23
0.000000 0.000000
51.000000 0.000000
51.000000 1.000000
0.000000 1.000000
0.000000 2.000000
51.000000 2.000000
51.000000 3.000000
0.000000 3.000000
0.000000 4.000000
51.000000 4.000000
51.000000 5.000000
0.000000 5.000000
0.000000 6.000000
51.000000 6.000000
51.000000 7.000000
0.000000 7.000000
0...

result:

ok correct

Test #4:

score: 0
Accepted
time: 3ms
memory: 3812kb

input:

49 2
67.3588717350

output:

7
0.000000 0.000000
49.000000 0.000000
49.000000 1.000000
40.820564 1.000000
40.820564 2.000000
49.000000 2.000000
49.000000 2.000000

result:

ok correct

Test #5:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

37 48
1713.3643608504

output:

95
0.000000 0.000000
37.000000 0.000000
37.000000 1.000000
0.000000 1.000000
0.000000 2.000000
37.000000 2.000000
37.000000 3.000000
0.000000 3.000000
0.000000 4.000000
37.000000 4.000000
37.000000 5.000000
0.000000 5.000000
0.000000 6.000000
37.000000 6.000000
37.000000 7.000000
0.000000 7.000000
0...

result:

ok correct

Test #6:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

51 79
820.1218304546

output:

31
0.000000 0.000000
51.000000 0.000000
51.000000 1.000000
0.000000 1.000000
0.000000 2.000000
51.000000 2.000000
51.000000 3.000000
0.000000 3.000000
0.000000 4.000000
51.000000 4.000000
51.000000 5.000000
0.000000 5.000000
0.000000 6.000000
51.000000 6.000000
51.000000 7.000000
0.000000 7.000000
0...

result:

ok correct

Test #7:

score: 0
Accepted
time: 3ms
memory: 3796kb

input:

6 8
37.5338494218

output:

11
0.000000 0.000000
6.000000 0.000000
6.000000 1.000000
0.000000 1.000000
0.000000 2.000000
6.000000 2.000000
6.000000 3.000000
0.233075 3.000000
0.233075 4.000000
6.000000 4.000000
6.000000 8.000000

result:

ok correct

Test #8:

score: 0
Accepted
time: 1ms
memory: 3796kb

input:

5 5
7.1908428511

output:

3
0.000000 0.000000
0.389855 0.000000
5.000000 5.000000

result:

ok correct

Test #9:

score: 0
Accepted
time: 4ms
memory: 3680kb

input:

5 4
8.3927665498

output:

3
0.000000 0.000000
4.338426 0.000000
5.000000 4.000000

result:

ok correct

Test #10:

score: 0
Accepted
time: 4ms
memory: 3872kb

input:

4 2
6.4617533647

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
3.769123 1.000000
3.769123 2.000000
4.000000 2.000000
4.000000 2.000000

result:

ok correct

Test #11:

score: 0
Accepted
time: 3ms
memory: 3800kb

input:

91 87
4830.8473359767

output:

107
0.000000 0.000000
91.000000 0.000000
91.000000 1.000000
0.000000 1.000000
0.000000 2.000000
91.000000 2.000000
91.000000 3.000000
0.000000 3.000000
0.000000 4.000000
91.000000 4.000000
91.000000 5.000000
0.000000 5.000000
0.000000 6.000000
91.000000 6.000000
91.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #12:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

90 90
5088.9280941138

output:

115
0.000000 0.000000
90.000000 0.000000
90.000000 1.000000
0.000000 1.000000
0.000000 2.000000
90.000000 2.000000
90.000000 3.000000
0.000000 3.000000
0.000000 4.000000
90.000000 4.000000
90.000000 5.000000
0.000000 5.000000
0.000000 6.000000
90.000000 6.000000
90.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #13:

score: 0
Accepted
time: 3ms
memory: 3808kb

input:

90 92
7004.0153432299

output:

155
0.000000 0.000000
90.000000 0.000000
90.000000 1.000000
0.000000 1.000000
0.000000 2.000000
90.000000 2.000000
90.000000 3.000000
0.000000 3.000000
0.000000 4.000000
90.000000 4.000000
90.000000 5.000000
0.000000 5.000000
0.000000 6.000000
90.000000 6.000000
90.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #14:

score: 0
Accepted
time: 3ms
memory: 3820kb

input:

91 83
1879.3819547895

output:

43
0.000000 0.000000
91.000000 0.000000
91.000000 1.000000
0.000000 1.000000
0.000000 2.000000
91.000000 2.000000
91.000000 3.000000
0.000000 3.000000
0.000000 4.000000
91.000000 4.000000
91.000000 5.000000
0.000000 5.000000
0.000000 6.000000
91.000000 6.000000
91.000000 7.000000
0.000000 7.000000
0...

result:

ok correct

Test #15:

score: 0
Accepted
time: 2ms
memory: 3824kb

input:

3 81
199.2077743610

output:

83
0.000000 0.000000
3.000000 0.000000
3.000000 1.000000
0.000000 1.000000
0.000000 2.000000
3.000000 2.000000
3.000000 3.000000
0.000000 3.000000
0.000000 4.000000
3.000000 4.000000
3.000000 5.000000
0.000000 5.000000
0.000000 6.000000
3.000000 6.000000
3.000000 7.000000
0.000000 7.000000
0.000000 ...

result:

ok correct

Test #16:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

4 89
288.5915130114

output:

103
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.000000 1.000000
0.000000 2.000000
4.000000 2.000000
4.000000 3.000000
0.000000 3.000000
0.000000 4.000000
4.000000 4.000000
4.000000 5.000000
0.000000 5.000000
0.000000 6.000000
4.000000 6.000000
4.000000 7.000000
0.000000 7.000000
0.000000...

result:

ok correct

Test #17:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

95 3
175.9210001082

output:

7
0.000000 0.000000
95.000000 0.000000
95.000000 1.000000
56.039500 1.000000
56.039500 2.000000
95.000000 2.000000
95.000000 3.000000

result:

ok correct

Test #18:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

84 4
310.3037172015

output:

11
0.000000 0.000000
84.000000 0.000000
84.000000 1.000000
0.000000 1.000000
0.000000 2.000000
84.000000 2.000000
84.000000 3.000000
56.848141 3.000000
56.848141 4.000000
84.000000 4.000000
84.000000 4.000000

result:

ok correct

Test #19:

score: 0
Accepted
time: 2ms
memory: 3772kb

input:

2 2
2.8284271248

output:

2
0.000000 0.000000
2.000000 2.000000

result:

ok correct

Test #20:

score: 0
Accepted
time: 4ms
memory: 3876kb

input:

100 100
10000.0000000000

output:

199
0.000000 0.000000
100.000000 0.000000
100.000000 1.000000
0.000000 1.000000
0.000000 2.000000
100.000000 2.000000
100.000000 3.000000
0.000000 3.000000
0.000000 4.000000
100.000000 4.000000
100.000000 5.000000
0.000000 5.000000
0.000000 6.000000
100.000000 6.000000
100.000000 7.000000
0.000000 7...

result:

ok correct

Test #21:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

100 100
9999.2500000000

output:

199
0.000000 0.000000
100.000000 0.000000
100.000000 1.000000
0.000000 1.000000
0.000000 2.000000
100.000000 2.000000
100.000000 3.000000
0.000000 3.000000
0.000000 4.000000
100.000000 4.000000
100.000000 5.000000
0.000000 5.000000
0.000000 6.000000
100.000000 6.000000
100.000000 7.000000
0.000000 7...

result:

ok correct

Test #22:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

100 100
2723.8981892905

output:

55
0.000000 0.000000
100.000000 0.000000
100.000000 1.000000
0.000000 1.000000
0.000000 2.000000
100.000000 2.000000
100.000000 3.000000
0.000000 3.000000
0.000000 4.000000
100.000000 4.000000
100.000000 5.000000
0.000000 5.000000
0.000000 6.000000
100.000000 6.000000
100.000000 7.000000
0.000000 7....

result:

ok correct

Test #23:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

100 100
8994.4904261819

output:

179
0.000000 0.000000
100.000000 0.000000
100.000000 1.000000
0.000000 1.000000
0.000000 2.000000
100.000000 2.000000
100.000000 3.000000
0.000000 3.000000
0.000000 4.000000
100.000000 4.000000
100.000000 5.000000
0.000000 5.000000
0.000000 6.000000
100.000000 6.000000
100.000000 7.000000
0.000000 7...

result:

ok correct

Test #24:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

100 100
881.4998747190

output:

19
0.000000 0.000000
100.000000 0.000000
100.000000 1.000000
0.000000 1.000000
0.000000 2.000000
100.000000 2.000000
100.000000 3.000000
0.000000 3.000000
0.000000 4.000000
100.000000 4.000000
100.000000 5.000000
0.000000 5.000000
0.000000 6.000000
100.000000 6.000000
100.000000 7.000000
59.250063 7...

result:

ok correct

Test #25:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

88 94
8266.2500000000

output:

187
0.000000 0.000000
88.000000 0.000000
88.000000 1.000000
0.000000 1.000000
0.000000 2.000000
88.000000 2.000000
88.000000 3.000000
0.000000 3.000000
0.000000 4.000000
88.000000 4.000000
88.000000 5.000000
0.000000 5.000000
0.000000 6.000000
88.000000 6.000000
88.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #26:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

75 37
2772.0000000000

output:

75
0.000000 0.000000
75.000000 0.000000
75.000000 1.000000
0.000000 1.000000
0.000000 2.000000
75.000000 2.000000
75.000000 3.000000
0.000000 3.000000
0.000000 4.000000
75.000000 4.000000
75.000000 5.000000
0.000000 5.000000
0.000000 6.000000
75.000000 6.000000
75.000000 7.000000
0.000000 7.000000
0...

result:

ok correct

Test #27:

score: 0
Accepted
time: 1ms
memory: 3768kb

input:

48 39
62.0000000000

output:

3
0.000000 0.000000
0.678571 0.000000
48.000000 39.000000

result:

ok correct

Test #28:

score: 0
Accepted
time: 3ms
memory: 3664kb

input:

98 94
135.9000000000

output:

3
0.000000 0.000000
0.380079 0.000000
98.000000 94.000000

result:

ok correct

Test #29:

score: 0
Accepted
time: 3ms
memory: 3828kb

input:

90 81
7290.0000000000

output:

163
0.000000 0.000000
90.000000 0.000000
90.000000 1.000000
0.000000 1.000000
0.000000 2.000000
90.000000 2.000000
90.000000 3.000000
0.000000 3.000000
0.000000 4.000000
90.000000 4.000000
90.000000 5.000000
0.000000 5.000000
0.000000 6.000000
90.000000 6.000000
90.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #30:

score: 0
Accepted
time: 2ms
memory: 3768kb

input:

90 81
121.0826164250

output:

2
0.000000 0.000000
90.000000 81.000000

result:

ok correct

Test #31:

score: 0
Accepted
time: 3ms
memory: 3744kb

input:

34 99
3366.0000000000

output:

195
0.000000 0.000000
34.000000 0.000000
34.000000 1.000000
0.000000 1.000000
0.000000 2.000000
34.000000 2.000000
34.000000 3.000000
0.000000 3.000000
0.000000 4.000000
34.000000 4.000000
34.000000 5.000000
0.000000 5.000000
0.000000 6.000000
34.000000 6.000000
34.000000 7.000000
0.000000 7.000000
...

result:

ok correct

Test #32:

score: 0
Accepted
time: 2ms
memory: 3824kb

input:

34 99
104.6756896330

output:

2
0.000000 0.000000
34.000000 99.000000

result:

ok correct

Test #33:

score: 0
Accepted
time: 2ms
memory: 3824kb

input:

3 3
5.9999

output:

3
0.000000 0.000000
2.999900 0.000000
3.000000 3.000000

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

3 3
6.0

output:

3
0.000000 0.000000
3.000000 0.000000
3.000000 3.000000

result:

ok correct

Test #35:

score: 0
Accepted
time: 1ms
memory: 3800kb

input:

3 3
6.0001

output:

7
0.000000 0.000000
3.000000 0.000000
3.000000 1.000000
2.999950 1.000000
2.999950 2.000000
3.000000 2.000000
3.000000 3.000000

result:

ok correct

Test #36:

score: 0
Accepted
time: 3ms
memory: 3768kb

input:

4 4
13.999998

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
1.000001 1.000000
1.000001 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #37:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

4 4
14.0

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
1.000000 1.000000
1.000000 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #38:

score: 0
Accepted
time: 3ms
memory: 3812kb

input:

4 4
14.000002

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.999999 1.000000
0.999999 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #39:

score: 0
Accepted
time: 3ms
memory: 3868kb

input:

4 4
15.123104

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.438448 1.000000
0.438448 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #40:

score: 0
Accepted
time: 2ms
memory: 3868kb

input:

4 4
15.123106

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.438447 1.000000
0.438447 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #41:

score: 0
Accepted
time: 1ms
memory: 3764kb

input:

4 4
15.123108

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.438446 1.000000
0.438446 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #42:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

4 4
14.593385

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.703308 1.000000
0.703308 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #43:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

4 4
14.593387

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.703307 1.000000
0.703307 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #44:

score: 0
Accepted
time: 3ms
memory: 3796kb

input:

4 4
14.593389

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.703305 1.000000
0.703305 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #45:

score: 0
Accepted
time: 2ms
memory: 3768kb

input:

2 2
4.0

output:

3
0.000000 0.000000
2.000000 0.000000
2.000000 2.000000

result:

ok correct

Test #46:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

3 3
5.0

output:

3
0.000000 0.000000
1.750000 0.000000
3.000000 3.000000

result:

ok correct

Test #47:

score: 0
Accepted
time: 3ms
memory: 3764kb

input:

4 4
15.123

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.438500 1.000000
0.438500 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #48:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

4 4
14.1

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.950000 1.000000
0.950000 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct

Test #49:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

3 3
9.0

output:

7
0.000000 0.000000
3.000000 0.000000
3.000000 1.000000
1.500000 1.000000
1.500000 2.000000
3.000000 2.000000
3.000000 3.000000

result:

ok correct

Test #50:

score: 0
Accepted
time: 3ms
memory: 3736kb

input:

4 4
16.0

output:

7
0.000000 0.000000
4.000000 0.000000
4.000000 1.000000
0.000000 1.000000
0.000000 2.000000
4.000000 2.000000
4.000000 4.000000

result:

ok correct