mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-06-07 20:10:26 +08:00
Finish: Luogu Beginer Conest(Feb)
This commit is contained in:
parent
377cd93809
commit
cd79a24351
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,4 +53,5 @@ dkms.conf
|
||||
|
||||
# config
|
||||
fame.cpp
|
||||
.cph/
|
||||
.cph/
|
||||
.vscode/
|
27
[语言月赛 202502] 地铁环线.cpp
Normal file
27
[语言月赛 202502] 地铁环线.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <bits/stdc++.h>
|
||||
#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;
|
||||
}
|
37
[语言月赛 202502] 披萨订单.cpp
Normal file
37
[语言月赛 202502] 披萨订单.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
#include <bits/stdc++.h>
|
||||
#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;
|
||||
}
|
58
[语言月赛 202502] 本俗妙手不如举手.cpp
Normal file
58
[语言月赛 202502] 本俗妙手不如举手.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
#include <bits/stdc++.h>
|
||||
#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<int>& 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<int> a(n);
|
||||
for (int i = 0; i < n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
int result = f(n, k, a);
|
||||
cout << result << endl;
|
||||
return 0;
|
||||
}
|
23
[语言月赛 202502] 蛋挞烤制.cpp
Normal file
23
[语言月赛 202502] 蛋挞烤制.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
#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;
|
||||
}
|
28
[语言月赛 202502] 随机数.cpp
Normal file
28
[语言月赛 202502] 随机数.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <bits/stdc++.h>
|
||||
#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<lo> 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user