摘要: 传送门 You are given $n$ numbers $a_1, a_2, \dots, a_n$. You can perform at most $k$ operations. For each operation, you can multiply one of the numbers 阅读全文
posted @ 2015-09-19 08:27 Pat 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 传送门WORDS1 - Play on Words#graph-theory#euler-circuitSome of the secret doors contain avery interesting word puzzle. The team of archaeologists has to ... 阅读全文
posted @ 2015-09-18 20:48 Pat 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 传送门 确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17915 Accepted Submission(s): 7169 Pro 阅读全文
posted @ 2015-09-17 15:09 Pat 阅读(790) 评论(0) 推荐(0) 编辑
摘要: 问题 求 $[L, R]$ 之间的素数表。 解法 一个合数 $n$ 的最小素因子不超过 $\sqrt{n}$。因此,在埃氏筛法的过程中,每当“新发现”一个素数 $p$,可以从 $p^2$ 筛起,而不必从 $2p$ 筛起。 先用埃氏筛法求出 $[1,\lfloor \sqrt{R} \rfloor]$ 阅读全文
posted @ 2015-09-13 17:17 Pat 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 传送门Ice Cream ParlorAuthored bydheerajonMar 21 2013Problem StatementSunny and Johnny together haveMdollars they want to spend on ice cream. The parlor ... 阅读全文
posted @ 2015-08-20 23:14 Pat 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 传送门 Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem Statement Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem 阅读全文
posted @ 2015-08-20 21:33 Pat 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 传送门今天在HackerRank上翻到一道高精度题,于是乎就写了个高精度的模板,说是模板其实就只有乘法而已。Extra long factorialsAuthored byvatsalchananaonJun 16 2015Problem StatementYou are given an inte... 阅读全文
posted @ 2015-08-20 14:50 Pat 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 最长上升公共子序列(Longest Increasing Common Subsequence,LICS)也是经典DP问题,是LCS与LIS的混合。Problem求数列 a[1..n], b[1..m]的LICS的长度, a[], b[]数组的元素均为正整数。Solution考虑如何定义DP状态,定... 阅读全文
posted @ 2015-08-19 23:17 Pat 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 传送门 一开始在vjudge上看到这题时,标的来源是CSU 1120,第八届湖南省赛D题“平方根大搜索”。今天交题时CSU突然跪了,后来查了一下看哪家OJ还挂了这道题,竟然发现这题是出自UVA的,而且用的原题。 Description time limit 5s In binary, the squ 阅读全文
posted @ 2015-08-19 21:45 Pat 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 指针(pointer)有两种涵义 一是指C/C++中的一种数据类型(data type)。 二是指某个类型为指针的 数据/物件(object)。 指针作为一种数据类型,属所谓复合类型(compound types)。 若非特别指明,下文中所言的指针皆为第二种涵义。 A compound type i 阅读全文
posted @ 2015-08-17 13:50 Pat 阅读(235) 评论(0) 推荐(0) 编辑