- 博客(29)
- 收藏
- 关注
原创 洛谷P1031 [NOIP2002 提高组] 均分纸牌
有 N 堆纸牌,编号分别为 1,2,…,N。每堆上有若干张,但纸牌总数必为 N 的倍数。可以在任一堆上取若干张纸牌,然后移动。移牌规则为:在编号为 1 堆上取的纸牌,只能移到编号为 2 的堆上;在编号为 N 的堆上取的纸牌,只能移到编号为 N−1 的堆上;其他堆上取的纸牌,可以移到相邻左边或右边的堆上。现在要求找出一种移动方法,用最少的移动次数使每堆上纸牌数都一样多。例如 N=4 时,4 堆纸牌数分别为 9,8,17,6。
2024-05-04 11:35:36
461
原创 洛谷P1109 学生分组
cin>>n;i<=n;cin>>l>>r;i<=n;cout<<"-1";return 0;i<=n;t=N7T8题目链接https://www.luogu.com.cn/problem/P1109。
2024-04-13 18:58:07
520
1
原创 洛谷P1996 约瑟夫问题
int v[200];i<=n;i++){i<m;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P1996。
2024-04-13 13:37:58
449
原创 洛谷B3626 跳跃机器人
include<bits/stdc++.h>//万能头文件//定义队列void bfs()q.push(1);vis[1]=0;while(!q.empty()){//队列不为空就一直执行q.pop();if(t==n){//因为BFS是按层遍历所有第一次搜出的就是最短路return;if(t-1>=1&&t-1<=n&&vis[t-1]==-1){//搜过的地方不重复搜if(t+1>=1&&t+1<=n&&vis[t+1]==-1){//注意边界return。
2024-03-23 20:24:48
1319
原创 洛谷P1097 [NOIP2007 提高组] 统计数字
i<=n;a[i]=m;i<=n;return 0;给个赞吧Orzt=N7T8题目链接https://www.luogu.com.cn/problem/P1097。
2024-03-16 20:55:58
502
原创 洛谷P8869 [传智杯 #5 初赛] A-莲子的软件工程学
return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P8869。
2024-02-24 20:18:59
532
原创 洛谷P8627 [蓝桥杯 2015 省 A] 饮料换购
cin>>n;ans=n;1>=0;i++){n-=2;ans++;cout<<ans;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P8627?
2024-02-24 19:47:20
405
原创 洛谷AT_abc034_a[ABC034A] テスト
cin>>a>>b;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/AT_abc034_a。
2024-02-16 12:24:42
398
1
原创 洛谷B2003 输出第二个整数
int a,b,c;cout<<b;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/B2003。
2024-02-16 12:18:26
369
1
原创 洛谷B2144 阿克曼(Ackmann)函数
cin>>n>>m;return 0;Ackmannt=N7T8题目链接https://www.luogu.com.cn/problem/B2144?
2024-02-15 16:23:00
494
1
原创 洛谷P5736 【深基7.例2】质数筛
int a[105];i*i<=n;cin>>n;i<=n;return 0;t=N7T8i*i%3C%3Dn题目链接https://www.luogu.com.cn/problem/P5736。
2024-02-15 15:41:31
547
1
原创 洛谷P5740 【深基7.例9】最厉害的学生
cin>>n;i<=n;i++){st=s;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P5740。
2024-02-15 10:54:07
611
1
原创 洛谷P5742 【深基7.例11】评等级
cin>>n;i<=n;i++){i<=n;t=N7T8题目链接https://www.luogu.com.cn/problem/P5742。
2024-02-15 10:37:03
704
1
原创 洛谷P5726 【深基4.习9】打分
i<=n;b+=a[i];b-=maxx;b-=minn;b/=(n-2);return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P5726。
2024-02-08 11:58:20
392
原创 洛谷P2089 烤鸡
for (a=1;a<=3;b<=3;c<=3;d<=3;e<=3;f<=3;g<=3;h<=3;i<=3;j<=3;a<=3;b<=3;b++)
2024-02-06 11:13:07
405
1
原创 洛谷P1008 [NOIP1998 普及组] 三连击
t=N7T8题目链接https://www.luogu.com.cn/problem/P1008。
2024-02-06 10:30:04
594
1
原创 洛谷B2009 计算 (a+b)/c 的值
return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/B2009。
2024-02-02 21:17:48
389
原创 洛谷B2008 计算 (a+b)×c 的值
return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/B2008。
2024-01-31 16:02:53
372
原创 洛谷P1000 超级玛丽游戏
t=N7T8t=N7T8t=N7T8t=N7T8新用户必读贴https://www.luogu.com.cn/discuss/show/241461题目链接https://www.luogu.com.cn/problem/P1000。
2024-01-29 13:19:46
367
原创 洛谷P1001 A+B Problem
cout<<a+b;return 0;t=N7T8t=N7T8新用户必读帖https://www.luogu.com.cn/discuss/show/241461题目链接https://www.luogu.com.cn/problem/P1001。
2024-01-29 12:55:47
941
原创 洛谷P1706 全排列问题
int i;for(i=1;i<=g;cout<<endl;int i;return;for(i=1;i<=g;i++)a[i]=1;b[k+1]=i;s(k+1);a[i]=0;s(0);return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P1706?
2024-01-28 13:27:27
363
原创 洛谷P5712 【深基3.例4】Apples
cin>>n;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P5712。
2024-01-27 17:48:06
366
原创 洛谷P5711 【深基3.例3】闰年判断
cin>>n;return 0;t=N7T8题目链接https://www.luogu.com.cn/problem/P5711。
2024-01-27 17:26:27
429
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人