码迷,mamicode.com
首页 >  
搜索关键字:uva 10617 again pali    ( 9112个结果
UVA 10004 Bicoloring
题目如下: Bicoloring  In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in...
分类:其他好文   时间:2014-07-06 12:28:07    阅读次数:241
UVA 10129 Play on Words
题目如下: Play on Words Some of the secret doorscontain a very interesting word puzzle. The team of archaeologists has tosolve it to open that doors. Because there is no other way to open the doors,...
分类:其他好文   时间:2014-07-06 12:12:36    阅读次数:221
UVA 10047 - The Monocycle
题目如下:  Problem A: The Monocycle  A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with fiv...
分类:其他好文   时间:2014-07-06 11:49:47    阅读次数:233
UVA 1434 - YAPTCHA(数论)
UVA 1434 - YAPTCHA 题目链接 题意:求出题目中那个公式的答案 思路: 当3?k+7非素数的时候,那么(3?k+6)!(因为必然能找到两个因子相乘) 所以原式为0 当3?k+7为素数的时候,根据威尔逊定理,((3?k+6)!+1)%(3?k+7)==0,因此原式可以转化为[x - (x - 1)] = 1 因此问题转化为只要判断3 * k + ...
分类:其他好文   时间:2014-07-06 11:42:44    阅读次数:162
UVA 10831 - Gerg's Cake(数论)
UVA 10831 - Gerg's Cake 题目链接 题意:说白了就是给定a, p,问有没有存在x^2 % p = a的解 思路:求出勒让德标记,判断如果大于等于0,就是有解,小于0无解 代码: #include #include long long a, p; long long pow_mod(long long x, long long k, lon...
分类:其他好文   时间:2014-07-06 11:38:05    阅读次数:144
UVa 10679 - I Love Strings!!
题目:给你一个目标串,和一些模式串,问每个模式串是否在目标串中出现。 分析:字符串,AC自动机。一开始用KMP算法,TLE了才发现会超时,改用AC自动机;             直接利用AC自动机存储,查询即可,然后按顺序输出;             如果模式串中有重复的,直接利用并查集合并即可,朱旭判断父节点。 说明:╮(╯▽╰)╭计算复杂度时,数据组数被忽略了;注意初始化。 #i...
分类:其他好文   时间:2014-07-06 10:46:17    阅读次数:224
UVA 10555 - Dead Fraction(数论+无限循环小数)
UVA 10555 - Dead Fraction 题目链接 题意:给定一个循环小数,不确定循环节,求出该小数用分数表示,并且分母最小的情况 思路:推个小公式 一个小数0.aaaaabbb... 表示为n/m形式,并且a为整数部分有c位, b为小数部分有d位 那么aaaaa.bbb...和aaaaabbb....分别可以表示为10c?(n/m)和10c+d?(n/m) 两式...
分类:其他好文   时间:2014-07-06 08:29:07    阅读次数:351
uva 1426 - Discrete Square Roots(拓展欧几里得)
题目链接:uva 1426 - Discrete Square Roots 题目大意:给出X,N,R,求出所有满足的r,使得r2≡x%N,并且R是一个其中的解。 解题思路: R2?r2=k?N(R?r)(R+r)=k?N=> aA=(R+r),bB=(R?r),A,B为N的因子 所以枚举A,B,就有r=R?aA=bB?RaA+bB=2?R 拓展欧几里得求解,将所有满足的解放入...
分类:其他好文   时间:2014-07-06 00:11:14    阅读次数:268
uva 10162 - Last Digit(数论)
题目链接:uva 10162 - Last Digit 题目大意:给定n,求s的个位的数值是多少。 解题思路:对于ii,重复周期为20,这样就有 1 4 7 6 5 6 3 6 9 01 6 3 6 5 6 7 4 9 0 但是这个周期的值是不为0的,总的话是100为一个大周期。 #include #include #include using namespace s...
分类:其他好文   时间:2014-07-06 00:09:23    阅读次数:239
UVA 1341 - Different Digits(数论)
UVA 1341 - Different Digits 题目链接 题意:给定一个正整数n,求一个kn使得kn上用的数字最少,如果相同,则输出值最小的 思路: 首先利用鸽笼原理证明最多需要2个数字去组成 设一个数字k,组成k,kk,kkk,kkkk... %n之后余数必然在0 - (n - 1)之间,所以必然能选出两个余数相等的数字相减为0,这个数字就是由0和k组成的。 ...
分类:其他好文   时间:2014-07-05 22:56:18    阅读次数:289
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!