上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 01背包 有 $N$ 件物品和一个容量是 $V$ 的背包。每件物品只能使用一次。 第 $i$ 件物品的体积是 $v_i$,价值是 $w_i$。 求解将哪些物品装入背包,可使这些物品的总体积不超过背包容量,且总价值最大。 输出最大价值。 输入格式 第一行两个整数,$N,V$,用空格隔开,分别表示物品数 阅读全文
posted @ 2023-02-03 19:13 Keith- 阅读(64) 评论(0) 推荐(0)
摘要: L 小沙の抱团 hard 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> 阅读全文
posted @ 2023-02-01 23:31 Keith- 阅读(21) 评论(0) 推荐(0)
摘要: K 小沙の抱团 easy 原题链接 思路 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<que 阅读全文
posted @ 2023-02-01 22:42 Keith- 阅读(28) 评论(0) 推荐(0)
摘要: H 小沙の店铺 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> usin 阅读全文
posted @ 2023-02-01 22:34 Keith- 阅读(19) 评论(0) 推荐(0)
摘要: B 小沙の博弈 原题链接 题意 字典序贪心 思路 考虑需要使自己的字典序比对方小,那么每次都尽可能的少选,由于每次必须选择一个,那么双方都 会一直选择一个直至石子被取完。 当石子数目为偶数时,双方的取石子的次数相同,得到的字典序也相同,所以平手; 当石子数目为奇数时,先手会比后手多取一次,所以得到的 阅读全文
posted @ 2023-02-01 22:25 Keith- 阅读(19) 评论(0) 推荐(0)
摘要: A 小沙の好客 原题链接‘ 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> usi 阅读全文
posted @ 2023-02-01 22:17 Keith- 阅读(19) 评论(0) 推荐(0)
摘要: B 清楚姐姐学构造 原题链接 题意 给出三个同余式子,分类讨论 思路 $$ \left{ \begin{array}{} a_i \equiv a_{N-1-i}\ (mod\ m) & \ b_i \equiv -b_{N-1-i}\ (mod\ m) &\ c_i \equiv a_i + b_ 阅读全文
posted @ 2023-02-01 21:35 Keith- 阅读(43) 评论(0) 推荐(0)
摘要: G 清楚姐姐逛街(Easy Version) 原题链接 题意 终点会按照固定方式移动的搜索问题,多次查询 思路 只要时间t是确定的,那么终点的位置就是确定的 -> 可以模拟每一时刻 bfs维护智乃到每个点的最短距离 模拟每一时刻清楚姐姐的位置 如果该时刻大于智乃到每个点的最短距离(前提是智乃能够到达 阅读全文
posted @ 2023-02-01 01:27 Keith- 阅读(47) 评论(0) 推荐(0)
摘要: E 清楚姐姐打怪升级 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> u 阅读全文
posted @ 2023-01-31 20:56 Keith- 阅读(38) 评论(0) 推荐(0)
摘要: L 清楚姐姐的三角形I 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> 阅读全文
posted @ 2023-01-31 20:32 Keith- 阅读(30) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页