Logo xushuoxin的博客

博客

#743. 网线切割题目描述有误

2022-08-16 19:58:40 By xushuoxin

输入文件的第一行由两个整数N和K组成,由一个空格间隔。N(1≤N≤10000)是仓库里光缆的数目,K(1≤K≤10000)是需要的网线数目。

接下来的N行每行只有一个实数,告诉你每根缆线的长度(单位:m)。这些网线至少长1m,最多不超过100km。

所有的长度精确到cm,且小数点后有且仅有两位

Test #1:

score: 10

time: 0ms

memory: 1628kb

input:

59 67

10.5933(说好的两位小数呢)

8.5933

1.5933

2.5933

3.5933

4.5933

1.5933

6.5933

8.5933

8.5933

4.5933

8.5933

3.5933

5....

output:

3.53

Test #2:

score: 10

time: 1ms

memory: 1628kb

input:

96 52

3.5933

2.5933

10.5933

2.5933

4.5933

2.5933

6.5933

4.5933

4.5933

7.5933

10.5933

5.5933

8...

output:

5.59

Test #3:

score: 10

time: 0ms

memory: 1632kb

input:

51 14

8.5933

6.5933

8.5933

8.5933

4.5933

5.5933

6.5933

3.5933

1.5933

10.5933

1.5933

1.5933

10.5933

5...

output:

8.59

Test #4:

score: 10

time: 0ms

memory: 1636kb

input:

24 4

1.5933

6.5933

7.5933

4.5933

2.5933

8.5933

9.5933

5.5933

6.5933

8.5933

1.5933

2.5933

5.5933

4.59...

output:

9.59

Test #5:

score: 10

time: 0ms

memory: 1636kb

input:

60 2

3.5933

2.5933

6.5933

9.5933

4.5933

5.5933

3.5933

3.5933

6.5933

8.5933

10.5933

2.5933

7.5933

9.5...

output:

10.59

Test #6:

score: 10

time: 0ms

memory: 1632kb

input:

110 5283

56.5933

61.5933

12.5933

43.5933

72.5933

41.5933

93.5933

38.5933

39.5933

90.5933

40.5933

92....

output:

0.99

Test #7:

score: 10

time: 2ms

memory: 1660kb

input:

2569 7690

81.5933

43.5933

90.5933

43.5933

87.5933

77.5933

16.5933

33.5933

57.5933

76.5933

11.5933

46...

output:

14.52

望改正

评论

徐佳元
精度的话可以double转int
Maguoming2012
emmmmmmmmmmmmmmm……
yizexi
#743 网线切割 二分答案 10查找 AC率:14%

发表评论

可以用@mike来提到mike这个用户,mike会被高亮显示。如果你真的想打“@”这个字符,请用“@@”。