From cd79a24351802129ddf6d20c5e3d2ecaaa131454 Mon Sep 17 00:00:00 2001 From: Frederick Chen Date: Fri, 14 Feb 2025 13:13:39 +0000 Subject: [PATCH] Finish: Luogu Beginer Conest(Feb) --- .gitignore | 3 +- [语言月赛 202502] 地铁环线.cpp | 27 ++++++++++++ [语言月赛 202502] 披萨订单.cpp | 37 ++++++++++++++++ [语言月赛 202502] 本俗妙手不如举手.cpp | 58 ++++++++++++++++++++++++++ [语言月赛 202502] 蛋挞烤制.cpp | 23 ++++++++++ [语言月赛 202502] 随机数.cpp | 28 +++++++++++++ 6 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 [语言月赛 202502] 地铁环线.cpp create mode 100644 [语言月赛 202502] 披萨订单.cpp create mode 100644 [语言月赛 202502] 本俗妙手不如举手.cpp create mode 100644 [语言月赛 202502] 蛋挞烤制.cpp create mode 100644 [语言月赛 202502] 随机数.cpp diff --git a/.gitignore b/.gitignore index 8d1cafc..a9b522b 100644 --- a/.gitignore +++ b/.gitignore @@ -53,4 +53,5 @@ dkms.conf # config fame.cpp -.cph/ \ No newline at end of file +.cph/ +.vscode/ \ No newline at end of file diff --git a/[语言月赛 202502] 地铁环线.cpp b/[语言月赛 202502] 地铁环线.cpp new file mode 100644 index 0000000..8aabb0c --- /dev/null +++ b/[语言月赛 202502] 地铁环线.cpp @@ -0,0 +1,27 @@ +#include +#define lo long long +#define INF INT_MAX +#define LLM LONG_LONG_MAX + +using namespace std; +const lo N = 1e7 + 10; +/* + toothless. #17 + @fredcss_dev +*/ + +signed main() { + lo n, x, y; + cin >> n >> x >> y; + lo cw = (y - x + n) % n; + lo cnt = n - cw; + if (cw < cnt) { + cout << "Clockwise Loop" << endl; + } else if (cw > cnt) { + cout << "Counter-clockwise Loop" << endl; + } else { + cout << "\"Wonderful\"" << endl; + } + + return 0; +} diff --git a/[语言月赛 202502] 披萨订单.cpp b/[语言月赛 202502] 披萨订单.cpp new file mode 100644 index 0000000..ec1d3f8 --- /dev/null +++ b/[语言月赛 202502] 披萨订单.cpp @@ -0,0 +1,37 @@ +#include +#define lo long long +#define INF INT_MAX +#define LLM LONG_LONG_MAX + +using namespace std; +const int N = 1e7 + 10; +/* + toothless. #17 + @fredcss_dev +*/ + +signed main() { + int X, Y, K; + cin >> X >> Y >> K; + + int mx = -1; + int count = 0; + for (int b = 0; b <= X; ++b) { + for (int p = 1; p <= Y; ++p) { + for (int z = 0; z <= K; ++z) { + int d = (b + p) ^ z; + if (d > mx) { + mx = d; + count = 1; + } else if (d == mx) { + ++count; + } + } + } + } + + cout << mx << endl; + cout << count << endl; + + return 0; +} \ No newline at end of file diff --git a/[语言月赛 202502] 本俗妙手不如举手.cpp b/[语言月赛 202502] 本俗妙手不如举手.cpp new file mode 100644 index 0000000..50aeb2f --- /dev/null +++ b/[语言月赛 202502] 本俗妙手不如举手.cpp @@ -0,0 +1,58 @@ +#include +#define lo long long +#define INF INT_MAX +#define LLM LONG_LONG_MAX + +using namespace std; +const int N = 1e7 + 10; +/* + toothless. #17 + @fredcss_dev +*/ + +int f(int n, int k, vector& a) { + // 初始胜场数计算 + int red = 0, pink = 0; + for (int ai : a) { + if (ai > 49) { + red++; + } else { + pink++; + } + } + int cnt = 0; + for (int l = 0; l <= n - k; l++) { + int chr = 0, cpi = 0; + for (int i = l; i < l + k; i++) { + bool ysfred = (a[i] > 49); + int tzhred = a[i] - 2; + int tzhpink = 101 - a[i]; + bool tzhredWin = (tzhred > tzhpink); + if (ysfred && !tzhredWin) { + chr--; + cpi++; + } else if (!ysfred && tzhredWin) { + chr++; + cpi--; + } + } + int nre = red + chr; + int npi = pink + cpi; + if (npi > nre) { + cnt++; + } + } + return cnt; +} + +int main() { + int n, k; + cin >> n >> k; + vector a(n); + for (int i = 0; i < n; i++) { + cin >> a[i]; + } + int result = f(n, k, a); + cout << result << endl; + return 0; +} \ No newline at end of file diff --git a/[语言月赛 202502] 蛋挞烤制.cpp b/[语言月赛 202502] 蛋挞烤制.cpp new file mode 100644 index 0000000..0a3cda8 --- /dev/null +++ b/[语言月赛 202502] 蛋挞烤制.cpp @@ -0,0 +1,23 @@ +#include +#define lo long long +#define INF INT_MAX +#define LLM LONG_LONG_MAX + +using namespace std; +const lo N = 1e7 + 10; +/* + toothless. #17 + @fredcss_dev +*/ + +signed main() { + lo V_egg, V_milk, V_tart; + lo e, m, t; + cin >> V_egg >> V_milk >> V_tart; + cin >> e >> m >> t; + lo total_volume = V_egg * e + V_milk * m; + lo num_tarts = (total_volume + V_tart - 1) / V_tart; + lo batches = (num_tarts + t - 1) / t; + cout << batches << endl; + return 0; +} \ No newline at end of file diff --git a/[语言月赛 202502] 随机数.cpp b/[语言月赛 202502] 随机数.cpp new file mode 100644 index 0000000..09d4d10 --- /dev/null +++ b/[语言月赛 202502] 随机数.cpp @@ -0,0 +1,28 @@ +#include +#define lo long long +#define INF INT_MAX +#define LLM LONG_LONG_MAX + +using namespace std; +const lo N = 1e7 + 10; +/* + toothless. #17 + @fredcss_dev +*/ + +signed main() { + lo n, L, R; + cin >> n >> L >> R; + lo S = L; + lo k = S / n; + lo r = S % n; + vector ans(n, k); + for (lo i = 0; i < r; ++i) { + ans[i] += 1; + } + for (lo i = 0; i < n; ++i) { + cout << ans[i] << " "; + } + cout << endl; + return 0; +} \ No newline at end of file