• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
magicat
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Codeforces

1 2 下一页
Educational Codeforces Round 7 A - E

摘要:# [Educational Codeforces Round 7](https://codeforces.com/contest/622) [TOC] ## [A - Infinite Sequence](https://codeforces.com/contest/622/problem/A) 阅读全文
posted @ 2023-09-04 00:57 magicat 阅读(34) 评论(0) 推荐(0)
Educational Codeforces Round 6 A - E

摘要:# [Educational Codeforces Round 6](https://codeforces.com/contest/620) [TOC] ## [A - Professor GukiZ's Robot](https://codeforces.com/contest/620/probl 阅读全文
posted @ 2023-09-03 02:15 magicat 阅读(23) 评论(0) 推荐(0)
Educational Codeforces Round 23 A - F

摘要:# [Educational Codeforces Round 23](https://codeforces.com/contest/817) [TOC] ## [A - Treasure Hunt](https://codeforces.com/contest/817/problem/A) 往四个 阅读全文
posted @ 2023-09-02 18:09 magicat 阅读(25) 评论(0) 推荐(0)
Educational Codeforces Round 15 A - E

摘要:# [Educational Codeforces Round 15](https://codeforces.com/contest/702) [TOC] ## [A - Maximum Increase](https://codeforces.com/contest/702/problem/A) 阅读全文
posted @ 2023-09-01 21:31 magicat 阅读(31) 评论(0) 推荐(0)
Educational Codeforces Round 5 A-E

摘要:# [Educational Codeforces Round 5](https://codeforces.com/contest/616) ![image](https://img2023.cnblogs.com/blog/2458891/202309/2458891-20230901195448 阅读全文
posted @ 2023-09-01 19:12 magicat 阅读(32) 评论(0) 推荐(0)
Codeforces Round 894 (Div. 3) ABCDEFG AK

摘要:# [Codeforces Round 894 (Div. 3)](https://codeforces.com/contest/1862) ![image](https://img2023.cnblogs.com/blog/2458891/202308/2458891-20230827125219 阅读全文
posted @ 2023-08-26 18:16 magicat 阅读(164) 评论(0) 推荐(0)
2023湖北省赛 VP 5题MCHJF + 1题K

