上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 43 下一页
摘要: 费马测试(Fermat test) Some of the cryptographic algorithms make use of big prime numbers. However, checking if a big number is prime is not so easy. Howev 阅读全文
posted @ 2016-11-24 12:58 Pat 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 传送门: Palindrome Index Problem Statement Problem Statement You are given a string of lower case letters. Your task is to figure out the index of the ch 阅读全文
posted @ 2016-11-22 12:58 Pat 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 游程编码(Run Length Coding, RLC)是串处理中常见的预处理方法。其写法是典型的双指针(Two-Pointer)。下面总结其写法1.输入为一串整数可以不把整数存在数组里 阅读全文
posted @ 2016-11-22 12:48 Pat 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Problem 求 $[1 \dots N]$中素因子数最多且最小的数 $n$,$N$ 充分大。 Solution 将任意自然数 $n$ ($n>2$) 分解 $$ n = p_1^{k_1 } p_2^{k_2} p_3^{k_3} \dots P_m^{k_m} \quad (p_1<p_2< 阅读全文
posted @ 2016-11-22 12:02 Pat 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 传送门 Problem Statement Problem Statement You are given a tree where each node is labeled from 1 to n. How many similar pairs(S) are there in this tree? 阅读全文
posted @ 2016-11-22 11:59 Pat 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Problem: 给定无序序列S:[b, e),求S中第K大的元素。 Solution 1.裸排序 2.现将区间均分成两段,S1, S2,对S1,S2分别排序,然后 阅读全文
posted @ 2016-11-22 11:57 Pat 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Knights of the Round Table Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 10911 Accepted: 3587 Description Being a knight is a very attrac 阅读全文
posted @ 2016-11-22 11:50 Pat 阅读(320) 评论(0) 推荐(0) 编辑
摘要: Problems (1) 给一棵带边权的树,求遍历这棵树(每个节点至少经过一次)再回到起点的最短路程。 答案是显然的:边权之和的两倍。 (2)给一棵带边权的树,求遍历这棵树(每个节点至少经过一次)的最短路程。 (3)给一棵带边权的树T(V, E ),求T的含K个节点的连通子图的边权和的最小值。 阅读全文
posted @ 2016-11-22 11:45 Pat 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Finally I fully understand the augmenting-path-based algorithm for maximum bipartite matching. 阅读全文
posted @ 2016-11-22 11:45 Pat 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 传送门 Problem Statement Ms.Kox enjoys her job, but she does not like to waste extra time traveling to and from her office. After working for many years, 阅读全文
posted @ 2016-11-22 11:43 Pat 阅读(573) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 43 下一页