随笔分类 -  ACM

摘要:问题陈述: HDOJ Problem - 1098问题解析: 数学归纳法 f(1) = 18 + ka; 假设f(x) =5*x^13+13*x^5+k*a*x 能被65整除 f(x+1) = 5*(x+1)^13+13*(x+1)^5+k*a*(x+1) 根据二项式定理展开 (a+b)... 阅读全文
posted @ 2015-03-18 18:25 HelloMichaelWong 阅读(942) 评论(0) 推荐(0)
摘要:问题陈述: HDOJ Problem - 1023问题解析: 卡特兰数(Catalan)的应用 基本性质: f(n) = f(1)f(n-1) + f(2)f(n-2) + ... + f(n-2)f(2) + f(n-1)f(1); f(n) = C(2n, n) / (n+1) = C... 阅读全文
posted @ 2015-03-18 11:30 HelloMichaelWong 阅读(466) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1022问题解析: 栈(stack)的简单应用代码详解: 1 #include 2 #include 3 #include 4 #include 5 6 ... 阅读全文
posted @ 2015-03-05 14:00 HelloMichaelWong 阅读(550) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1015问题解析: 深度优先搜索(Depth_First Search)代码详解: 1 #include 2 #include 3 #include 4 #i... 阅读全文
posted @ 2015-03-05 10:30 HelloMichaelWong 阅读(309) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1018问题解析: 公式一: n! = 10^m => lg(10^m) = lg(n!) => m = lg(n) + lg(n-1) + lg(n-2) +... 阅读全文
posted @ 2015-02-12 01:34 HelloMichaelWong 阅读(297) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1012问题解析: 简单题,注意输出格式。引入头文件,调用setprecision()函数设置精度。代码详解: 1 #include 2 #include 3 #... 阅读全文
posted @ 2015-02-12 00:10 HelloMichaelWong 阅读(625) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1008问题分析: 简单题。代码详解: 1 #include 2 #include 3 4 using namespace std; 5 6 int main... 阅读全文
posted @ 2015-02-11 23:30 HelloMichaelWong 阅读(343) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1005问题解析: 最初看到这个题目,第一感觉直接套公式递归求解,结果报Runtime Error STACK_OVERFLOW。递归层太多,导致栈溢出。再次分析发现,... 阅读全文
posted @ 2015-02-10 21:26 HelloMichaelWong 阅读(613) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1004问题解析: 输出每组数据中出现次数最多的颜色。代码详解: 1 #include 2 #include 3 #include 4 5 using na... 阅读全文
posted @ 2015-02-08 23:24 HelloMichaelWong 阅读(655) 评论(0) 推荐(0)
摘要:问题陈述: 杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1002代码详解(Java): import java.io.BufferedInputStream;import java.math.BigInteger;impo... 阅读全文
posted @ 2015-02-08 21:41 HelloMichaelWong 阅读(963) 评论(0) 推荐(0)
摘要:DescriptionNoldbach problemtime limit per test: 2 secondsmemory limit per test: 64 megabytesinput: standard inputoutput: standard outputNick is intere... 阅读全文
posted @ 2014-11-30 15:55 HelloMichaelWong 阅读(462) 评论(0) 推荐(0)
摘要:DescriptionAlmost Primetime limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputA number is calle... 阅读全文
posted @ 2014-11-30 15:26 HelloMichaelWong 阅读(594) 评论(0) 推荐(0)
摘要:DescriptionLucky Sumtime limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputPetya loves lucky nu... 阅读全文
posted @ 2014-11-23 18:31 HelloMichaelWong 阅读(401) 评论(0) 推荐(0)
摘要:DescriptionThe number of positionstime limit per test: 0.5 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputPetr ... 阅读全文
posted @ 2014-11-23 14:34 HelloMichaelWong 阅读(915) 评论(0) 推荐(0)
摘要:DescriptionMeasuring Lengths in Badentime limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputLen... 阅读全文
posted @ 2014-11-23 14:11 HelloMichaelWong 阅读(473) 评论(0) 推荐(0)