HDU刷题
文章平均质量分 60
QuteMelon
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces - 158B Taxi
B题 Taxi After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they ...原创 2018-11-29 12:57:30 · 514 阅读 · 1 评论 -
HDU 1009 FatMouse' Trade (简单的贪心)
Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contai...原创 2018-12-01 00:13:30 · 204 阅读 · 0 评论 -
HDU——1016 Prime Ring Problem (DFS的简单应用)
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number of fir...原创 2018-12-12 19:43:53 · 201 阅读 · 0 评论 -
HDU - 5391Zball in Tina Town
一道威尔逊定理的题 也就是求 (n-1)! % n 的值 根据威尔逊定理很容易得到 当n为素数时,该算式为 n-1 而当n不为素数时,该算式为0(除了4,4的结果是2要特判) 代码如下: #include <iostream> using namespace std; int main() { int T; cin>>T; int n; wh...原创 2019-03-02 14:05:37 · 418 阅读 · 0 评论 -
数位dp hdu2089 luoguP2657
最近打训练赛遇到数位dp了,然而不会于是就去看了,先入手两道入门题。 /* 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的 数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。...原创 2019-04-14 19:05:15 · 148 阅读 · 0 评论
分享