当前位置: 首页 > news >正文

外卖网站建设方案书个人主页怎么申请

外卖网站建设方案书,个人主页怎么申请,智恒企业网站管理系统,thinkphp官方网站2025.2.17——1400 A 1400 B 1400 C 1400 ------------------------------------------------ 二分构造字符串/贪心/思维。CF的题就得多看透几层表面发掘本质。 A 一眼单调性。分析后可以二分答案。 B 本质是: ( j − i ) ∣ n , s [ i ] ! s [ j ] (j-i)|n,…

2025.2.17——1400


A 1400

B 1400

C 1400

------------------------------------------------

  • 二分+构造+字符串/贪心/思维。CF的题就得多看透几层表面发掘本质。


A

  1. 一眼单调性。
  2. 分析后可以二分答案。

B

  1. 本质是: ( j − i ) ∣ n , s [ i ] ! = s [ j ] (j-i)|n,s[i]!=s[j] (ji)n,s[i]!=s[j] 。设想一个周期为 T T T
  2. 设最小的不能被 n n n 整除的数为 t t t 。必要性: T > = t T>=t T>=t 。充分性: T = = t T==t T==t 时, s [ i ] = = s [ j ] s[i]==s[j] s[i]==s[j]的距离为 t t t 的倍数,不能被 n n n 整除,满足题意。
  3. 绝妙的构造…

C

  1. 字符串贪心匹配。看着题解想了好久,值得多几次回味。解法和优化亦多样,正难则反/搜索/动态规划…

------------------------代码------------------------

A

#include <bits/stdc++.h>
#define int long long
using namespace std;
#define bug(BUG) cout << "bug:# " << (BUG) << endl
#define bug2(BUG1, BUG2) cout << "bug:# " << (BUG1) << " " << (BUG2) << endl
#define bug3(BUG1, BUG2, BUG3) cout << "bug:# " << (BUG1) << ' ' << (BUG2) << ' ' << (BUG3) << endl
#define bugv(VEC)               \{                           \for (auto Vec : VEC)    \cout << Vec << ' '; \cout << '\n';           \}void _();
signed main()
{ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);cout << fixed << setprecision(10);int T = 1;cin >> T;while (T--)_();return 0;
}void _()
{int n;cin >> n;vector<int> a(n + 1);for (int i = 1; i <= n; i++)cin >> a[i];sort(begin(a) + 1, end(a));// bugv(a);auto ok = [&](int x){int cnt = 0;// bug2(1, x);for (int i = 1; i <= n;){int j = i;cnt++;for (; j <= n && a[j] - a[i] <= x << 1; j++);i = j;// bug(i);}// bug2(2, cnt);return cnt <= 3;};// ok(2);int l = -1, r = 1e9;while (r - l - 1){int mid = l + r >> 1;if (ok(mid))r = mid;elsel = mid;}cout << r << '\n';
}

B

#include <bits/stdc++.h>
#define int long long
using namespace std;
#define bug(BUG) cout << "bug:# " << (BUG) << endl
#define bug2(BUG1, BUG2) cout << "bug:# " << (BUG1) << " " << (BUG2) << endl
#define bug3(BUG1, BUG2, BUG3) cout << "bug:# " << (BUG1) << ' ' << (BUG2) << ' ' << (BUG3) << endl
#define bugv(VEC)               \{                           \for (auto Vec : VEC)    \cout << Vec << ' '; \cout << '\n';           \}void _();
signed main()
{ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);cout << fixed << setprecision(10);int T = 1;cin >> T;while (T--)_();return 0;
}void _()
{int n;cin >> n;int st = 1;while (n % st == 0)st++;for (int i = 0; i < n; i++)cout << (char)('a' + i % st);cout << '\n';
}

C

#include <bits/stdc++.h>
#define int long long
using namespace std;
#define bug(BUG) cout << "bug:# " << (BUG) << endl
#define bug2(BUG1, BUG2) cout << "bug:# " << (BUG1) << " " << (BUG2) << endl
#define bug3(BUG1, BUG2, BUG3) cout << "bug:# " << (BUG1) << ' ' << (BUG2) << ' ' << (BUG3) << endl
#define bugv(VEC)               \{                           \for (auto Vec : VEC)    \cout << Vec << ' '; \cout << '\n';           \}void _();
signed main()
{ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);cout << fixed << setprecision(10);int T = 1;cin >> T;while (T--)_();return 0;
}void _()
{string s;cin >> s;int m;cin >> m;string l, r;cin >> l >> r;int st = 0;int n = s.size();s = ' ' + s;for (int i = 0; i < m; i++){int mx = st + 1;for (int j = l[i] - '0'; j <= r[i] - '0'; j++){int t = st + 1;while (t <= n && j != s[t] - '0')t++;mx = max(mx, t);}st = mx;}cout << (st > n ? "YES" : "NO") << '\n';
}

http://www.dtcms.com/a/440384.html

相关文章:

  • 深圳做企业网站沈阳建设工程管理中心
  • 巩义移动网站建设网站服务器拒绝连接
  • 网站建设 免费视频网站怎么添加关键词 好让百度收入_ 现在网站用的是模板做的
  • termsrv!InitializeSystemTrace函数分析开启调试TraceEnable和TraceClass和TraceDebugger
  • 网站建设合同百度文库wordpress 计划表格
  • 公司域名注册网站哪个好网站建设需求分析流程图
  • FTP 概念及题目
  • 如手机网站源码软件开发专业好吗
  • 公司网站建设会计分录西安wordpress开发
  • 如何建立公司网站模块校园网络及网站建设
  • 手游网站开发客户管理系统的功能
  • 网站建设 银川南京广告公司排名前十
  • 彩票网站建设维护wordpress数据库出错
  • 网站建站的步骤网络服务平台标书
  • 自学网站建设多久wordpress 开源协议
  • 英文自助建站贸易公司网站建设方案
  • 无法访问服务器上网站seo基础培训教程
  • 如何做视频网站旗下账号google谷歌搜索引擎
  • 牛客小白月赛121(ABCDE)
  • 河北省住房和城乡建设厅网站查询注册电气师在哪个网站做变更
  • 昌大建设原名叫什么西安全网优化
  • 科技 网站建设关注love石家庄公众号微信
  • 建材营销型的网站wordpress分类目录页
  • 申报教学成果奖的网站建设网站开发与设计课程设计
  • 怎样找到网站后台入口在哪个网站做跨境电商
  • 郑州网站建设口碑好网站与经营网站
  • 网站建设需要找网站建设公司做吗住房和城乡建设部网站评估
  • 建设网站大约多少钱成品app
  • 国外网站打开很慢wordpress radiate
  • 晚上必看正能量网站短视频北京模板建站公司