会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
LegendN
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
下一页
2020年11月6日
CF 559C
摘要: 组合数 + dp思想 先将所有黑点排个序,左上方的优先级最高 则确保对于当前黑点,它所能到达的黑点必定位于排序后序列中的它的后方 然后将(h, w)加入到序列尾端 ++n 对于该序列中的每一个节点( j ),初状态为从(1, 1)抵达该点的方案数,即初始化type[ i ] 但这时会有重复计算。从(
阅读全文
posted @ 2020-11-06 11:52 LegendN
阅读(274)
评论(0)
推荐(0)
2020年11月5日
快读板子
摘要: 1 int read(){ 2 char ch=getchar();int x=0,f=1; 3 while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();} 4 while(ch>='0' && ch<='9'){x=x*10+ch-'0';ch=
阅读全文
posted @ 2020-11-05 19:55 LegendN
阅读(318)
评论(0)
推荐(0)
2020年11月4日
nlogn LIS CF1437E
摘要: 1 vector<int> v; 2 v.clear(); 3 vector<int>::iterator it; 4 for(int j = l + 1 ; j < r ; j++){ 5 if(a[j] >= a[l] && a[j] <= a[r]){ 6 it = upper_bound(v
阅读全文
posted @ 2020-11-04 21:58 LegendN
阅读(76)
评论(0)
推荐(0)
2020年11月2日
CF 1444B
摘要: 对不起我硕哥 思路全对,就是个组合数的事情 减操作取模记得+mod!!! 1 #include<bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 const int maxn = 1e6 + 10; 6 const ll
阅读全文
posted @ 2020-11-02 10:01 LegendN
阅读(189)
评论(0)
推荐(0)
2020年10月29日
unsigned int慎用
摘要: 虽然比赛应该不会特地卡空间? 还是小心点
阅读全文
posted @ 2020-10-29 16:33 LegendN
阅读(122)
评论(0)
推荐(0)
2020年10月18日
CF1425D 容斥 组合数 快速幂求逆元
摘要: 上图来源于标程解析 CF 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<vector> 5 #define ll long long 6 #define fir first 7 #define sec
阅读全文
posted @ 2020-10-18 14:30 LegendN
阅读(122)
评论(0)
推荐(0)
2020年10月17日
CF 1408D探照灯 找 匪
摘要: 1408D - Searchlights Let's define as xx our move to the right and as yy our move to the up. For all pairs (i,j)(i,j) of (robber, searchlight) at least
阅读全文
posted @ 2020-10-17 14:44 LegendN
阅读(89)
评论(0)
推荐(0)
2020年10月16日
各种状态转移
摘要: CF1353E 1 for(int i = 1 ; i <= n ; i++){ 2 dp[i][0] = min(dp[i - 1][1], dp[i - 1][0]) + (s[i] == '1'); 3 if(i >= k) dp[i][1] = dp[i - k][1] + sum[i -
阅读全文
posted @ 2020-10-16 10:40 LegendN
阅读(111)
评论(0)
推荐(0)
2020年10月14日
CF 459C
摘要: 做过一点点构造题,花了一个小时想怎么构造,但并没有什么用,写起来感觉有点复杂。 标程分析: 对于输出结果,共d次分配情况。而对于每个学生而言,每个人有d次选择乘坐车辆的机会。 那么所有同学在k辆车,d轮下的选车情况共有k的d次方种选法。 仔细想一想,如果学生的数量超过了上述选法种数,根据鸽巢原理,必
阅读全文
posted @ 2020-10-14 19:39 LegendN
阅读(118)
评论(0)
推荐(0)
2020年10月12日
主席树 入门
摘要: 思想类似前缀和,访问某状态的线段树可通过末减初状态进行求解。 hdu4417 第二道模板题 有很多细节需要注意。 1.题目给定ai的高度可能为0,但通过离散化事实上不影响结论。 2.给定的访问区间[x,y]以及高度h也可能为零,因而x,y需对应++。查询依旧是root[y] - root[x-1]。
阅读全文
posted @ 2020-10-12 16:53 LegendN
阅读(106)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
下一页
公告