462 字
2 分钟
cf edu round 191
NOTE
A - AI Project Development
关键词:推公式
思路

Code
// Problem: CF 2233 A// Contest: Codeforces - Educational Codeforces Round 191 (Rated for Div. 2)// URL: https://codeforces.com/contest/2233/problem/A// Time: 2026-06-10 00:48:25#include <bits/stdc++.h>using namespace std;
// clang-format off#define endl '\n'#define all(x) (x).begin(), (x).end()#define fastio() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);// clang-format on
using ll = long long;using ull = unsigned long long;using pii = pair<int, int>;using pdd = pair<double, double>;using pll = pair<long long, long long>;using i128 = __int128;
const int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};const int inf = 0x3f3f3f3f;const int N = 0;
void solve(){ double n, x, y, z; cin >> n >> x >> y >> z;
int res1 = ceil(n / (x + y)); int res2 = ceil(n / x); int res3 = z + ceil((n - x * z) / (x + 10 * y));
cout << min({res1, res2, res3}) << endl;}
int main(){ fastio();
int T = 1; cin >> T;
while (T--) solve();
return 0;}B - Different Distances
关键词:构造
思路
题目要求每个数字出现 次,并且同一个数字的三段相邻出现距离两两不同。
考虑循环移位,注意每次左移量要设成不一样的值。这样才能保证相邻的出现距离不同。
Code
// Problem: CF 2233 B// Contest: Codeforces - Educational Codeforces Round 191 (Rated for Div. 2)// URL: https://codeforces.com/contest/2233/problem/B// Time: 2026-06-10 00:57:04#include <bits/stdc++.h>using namespace std;
// clang-format off#define endl '\n'#define all(x) (x).begin(), (x).end()#define fastio() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);// clang-format on
using ll = long long;using ull = unsigned long long;using pii = pair<int, int>;using pdd = pair<double, double>;using pll = pair<long long, long long>;using i128 = __int128;
const int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};const int inf = 0x3f3f3f3f;const int N = 0;
void solve(){ int n; cin >> n;
vector<int> a(n); iota(all(a), 1);
for (int i = 1; i <= 4; i++) { for (auto x: a) cout << x << " "; rotate(a.begin(), a.begin() + (i % n), a.end()); } cout << endl;}
int main(){ fastio();
int T = 1; cin >> T;
while (T--) solve();
return 0;}