08 2019 档案

摘要:原题链接:http://codeforces.com/problemset/problem/913/C Input 4 12 20 30 70 90 Output 150 Input 4 3 10000 1000 100 10 Output 10 Input 4 3 10 100 1000 1000 阅读全文
posted @ 2019-08-19 15:16 voids5 阅读(134) 评论(0) 推荐(0)
摘要:Sample Input abcd aaaa ababab . Sample Output 1 4 3 解题思路:需要用到周期串这个东西,周期 period=l - nxt[l-1], 其余的就是kmp了,大佬教的kmp和网上大多不一样,可以对比看看。 Code: #include<iostream 阅读全文
posted @ 2019-08-16 21:02 voids5 阅读(76) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=1091 题目大意:给你两个数n和m;总共有m^n张卡片,每张卡片上有n+1个数字,然后根据卡片上的数字可以向左跳也可以向右跳,每个数字跳的次数任意,直到跳达刚开始左边一个单位的地方 解题思路:把卡片上的数字用x1,x2,x3…xn,m表 阅读全文
posted @ 2019-08-16 17:38 voids5 阅读(79) 评论(0) 推荐(0)
摘要:原题传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1796 Sample Input 12 2 2 3 Sample Output 7 题目大意:给你两个整数n和m,m是一个整数集合的个数,我们所需要求的是1->n-1中有多少数可以被该整数集合某个元素整 阅读全文
posted @ 2019-08-15 21:11 voids5 阅读(71) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6608 题目大意:给你一个质数p;让你找到比p小的最大质数q,然后求出q的阶乘模p的结果。 解题思路:首先我们需要知道威尔逊定理: 对于一个质数p,p-1的阶乘模除以p等于p-1; (p-1)! %p=( 阅读全文
posted @ 2019-08-15 20:48 voids5 阅读(91) 评论(0) 推荐(0)
摘要:题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2669 题目大意:找出一组x,y使ax+by=1,如果找不出则输出“sorry”。 解题思路:有两个点需要注意,一个点:由定理可得,如果a,b不互质即__gcd(a,b)大于1就不满足上式,这时我们就需要输 阅读全文
posted @ 2019-08-14 14:39 voids5 阅读(77) 评论(0) 推荐(0)
摘要:Sample Input210 212 2S... 阅读全文
posted @ 2019-08-12 17:15 voids5 阅读(100) 评论(0) 推荐(0)
摘要:题目链接:http://poj.org/st... 阅读全文
posted @ 2019-08-08 21:18 voids5 阅读(86) 评论(0) 推荐(0)
摘要:原文链接:http://acm.hdu.ed... 阅读全文
posted @ 2019-08-07 21:08 voids5 阅读(92) 评论(0) 推荐(0)
摘要:链接:http://acm.hdu.edu.... 阅读全文
posted @ 2019-08-07 15:30 voids5 阅读(73) 评论(0) 推荐(0)
摘要:原文链接:http://www.cnblog... 阅读全文
posted @ 2019-08-07 15:04 voids5 阅读(91) 评论(0) 推荐(0)
摘要:B. 蚂蚁觅食(二)单点时限: 1.0 se... 阅读全文
posted @ 2019-08-06 18:48 voids5 阅读(224) 评论(0) 推荐(0)
摘要:In the age of televisi... 阅读全文
posted @ 2019-08-06 18:01 voids5 阅读(125) 评论(0) 推荐(0)
摘要:Farmer John and Betsy ... 阅读全文
posted @ 2019-08-05 20:30 voids5 阅读(101) 评论(0) 推荐(0)
摘要:某省调查乡村交通状况,得到的统计表中列出了任... 阅读全文
posted @ 2019-08-05 13:55 voids5 阅读(101) 评论(0) 推荐(0)
摘要:蚂蚁上树(Sauteed Vermicell... 阅读全文
posted @ 2019-08-05 10:06 voids5 阅读(170) 评论(0) 推荐(0)
摘要:题目描述给出1-n的两个排列P1和P2,求它... 阅读全文
posted @ 2019-08-02 10:45 voids5 阅读(98) 评论(0) 推荐(0)
摘要:Farmer John likes to p... 阅读全文
posted @ 2019-08-01 17:34 voids5 阅读(126) 评论(0) 推荐(0)
摘要:Lele now is thinking a... 阅读全文
posted @ 2019-08-01 17:14 voids5 阅读(91) 评论(0) 推荐(0)