0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 20:28:48 +00:00

Compare commits

..

No commits in common. "8e52eb791683a0602c706a69c53bcbf9ab6a3a9d" and "e181b698deb0f83b805ae176cf5f7b0eb19a117e" have entirely different histories.

108 changed files with 2 additions and 436 deletions

View File

@ -2,7 +2,7 @@
[![Author](https://img.shields.io/badge/Author-Baoshuo-b68469.svg?style=flat-square)](https://baoshuo.ren) [![Stars](https://img.shields.io/github/stars/renbaoshuo/OI-codes?style=flat-square)](https://github.com/renbaoshuo/OI-codes/stargazers) [![GPL-3.0 License](https://img.shields.io/github/license/renbaoshuo/OI-codes?style=flat-square)](/LICENSE)
本仓库的主仓库位于 [GitSB](https://git.sb/baoshuo/OI-codes) 上,并在 [GitHub](https://github.com/renbaoshuo/OI-codes)、[GitLab](https://gitlab.com/baoshuo/OI-codes) 和 [GitMac](https://git.m.ac/baoshuo/OI-codes) 上设立了镜像。
本仓库的主仓库位于 [GitSB](https://git.sb/baoshuo/OI-codes) 上,并在 [GitHub](https://github.com/renbaoshuo/OI-codes) 和 [GitLab](https://gitlab.com/baoshuo/OI-codes) 上设立了镜像。
## 说明
@ -41,7 +41,7 @@ git lfs clone https://git.sb/baoshuo/OI-codes.git
如果克隆仓库时不需要拉取测试数据,可以使用以下命令:
```bash
GIT_LFS_SKIP_SMUDGE=1 git clone https://git.sb/baoshuo/OI-codes.git
git clone https://git.sb/baoshuo/OI-codes.git --skip-smudge
```
后期如果希望再次拉取测试数据,可以使用以下命令:

View File

@ -1,50 +0,0 @@
#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)

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

View File

@ -1,69 +0,0 @@
#include <cstdio>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 105;
int n;
std::string s[N];
std::unordered_map<std::string, std::pair<std::string, bool>> def;
std::string dfs(std::string s) {
std::string r;
for (int i = 0, j; i < s.size(); i += j) {
for (j = 0; i + j < s.size() &&
('0' <= s[i + j] && s[i + j] <= '9' ||
'a' <= s[i + j] && s[i + j] <= 'z' ||
'A' <= s[i + j] && s[i + j] <= 'Z' || s[i + j] == '_');
j++)
;
if (j) {
std::string tmp = s.substr(i, j), tmp2;
if (def.count(tmp) && !def[tmp].second) {
def[tmp].second = true;
r += dfs(def[tmp].first);
def[tmp].second = false;
} else {
r += tmp;
}
} else {
r += s[i++];
}
}
return r;
}
int main() {
cin >> n;
for (int i = 0; i <= n; i++) {
std::getline(cin, s[i]);
}
for (int i = 1; i <= n; i++) {
if (s[i][0] == '#') {
if (s[i].substr(1, 6) == "define") {
int p = s[i].find_first_of(' ', 8);
std::string name = s[i].substr(8, p - 8),
content = s[i].substr(p + 1);
def[name] = std::make_pair(content, false);
} else { // s[i].substr(1, 6) == "undef"
std::string name = s[i].substr(7);
def.erase(name);
}
cout << endl;
} else {
cout << dfs(s[i]) << endl;
}
}
return 0;
}

BIN
UniversalOJ/734/data/ex_preprocessor1.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/ex_preprocessor1.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/ex_preprocessor2.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/ex_preprocessor2.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor1.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor1.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor10.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor10.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor2.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor2.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor3.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor3.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor4.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor4.in (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor5.ans (Stored with Git LFS)

Binary file not shown.

BIN
UniversalOJ/734/data/preprocessor5.in (Stored with Git LFS)

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More