一二三四五 上山打老虎

上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: 链接:http://118.190.20.162/view.page?gpid=T2 注意:组合数利用杨辉三角形递推O(n)求解后是s[n][m],n是大的值,n为1e5用逆元预处理求解,时间复杂度O(nlogn) 代码: #include<bits/stdc++.h> using namespac 阅读全文
posted @ 2021-04-05 22:05 黒川川 阅读(51) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/problem/25084 思路:单调栈的裸变式题目,单调递减的单调栈就是计算其右侧能看到的矩形。 代码: #include<bits/stdc++.h> using namespace std; int main (){ int n; 阅读全文
posted @ 2021-04-05 15:00 黒川川 阅读(45) 评论(0) 推荐(0)
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/15815 题意:让求某个长度为n的数字序列中,所有连续子序列的最大值-最小值之和:\(\sum_{len=1}^{len=n}{Maxnum-Minnum}\) 思路:相当于计算a[i]*作为最大值出现的次数-a[i 阅读全文
posted @ 2021-04-05 14:11 黒川川 阅读(59) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T3 思路: 1: 暴力枚举: O(N2) 2: 单调栈 O(N) 代码: #include<bits/stdc++.h> using namespace std; vector<int> ve; int main () 阅读全文
posted @ 2021-04-05 12:53 黒川川 阅读(77) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T51 代码: #include<bits/stdc++.h> using namespace std; int check(int x){ int a=x-3500; int ans=0; ans+=max(0,min 阅读全文
posted @ 2021-04-04 12:01 黒川川 阅读(80) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T52 代码: #include<bits/stdc++.h> using namespace std; map<int,int>mp; int main (){ int n,num; cin>>n; for(int i 阅读全文
posted @ 2021-04-04 11:31 黒川川 阅读(35) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T46 思路:模拟,用20个数组标记这100个座位,分别对连续和不能连续购买座位进行枚举输出。 代码: #include<bits/stdc++.h> using namespace std; int a[25]; in 阅读全文
posted @ 2021-04-04 11:23 黒川川 阅读(54) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T47 代码: #include<bits/stdc++.h> using namespace std; int main (){ int n,num,ans=0; vector<int>ve; cin>>n; for( 阅读全文
posted @ 2021-04-04 10:48 黒川川 阅读(52) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T41 思路:有点坑的大模拟,模拟俄罗斯方块下落的过程,从上到下依次拿小矩形最左边的点去枚举判断,找到当前行可以下落的最低位置后输出 代码: #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2021-04-04 10:43 黒川川 阅读(92) 评论(0) 推荐(0)
摘要: 链接:http://118.190.20.162/view.page?gpid=T42 代码: #include<bits/stdc++.h> using namespace std; vector<int> ve; int main (){ int n,num; cin>>n; for(int i 阅读全文
posted @ 2021-04-03 11:11 黒川川 阅读(54) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页