洛谷
洛谷
lvyou666
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
P1983 车站分级
https://www.luogu.com.cn/problem/P1983<=题目戳这 /* 因为等级大于等于所经过的站点的等级的站点都必须出现在途中,所以没经过的站点等 级小于出现在途中的站点的等级,所以可以给这些站点分级 */ #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,m,ans,stop[1005],s,tp[1005][1005],原创 2020-08-09 18:22:26 · 211 阅读 · 0 评论 -
P1982 小朋友的数字
https://www.luogu.com.cn/problem/P1982<=题目戳这 #include<iostream> #include<iomanip> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; long long n,p,s[10000005],tz[10000005],fs[10000005],k[10000005],m原创 2020-08-09 18:07:26 · 173 阅读 · 0 评论 -
P1981 表达式求值
https://www.luogu.com.cn/problem/P1981 <=题目戳这 #include<iostream> #include<cstdio> using namespace std; int sum,ji,a;//ji:进行到上一步的积 char c;//c:符号 int main() { scanf("%d",&ji); ji%=10000; while(cin>>c)//在本机上无法运行,在洛谷上是对的 {原创 2020-08-09 18:01:28 · 221 阅读 · 0 评论 -
P1980 计数问题
https://www.luogu.com.cn/problem/P1980 <=题目戳这 #include<iostream> #include<cstdio> using namespace std; int main() { int n,m,x; scanf("%d%d",&n,&m); for(int i=1;i<=n;i++)//循环 { int k=i; while(k) { if(k%10==m) x++;//原创 2020-08-09 17:55:35 · 177 阅读 · 0 评论 -
P2258 子矩阵 NOIP普及组 2014
题目戳这——> https://www.luogu.com.cn/problem/P2258 代码 #include<iostream> #include<iomanip> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,m,r,c; int num[20][20]={0};//每个数 int ch[20]={0};//取的r原创 2020-06-21 11:59:15 · 352 阅读 · 0 评论 -
2015 NOIP详解
第一题 金币 题目戳这—> https://www.luogu.com.cn/problem/P2669 思路:简单的模拟 #include<iostream> #include<algorithm> #include<cstdio> #include<vector> #include<cmath> using namespace std; int main() { int n,t=0,sum=0;//t:天数 scanf("%d",&a原创 2020-06-14 17:02:59 · 642 阅读 · 0 评论 -
2016NOIP普及组解析
第一题 买铅笔 easy,不多说 #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> using namespace std; int main() { int n,a1,b1,a2,b2,a3,b3; scanf("%d%d%d%d%d%d%d",&n,&a1,&b1,&a2,&b2,&a3,&b3); i原创 2020-06-07 17:34:05 · 458 阅读 · 0 评论 -
P3957 跳房子
题目戳这——> https://www.luogu.com.cn/problem/P3957 如果g个金币分数大于k,则g+1个金币分数大于k 同理,如果g个金币分数小于k,则g-1个金币分数小于k 所以可以二分g。 明显此题可以用动态规划 dp[i]=max{dp[j]+z[i]}(min<=x[i]-x[j]<=max) min=max(d-g,1),max=d+g. 由于每次都需求(min,max)中的最大值。 所以可以单调队列优化 代码如下 #include<cstring原创 2020-05-10 18:52:35 · 160 阅读 · 0 评论 -
P5017 摆渡车
题目如→: https://www.luogu.com.cn/problem/P5017 ps:dp[i,j]表示当第i个人等j分钟时前i个人等的最小总等待时间 #include<iostream> #include<cstdio> #include<queue> #include<cstring> #include<algorithm>...原创 2020-05-05 17:24:43 · 277 阅读 · 0 评论 -
P5662 纪念品
P5662 纪念品 题目描述 小伟突然获得一种超能力,他知道未来 T 天 N 种纪念品每天的价格。某个纪念品的价格是指购买一个该纪念品所需的金币数量,以及卖出一个该纪念品换回的金币数量。 每天,小伟可以进行以下两种交易无限次: 1.任选一个纪念品,若手上有足够金币,以当日价格购买该纪念品; 2.卖出持有的任意一个纪念品,以当日价格换回金币。 每天卖出纪念品换回的金币可以立即用于购买纪念品,当日购买...原创 2020-05-04 16:14:35 · 453 阅读 · 0 评论 -
CCF1166 1166. 回家 (Standard IO)
时间限制: 1000 ms 空间限制: 262144 KB 具体限制 题目描述 Alice住在森林里,森林可以看作是N*M的网格,森林里有怪兽,用‘.’表示空地,‘+’表示怪兽,‘V’表示Alice现在的位置,‘J’表示Alice的家。 Alice可以从当前单元格向上下左右相邻单元格移动,有怪兽的地方也可以走,只不过比较危险,有怪兽的单元格对其他单元格会产生一定的危险系数,假设怪兽位置为(A,...原创 2020-04-12 15:51:46 · 288 阅读 · 0 评论
分享