码迷,mamicode.com
首页 >  
搜索关键字:ikkis problem    ( 37569个结果
uva 10104 Euclid Problem (数论-扩展欧几里德)
uva 10104 Euclid Problem (数论-扩展欧几里德) 题目大意: 已知 A 和 B , 问你 A*X+B*Y=GCD(A,B)的 X,Y解。 解题思路: 非常裸的拓展欧几里德算法。 拓展欧几里德算法证明过程: 因为 B*X1+A%B*Y1=GCD(B,A%B) =GCD(A,B)=A*X+B*Y 所以 B*X1+(A-A/B*B)*Y1=A*X+B*Y A*Y1+B*(X1-A/B*Y1)=A*X+B*Y 于是: X=Y1,Y=(X1-A/B*Y1) 因此,得出( A*...
分类:其他好文   时间:2014-05-26 05:53:55    阅读次数:297
LeetCode: N-Queens II [051]
【题目】 Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 【题意】 解N皇后问题,N-Queens要求返回所有的解,而本题只需要返回可行解的数目 【思路】 DFS,参考N-Queens...
分类:其他好文   时间:2014-05-25 01:51:55    阅读次数:236
poj 2449 Remmarguts' Date(K短路,A*算法)
http://poj.org/problem?id=2449 大致题意:给出一个有向图,求从起点到终点的第K短路。 K短路A*算法讲解: #include #include #include #include #include #include #include #include #include #include #define LL long...
分类:其他好文   时间:2014-05-24 23:39:47    阅读次数:352
UVA Problem D: Hartals
题目如下: Problem D: Hartals  A social research organization has determined a simple set of parameters to simulate the behavior of the political parties of our country. One of the ...
分类:其他好文   时间:2014-05-24 23:10:01    阅读次数:317
Square Coins (HDU 1398) ———母函数模板详解
Square Coins Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7748    Accepted Submission(s): 5238 Problem Description People in Silverl...
分类:其他好文   时间:2014-05-24 21:06:18    阅读次数:220
poj 3031 Big Christmas Tree(水spfa)
http://poj.org/problem?id=3013 题意: Because of a technical difficulty, price of an edge will be (sum of weights of all descendant nodes) × (unit price of the edge).这句话一直没看懂。后面还以为是最小生成树。 正确...
分类:其他好文   时间:2014-05-24 20:27:13    阅读次数:266
LeetCode: N-Queens [050]
【题目】 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuratio...
分类:其他好文   时间:2014-05-24 17:12:32    阅读次数:237
URAL1826. Minefield 题解
原题:http://acm.timus.ru/problem.aspx?space=1&num=18261826. MinefieldTime limit: 0.5 secondMemory limit: 64 MBTo fulfill an assignment, a reconnaissance...
分类:其他好文   时间:2014-05-24 12:57:02    阅读次数:282
(准备写)URAL1824 Ifrit Bomber 题解
http://acm.timus.ru/problem.aspx?space=1&num=18241824. Ifrit BomberTime limit: 0.5 second Memory limit: 64 MBIn the six years that passed since the fi...
分类:其他好文   时间:2014-05-24 11:46:13    阅读次数:298
ZOJ Problem Set - 1005
注意,条件:B>=C 。应考虑B=C的情况。#includeusing namespace std;int A,B,C;void jugs(int a,int b,int C){ if(b==C) { cout=B) { a=A-(B-b...
分类:其他好文   时间:2014-05-24 09:34:19    阅读次数:288
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!