上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 54 下一页
  2023年4月28日
摘要: 给定一个序列,轮到谁,取出一个数k删除,并删除i*k(i=1,2,3,.....), 设k1为已经删除的数,同时删除k1*i+k*j,(i=1,2,3,.....;j同上 ),轮到谁没数删除时谁就输了。。 求先手取数 可以取那些数字 ,能保证获胜 #include<iostream> #includ 阅读全文
posted @ 2023-04-28 16:51 towboat 阅读(7) 评论(0) 推荐(0)
摘要: 有四个踩踏板,不同的踩踏方式消耗不同的力气 问最小花费的力气 F[ i ] [ a] [b ][ s] , s 是上一次哪只角移动了( 0 ,1,2 ) https://www.luogu.com.cn/problem/UVA10618 #include<iostream> #include <cs 阅读全文
posted @ 2023-04-28 03:07 towboat 阅读(23) 评论(0) 推荐(0)
  2023年4月27日
摘要: 定义一个三元组(a,b,c)(a⩽b⩽c), 它的权值为 (a−b)^2, 给定 n(n⩽5000)n(n⩽5000) 个数,要求选出 k+8 个三元组,使得这k+8个三元组权值和最小。 输入数据是单调递增的。 #include <iostream> #include <algorithm> #in 阅读全文
posted @ 2023-04-27 02:23 towboat 阅读(18) 评论(0) 推荐(0)
摘要: 有n个苹果,和一个数k,第i个苹果的重量是k+i(1<=i<=n). 已知其中只有一个苹果是甜的,所有比它重量轻的都是苦的,比它重的都是酸的。为了要找出甜的苹果,就要去一个一个地吃它,且吃了咬了苹果就必须把它吃完,不管苹果是苦的还是酸的。例如,先吃#1, 如果#1是甜的,花费1如果#2是甜的,那么选 阅读全文
posted @ 2023-04-27 01:45 towboat 阅读(14) 评论(0) 推荐(0)
  2023年4月26日
摘要: 给定两种购买物品的方案:花费 c1元购买 n1 个物品,或者花费 c2c2​ 元购买 n2n2​ 个物品。 方案可以无限使用,询问购买 n个物品至少要多少元,若无法恰好购买到 n 个物品输出 failed #include <iostream> #include <algorithm> #inclu 阅读全文
posted @ 2023-04-26 21:35 towboat 阅读(32) 评论(0) 推荐(0)
摘要: #include <iostream> #include <algorithm> #include <cstring> #include <cmath> using namespace std; #define int long long int n,a[20],M[20],Mi[20]; int 阅读全文
posted @ 2023-04-26 18:33 towboat 阅读(7) 评论(0) 推荐(0)
摘要: 题意:给定一些个d维的方块,给定两点,求穿过多少方块 转化为(0,0) 到 (a,b) 先考虑二维的 然后容斥原理 #include <iostream> #include <algorithm> #include <cstring> #include <cmath> using namespace 阅读全文
posted @ 2023-04-26 15:16 towboat 阅读(14) 评论(0) 推荐(0)
  2023年4月25日
摘要: 题意: 给两个串A,B。现在把B串分为若干个部分,对每一个部分进行操作将其变为一个A串,代价为每部分操作次数的最大值 求最小代价 #include <iostream> #include <algorithm> #include <cstring> using namespace std; cons 阅读全文
posted @ 2023-04-25 19:52 towboat 阅读(22) 评论(0) 推荐(0)
摘要: 题目大意:给出n,一个无根的树,每条边上都有权值。 现在每个位置都有一个景点,一个人想在一年之内去cnt[ i ] 次景点,所以接下来给出m,表示说在m个位置上有这个人想去的地方,给出位置以及想去的次数(注意,每去一个景点都要返回自己的住处),namo这个人该住在哪里走的路程才最短。 换根dp #i 阅读全文
posted @ 2023-04-25 13:05 towboat 阅读(19) 评论(0) 推荐(0)
  2023年4月24日
摘要: 政府在某山区修建了一条道路,恰好穿越总共m个村庄的每个村庄一次,没有回路或交叉,任意两个村庄只能通过这条路来往。已知任意两个相邻的村庄之间的距离为di(为正整数),其中,0<i<m。为了提高山区的文化素质,政府又决定从m个村中选择n个村建小学(设0<n≤m<500)。请根据给定的m、n以及所有相邻村 阅读全文
posted @ 2023-04-24 22:11 towboat 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 54 下一页