摘要:2023湖北省赛 榜单 M 解方程 void solve() { ll x,y; cin>>x>>y; bool ok = false; ll z = x * 1000 - y; for(ll a = 0; a <= 1000000; a++) { ll t = a * 1000 - z; if(t 阅读全文
posted @ 2023-05-07 20:28 magicat 阅读(83) 评论(0) 推荐(0)
C. Ehab and Path-etic MEXs

摘要:C. Ehab and Path-etic MEXs 对于成链的情况,$\text{MEX} = n - 1$ 一般的,一定有一条路径包含0和1,则可以确定$\text{MEX} \geq 2$,观察发现,对于度数$\geq 3$的点,我们在他的三条边赋值为0, 1, 2使得其他路径的边有: 0,1 阅读全文
posted @ 2023-05-06 17:53 magicat 阅读(44) 评论(0) 推荐(0)
Chemistry Experiment Codeforces Round 247 (Div. 2) 线段树动态开点,二分

摘要:第一次写的时候还不会线段树的动态开点,写了一个是线段树但是是$O(N^2)$的写法,现在用动态开点武装了自己,会了正解$O(qlog n^2)$。首先建立一个权值线段树,但这里的权值很大,通过动态开点去建树来节省空间,对于两种操作: 操作1,常见的动态开点的单点修改 操作2,二分答案,然后在线段树上 阅读全文
posted @ 2023-05-02 22:20 magicat 阅读(56) 评论(0) 推荐(2)
D. Solve The Maze

摘要:D. Solve The Maze 大意:建墙让所有好人可以到达坐标$(n,m)$,任何一个坏人都不能到达坐标$(n,m)$ 分析: 把坏人直接关起来,在坏人的四面建墙, 统计好人的人数 从坐标$(n,m)$去遍历,整个地图,看能不能遇到所有好人 3可以通过dsu, flood-fill等去做吧 细 阅读全文
posted @ 2023-04-21 16:59 magicat 阅读(42) 评论(0) 推荐(0)
D. Non-zero Segments

摘要:D. Non-zero Segments 过程:手玩样例发现,前缀和中出现相同值即为区间和为0 由前缀和公式$S_i = S_{i - 1} + A_i$可以知道,区间$[l,r]$满足题意即为$S_r = S_{l-1}$,对于每个这样的区间插入个巨大的数,让区间$[1, r-1]$的前缀和都作废 阅读全文
posted @ 2023-04-21 16:30 magicat 阅读(27) 评论(0) 推荐(0)
B. Plus and Multiply

摘要:B. Plus and Multiply 手模拟了一下 观察每个式子,化简得到: $a^x + by = n $ 由于$a^x$是指数增长,直接枚举它的幂次即可,注意对$a=1$的情况特判 // AC one more times #include <bits/stdc++.h> using nam 阅读全文
posted @ 2023-04-09 22:29 magicat 阅读(51) 评论(0) 推荐(0)
B. Phoenix and Beauty

摘要:B. Phoenix and Beauty 要求所有长度为$k$的子数组之和相同,观察样例可以发现,当原数组中不同的元素个数小于等于$k$时可以满足条件,同时输出的数组长度$m$很大,可以从这里入手 构造一个有所有元素的数组,当这个数组长度不足时,补其他元素进去,答案即为 $\frac{10000} 阅读全文
posted @ 2023-04-09 21:59 magicat 阅读(21) 评论(0) 推荐(0)
Educational Codeforces Round 3 个人总结A-E

摘要:[Educational Codeforces Round 3](https://codeforces.com/contest/609 "Educational Codeforces Round 3") A. USB Flash Drives + 降序排序后,贪心,甚至不会爆longlong ``` 阅读全文
posted @ 2023-01-28 17:02 magicat 阅读(56) 评论(1) 推荐(0)
Educational Codeforces Round 2 个人总结A-E

摘要:Educational Codeforces Round 2 A. Extract Numbers 简单的模拟 bool check(string op) { if(op.size()==1&&op[0]=='0') return true; if(op.size()==0||(op[0]<'1'| 阅读全文
posted @ 2023-01-28 01:44 magicat 阅读(59) 评论(0) 推荐(0)
Educational Codeforces Round 1 个人总结A-E

摘要:Educational Codeforces Round 1 A. Tricky Sum 数学,求$1 \dots n$的和减去 小于等于n的二次幂乘2之和 LL f[40]; void solve() { LL n; cin>>n; LL ans=n+n*(n-1)/2; for(int i=0; 阅读全文
posted @ 2023-01-21 14:53 magicat 阅读(98) 评论(0) 推荐(0)
标记一下CF教育场的网址

摘要:#(因为太难翻了,做到哪里标到哪,自用 Educational Codeforces Round 1 Educational Codeforces Round 2 Educational Codeforces Round 3 阅读全文
posted @ 2023-01-18 04:08 magicat 阅读(33) 评论(0) 推荐(0)
上分准备 VP Codeforces Round #762 (Div. 3) 4题ABCE

摘要:+00:02 +00:16 +01:08 +02:07 VP 情况 4/8 ABCE ,赛时排名可以到823,什么时候我可以上个青 B 本想写个map的二分的,发现自己不会,写了个普普通通的二分 C 高精度模拟,一发过了,用个vector将每个数位存起来,从个位开始判断,如果 A_i 的数能加上小于 阅读全文
posted @ 2022-07-31 09:46 magicat 阅读(44) 评论(0) 推荐(0)
上分之路 VP Codeforces Round #744 (Div. 3) ABDE

摘要:VP情况 4 / 8 AC: A,B,D,E1 60 minutes WA: C 4 127 +00:02 +00:28 -7 +00:58 +00:39 手速还在线 D pair排个序, 分类讨论 个人最多的聚会>=其余n-1 人的聚会,这里答案就很清楚了 个人最多的聚会<其余n-1 人的聚会,将 阅读全文
posted @ 2022-07-30 20:10 magicat 阅读(68) 评论(0) 推荐(0)
E. Gardener and Tree 拓扑排序板子

摘要:E. Gardener and Tree 将度为1的顶点加入队列,做拓扑排序,记录点的遍历层次,答案为 n-前k层的点的数量 // AC one more times void solve() { int n; cin>>n; int k; cin>>k; int st[n+10];memset(s 阅读全文
posted @ 2022-07-30 20:03 magicat 阅读(46) 评论(0) 推荐(0)

1 2 下一页
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3