随笔分类 -  数学,二分,素数

摘要:Painter's ProblemTime Limit:1000MSMemory Limit:10000KTotal Submissions:3880Accepted:1889DescriptionThere is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks are yellow. Bob is a painter and he wants to paint all the bricks yellow. But there is somet 阅读全文
posted @ 2013-05-22 23:36 Jack Ge 阅读(504) 评论(0) 推荐(0) 编辑
摘要:EXTENDED LIGHTS OUTTime Limit:1000MSMemory Limit:10000KTotal Submissions:5383Accepted:3557DescriptionIn an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons each). Each button has a light. When a button is pressed, that butt 阅读全文
posted @ 2013-05-22 22:52 Jack Ge 阅读(1584) 评论(0) 推荐(0) 编辑
摘要:EquationsTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3853Accepted Submission(s): 1551Problem DescriptionConsider equations having the following form:a*x1^2+b*x2^2+c*x3^2+d*x4^2=0a, b, c, d are integers from the interval [-50,50] and any of them 阅读全文
posted @ 2013-05-22 16:10 Jack Ge 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Stern-Brocot TreeTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 251Accepted Submission(s): 159Problem Description 上图是一棵Stern-Brocot树,其生成规则如下: 从第1行到第n行,每行相邻两数a/b和c/d,产生中间数(a+c)/(b+d),置于下一行中。将一行的分数(包括0/1,1/0),进行约分简化,则每一行(包括0/1,1/0,1/1),不会出现两个相... 阅读全文
posted @ 2013-05-21 09:26 Jack Ge 阅读(1432) 评论(0) 推荐(0) 编辑
摘要:1737 - Play the Dicehttp://icpc.njust.edu.cn/Local/1737时间限制:2000 MS内存限制:65535 MB问题描述There is a dice withN sides, which are numbered from 1,2,...,n and have the equal possibility to show up when one rolls a dice. Each side has an integer Aion it. Now here is a game that you can roll this dice once, i 阅读全文
posted @ 2013-05-19 10:39 Jack Ge 阅读(520) 评论(0) 推荐(0) 编辑
摘要:Trees Made to OrderTime Limit:1000MSMemory Limit:10000KTotal Submissions:6290Accepted:3619DescriptionWe can number binary trees using the following scheme:The empty tree is numbered 0.The single-node tree is numbered 1.All binary trees having m nodes have numbers less than all those having m+1 nodes 阅读全文
posted @ 2013-05-19 09:39 Jack Ge 阅读(1986) 评论(0) 推荐(0) 编辑
摘要:卡特兰数关于扩展的卡特兰数:1.(n-m+1)/(n+1)*c(n+m,n)2.c[n+m][n]-c[n+m][m-1]Catalan,Eugene,Charles,卡特兰(1814~1894)比利时数学家,生于布鲁日(Brugge),早年在巴黎综合工科学校就读。1856年任列日(Liege)大学数学教授,并被选为比利时布鲁塞尔科学院院士。卡特兰一生共发表200多种数学各领域的论著。在微分几何中,他证明了下述所谓的卡特兰定理:当一个直纹曲线是平面和一般的螺旋面时,他只能是实的极小曲面。他还和雅可比(Jacobi,C·G·J)同时解决了多重积分的变量替换问题,建立了有关的公 阅读全文
posted @ 2013-05-19 09:27 Jack Ge 阅读(5523) 评论(0) 推荐(3) 编辑
摘要:Greatest NumberTime Limit: 1000MS Memory limit: 65536K题目描述 Saya likes math, because she think math can make her cleverer. One day, Kudo invited a very simple game: GivenNintegers, then the players choose no more than four integers from them (can be repeated) and add them together. Finally, the one.. 阅读全文
posted @ 2013-05-18 16:53 Jack Ge 阅读(583) 评论(0) 推荐(0) 编辑
摘要:小明系列故事——师兄帮帮忙Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2722Accepted Submission(s): 686Problem Description 小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女生又拿一道数学题来请教小明,小明当然很高兴的就接受了。不过等他仔细读题以后,发现自己也不会做,这下小明囧了:如果. 阅读全文
posted @ 2013-05-15 19:03 Jack Ge 阅读(349) 评论(0) 推荐(0) 编辑
摘要:湫湫系列故事——植树节Time Limit: 1000/500 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 694Accepted Submission(s): 409Problem Description 今天是一年一度的植树节,腾讯幼儿园要求每个老师在班里选出几个小朋友一起去野外种植小树苗,根据学校的整体安排,湫湫老师的班里要选出3个小朋友。已知湫湫的班里共有n个孩子,每个孩子有Bi个朋友(i从1到n),且朋友关系是相互的,如果a小朋友和b小朋友是朋友,那么b小朋友和a小朋友也. 阅读全文
posted @ 2013-05-15 17:05 Jack Ge 阅读(429) 评论(0) 推荐(0) 编辑
摘要:1461.致命游戏http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1461Time Limit: 3000 MSMemory Limit: 65536 KTotal Submissions: 84 (53 users)Accepted: 35 (35 users)[My Solution]Description 程序员Alice和Bob摊上大事了,被判了死刑。恰巧这天遇上“网宿科技杯”厦门大学第四届程序设计积分赛,于是主办方决定大赦其中一个人的刑罚。 主办方开发了一个游戏:有一个n*m大小的矩形格子阵列,左下角为(1, 1)格子,放了瓶毒药。A 阅读全文
posted @ 2013-05-04 19:35 Jack Ge 阅读(314) 评论(0) 推荐(0) 编辑
摘要:Buy the TicketTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3286Accepted Submission(s): 1366Problem DescriptionThe "Harry Potter and the Goblet of Fire" will be on show in the next few days. As a crazy fan of Harry Potter, you will go t 阅读全文
posted @ 2013-05-02 22:37 Jack Ge 阅读(216) 评论(0) 推荐(0) 编辑
摘要:小孩报数问题Time Limit:1000MSMemory Limit:65536KTotal Submissions:8181Accepted:3851Description有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。Input第一行输入小孩的人数N(N<=64)接下来每行输入一个小孩的名字(人名不超过15个字符)最后一行输入W,S (W < N),用逗号","间隔Output按人名输 阅读全文
posted @ 2013-04-30 21:00 Jack Ge 阅读(364) 评论(0) 推荐(0) 编辑
摘要:QuestionsTime Limit:1000MSMemory Limit:65536KTotal Submissions:1208Accepted:441DescriptionHolding a collegiate programming contest is a very exhausting work. There is a well-known proverb that one fool can ask so many questions that a hundred clever men will not answer. And during a collegiate progr 阅读全文
posted @ 2013-04-30 20:23 Jack Ge 阅读(515) 评论(0) 推荐(0) 编辑
摘要:Eeny Meeny MooTime Limit:1000MSMemory Limit:65536KTotal Submissions:2929Accepted:2015DescriptionSurely you have made the experience that when too many people use the Internet simultaneously, the net becomes very, very slow.To put an end to this problem, the University of Ulm has developed a continge 阅读全文
posted @ 2013-04-30 16:56 Jack Ge 阅读(477) 评论(0) 推荐(0) 编辑
摘要:Tr ATime Limit : 1000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 11Accepted Submission(s) : 7Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 #include#includeus 阅读全文
posted @ 2013-04-28 13:25 Jack Ge 阅读(3653) 评论(0) 推荐(0) 编辑
摘要:Big NumberTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encr 阅读全文
posted @ 2013-04-28 08:03 Jack Ge 阅读(218) 评论(0) 推荐(0) 编辑
摘要:Round and Round We GoTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem DescriptionA cyclic number is an integer n digits in length which, when multiplied by any integer from 1 to n, yields a"cycle"of the 阅读全文
posted @ 2013-04-22 17:15 Jack Ge 阅读(282) 评论(0) 推荐(0) 编辑
摘要:ParliamentTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 2 Accepted Submission(s) : 1Problem DescriptionNew convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into 阅读全文
posted @ 2013-04-22 16:43 Jack Ge 阅读(642) 评论(0) 推荐(0) 编辑
摘要:False coinTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 1Problem DescriptionThe "Gold Bar"bank received information from reliable sources that in their last group of N coins exactly one coin is false and diff 阅读全文
posted @ 2013-04-22 16:23 Jack Ge 阅读(881) 评论(0) 推荐(0) 编辑