随笔分类 -  CF

1 2 3 4 5 ··· 8 下一页
摘要:把字符串翻转之后处理会更加方便 #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define rep(i,a,b) for(ll i=(a);i<=(b);i++) #define dec(i 阅读全文
posted @ 2022-01-15 00:11 DeaL57 阅读(87) 评论(0) 推荐(0)
摘要:https://codeforces.com/problemset/problem/1619/E 用栈处理 #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define rep(i,a,b) 阅读全文
posted @ 2022-01-14 23:39 DeaL57 阅读(62) 评论(0) 推荐(0)
摘要:求有胜利的情况: 定义dp[i][j],i个人,生命在j内,最后剩1个人的情况 每次每个人损失i-1点生命值,枚举死亡人数k,这些人生命值小于i dp[i][j] += dp[i-k][j-(i-1)]*(i-1)k*Cik 死亡人数有 k 个,我们要从i个人中选出 k 个人来死亡 死亡的人中,因为 阅读全文
posted @ 2022-01-13 17:02 DeaL57 阅读(29) 评论(0) 推荐(0)
摘要:1475D - Cleaning the Phone 双指针 E - Correct Placement 偏序 Rating Compression 1一定在边上,是序列的条件是一定有1,从两边往中间check,保证较小的数在边上 阅读全文
posted @ 2021-01-27 23:31 DeaL57 阅读(59) 评论(0) 推荐(0)
摘要:Checkpoints 100……00(长度为i),从左边打到右边需要2i+1-2次 发现可以分段,直接找规律 XOR-gun 60以上必定存在连续三个最高位数一样的数 60以下暴力 异或前缀和:a[l]⊕……⊕a[r]=pre[r]⊕pre[l-1] Bitwise Queries (Easy V 阅读全文
posted @ 2020-12-09 23:07 DeaL57 阅读(108) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #include <sstream> #includ 阅读全文
posted @ 2020-11-06 18:57 DeaL57 阅读(120) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #include <sstream> #includ 阅读全文
posted @ 2020-09-11 11:11 DeaL57 阅读(145) 评论(0) 推荐(0)
摘要:受益良多:别人的题解 阅读全文
posted @ 2020-09-04 12:48 DeaL57 阅读(99) 评论(0) 推荐(0)
摘要:CF1204C Anna, Svyatoslav and Maps #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #includ 阅读全文
posted @ 2020-08-28 17:53 DeaL57 阅读(169) 评论(0) 推荐(0)
摘要:Tree Painting #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #include <ss 阅读全文
posted @ 2020-08-14 10:53 DeaL57 阅读(117) 评论(0) 推荐(0)
摘要:题目 通过题目条件,可以发现:一旦通过(n,k)->(nk,k)的操作来推出新的元组, n必定是k的倍数;而如果没有, 那么肯定是(xk+1,k)的形式。所以,推出第一条结论:只有在满足n=1,n是k的倍数,或者n-1是k的倍数时,(n,k)是传奇元组。 因此,我们可以认为(n,k)是传奇元组,当且 阅读全文
posted @ 2020-08-01 23:30 DeaL57 阅读(164) 评论(0) 推荐(0)
摘要:C. Uncle Bogdan and Country Happiness #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #in 阅读全文
posted @ 2020-07-31 22:22 DeaL57 阅读(293) 评论(0) 推荐(0)
摘要:B. Array Walk #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #include <ss 阅读全文
posted @ 2020-07-31 10:28 DeaL57 阅读(199) 评论(0) 推荐(0)
摘要:A2. Prefix Flip (Hard Version) #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include < 阅读全文
posted @ 2020-07-27 23:52 DeaL57 阅读(195) 评论(0) 推荐(0)
摘要:k-Tree 对dp数情况的问题还是不太懂 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #inc 阅读全文
posted @ 2020-07-27 00:22 DeaL57 阅读(99) 评论(0) 推荐(0)
摘要:1196D2 - RGB Substring (hard version) #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #in 阅读全文
posted @ 2020-07-24 10:50 DeaL57 阅读(126) 评论(0) 推荐(0)
摘要:1202B - You Are Given a Decimal String... 这个复杂度看着都觉得有点悬(O(100*N)),居然才用500ms #include <iostream> #include <vector> #include <algorithm> #include <strin 阅读全文
posted @ 2020-07-11 13:50 DeaL57 阅读(159) 评论(0) 推荐(0)
摘要:1204C - Anna, Svyatoslav and Maps 看别人题解才知道题目是怎么回事。。。 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #incl 阅读全文
posted @ 2020-07-10 23:44 DeaL57 阅读(153) 评论(0) 推荐(0)
摘要:1244D - Paint the Tree #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #in 阅读全文
posted @ 2020-07-10 00:49 DeaL57 阅读(142) 评论(0) 推荐(0)
摘要:1221D - Make The Fence Great Again 写不出状态转移方程有点难受 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include 阅读全文
posted @ 2020-07-09 00:26 DeaL57 阅读(135) 评论(0) 推荐(0)

1 2 3 4 5 ··· 8 下一页