• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
nannandbk
博客园    首页    新随笔    联系   管理    订阅  订阅
1 2 3 4 5 ··· 12 下一页
[置顶] 算法竞赛个人模板
摘要: Math & DP & Data structure & Graph & Geometry & Game 表演者: magicat 💕 nannan 目录 Math & DP & Data structure & Graph & Geometry & GameHead快读1快读2快读3模板1模板2 阅读全文
posted @ 2024-10-12 17:33 nannandbk 阅读(211) 评论(0) 推荐(1)
2024年11月29日
快排思想O(N)求第k大数
摘要: 快排思想O(N)求第k大数 int quicksort(int l,int r,int k) { int midv = a[(l+r)>>1]; int i = l,j = r; while(i <= j) { while(a[i] < midv)i++; while(a[j] > midv)j-- 阅读全文
posted @ 2024-11-29 19:34 nannandbk 阅读(30) 评论(0) 推荐(1)
2024年10月30日
置换环
摘要: 置换环 作用:求解数组排序元素间所需最小交换次数这类问题。 思想:置换环将每个元素指向其排序后应在的位置,最终首位相连形成一个环(若数字在最终位置,则其自身成环),可知元素之间的交换只会在同一个环内进行,而每个环内的最小交换次数为\(环上元素个数-1\)。 则总交换次数:\(ans = \sum_{ 阅读全文
posted @ 2024-10-30 21:49 nannandbk 阅读(283) 评论(0) 推荐(2)
Codeforces Round 981 (Div. 3) ABCDE
摘要: Codeforces Round 981 (Div. 3)ABCDE A. Sakurako and Kosuke 藕是看样例直接猜了结论😜 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; ty 阅读全文
posted @ 2024-10-30 21:47 nannandbk 阅读(164) 评论(0) 推荐(1)
2024年10月29日
2024 江西省赛 ACGHJK
摘要: 2024 江西省赛 ACGHJK A. Maliang Learning Painting 思路:签到,加起来就行了。 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; typedef long l 阅读全文
posted @ 2024-10-29 15:16 nannandbk 阅读(36) 评论(0) 推荐(1)
2024 黑龙江省赛 BDIJK
摘要: The 19th Heilongjiang Provincial Collegiate Programming Contest BDIJK B. String 思路:连续的3个可以删掉,类似括号匹配,用栈模拟即可。 // AC one more times // nndbk #include <bi 阅读全文
posted @ 2024-10-29 15:15 nannandbk 阅读(105) 评论(0) 推荐(0)
2024年10月25日
河南萌新联赛2024第(二)场 ADEFGHIJ
摘要: 河南萌新联赛2024第(二)场 ADEFGHIJ A-国际旅行Ⅰ 思路:因为都是连通的,所以直接排序就行了。 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; typedef long long l 阅读全文
posted @ 2024-10-25 20:50 nannandbk 阅读(31) 评论(0) 推荐(1)
2024年10月19日
2020 CCPC河南省赛 ABCEI
摘要: 2020 CCPC河南省赛 A - 班委竞选 签到不多说 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7 阅读全文
posted @ 2024-10-19 14:16 nannandbk 阅读(35) 评论(0) 推荐(1)
2024年10月17日
2024 东北四省省赛 ADEJ
摘要: The 2024 CCPC National Invitational Contest (Northeast) ADEJ A.PaperWatering 思路:有两种类型的操作,对一个数开根号或平方。 平方没有什么问题,开根号由于是向下取整再平方就会产生不一样的数。 那么做法也很简单了。 对于一个数 阅读全文
posted @ 2024-10-17 15:15 nannandbk 阅读(37) 评论(0) 推荐(1)
2024年10月15日
Codeforces Round 978 (Div. 2) C. Gerrymandering 轮廓DP
摘要: Codeforces Round 978 (Div. 2) C轮廓DP C. Gerrymandering 思路:考虑有哪些情况呢? 发现结尾只有三种情况,0.平的,1.上凸,2.下凸。 那么每一种后面能出现什么呢? 这样看起来就好写啦。 // AC one more times // nndbk 阅读全文
posted @ 2024-10-15 23:11 nannandbk 阅读(218) 评论(0) 推荐(1)
2024 CCPC长春邀请赛 IGLE
摘要: 2024CCPC长春邀请赛IGLE I. The Easiest Problem 签到 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; typedef long long ll; const in 阅读全文
posted @ 2024-10-15 15:13 nannandbk 阅读(218) 评论(0) 推荐(1)
1 2 3 4 5 ··· 12 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3