0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 19:08:47 +00:00

1466. 【2022.7.8】棍子 sticks

https://sjzezoj.com/submission/53557
This commit is contained in:
Baoshuo Ren 2022-07-08 17:22:42 +08:00
parent e181b698de
commit 175df46d5e
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
82 changed files with 293 additions and 0 deletions

50
S2OJ/1466/1466.cpp Normal file
View File

@ -0,0 +1,50 @@
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 55;
const double eps = 1e-10;
int n, c, k, a[N];
bool check(double x) {
int t = std::lower_bound(a + 1, a + 1 + n, static_cast<int>(x), std::greater<int>()) - a;
if (n + c - (n - t + 1) < k) return false; // 最坏情况时无法满足要求
int cnt = 0;
for (int i = 1; i <= t; i++) {
cnt += a[i] / x; // 能拆成几个满足要求的
}
return cnt >= k;
}
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> c >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
std::sort(a + 1, a + 1 + n, std::greater<int>());
double l = 0, r = 1e9;
for (int i = 0; i < 1000; i++) {
double mid = (l + r) / 2;
(check(mid) ? l : r) = mid;
}
cout << std::fixed << std::setprecision(12) << l << endl;
return 0;
}

BIN
S2OJ/1466/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks11.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks11.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks12.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks12.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks13.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks13.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks14.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks14.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks15.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks15.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks16.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks16.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks17.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks17.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks18.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks18.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks19.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks19.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks20.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks20.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks21.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks21.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks22.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks22.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks23.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks23.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks24.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks24.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks25.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks25.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks26.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks26.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks27.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks27.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks28.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks28.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks29.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks29.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks30.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks30.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks31.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks31.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks32.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks32.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks33.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks33.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks34.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks34.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks35.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks35.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks36.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks36.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks37.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks37.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks38.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks38.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks39.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks39.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks40.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks40.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1466/data/sticks9.out (Stored with Git LFS) Normal file

Binary file not shown.