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
阅读全文
摘要:Sample Input abcd aaaa ababab . Sample Output 1 4 3 解题思路:需要用到周期串这个东西,周期 period=l - nxt[l-1], 其余的就是kmp了,大佬教的kmp和网上大多不一样,可以对比看看。 Code: #include<iostream
阅读全文
摘要:原题链接:http://poj.org/problem?id=1091 题目大意:给你两个数n和m;总共有m^n张卡片,每张卡片上有n+1个数字,然后根据卡片上的数字可以向左跳也可以向右跳,每个数字跳的次数任意,直到跳达刚开始左边一个单位的地方 解题思路:把卡片上的数字用x1,x2,x3…xn,m表
阅读全文
摘要:原题传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1796 Sample Input 12 2 2 3 Sample Output 7 题目大意:给你两个整数n和m,m是一个整数集合的个数,我们所需要求的是1->n-1中有多少数可以被该整数集合某个元素整
阅读全文
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6608 题目大意:给你一个质数p;让你找到比p小的最大质数q,然后求出q的阶乘模p的结果。 解题思路:首先我们需要知道威尔逊定理: 对于一个质数p,p-1的阶乘模除以p等于p-1; (p-1)! %p=(
阅读全文
摘要:题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2669 题目大意:找出一组x,y使ax+by=1,如果找不出则输出“sorry”。 解题思路:有两个点需要注意,一个点:由定理可得,如果a,b不互质即__gcd(a,b)大于1就不满足上式,这时我们就需要输
阅读全文
摘要:Sample Input210 212 2S...
阅读全文
摘要:题目链接:http://poj.org/st...
阅读全文
摘要:原文链接:http://acm.hdu.ed...
阅读全文
摘要:链接:http://acm.hdu.edu....
阅读全文
摘要:In the age of televisi...
阅读全文
摘要:Farmer John and Betsy ...
阅读全文
摘要:题目描述给出1-n的两个排列P1和P2,求它...
阅读全文
摘要:Farmer John likes to p...
阅读全文
摘要:Lele now is thinking a...
阅读全文

浙公网安备 33010602011771号