随笔分类 -  ACM程序比赛

1
摘要:2.1 最基础的“穷竭搜索” 2.1.1 递归函数 阶乘递归程序 斐波那契数列递归程序 2.1.2 栈 栈的应用程序 2.1.3 队列 队列的应用程序 2.1.4 深度优先搜索(DFS) 例子1:部分和问题 108要用什么数据类型? 例子2:Lake Counting 2.1.5 宽度优先搜索(BF 阅读全文
posted @ 2018-03-24 13:55 RunningYY 阅读(210) 评论(0) 推荐(0)
摘要:Lesson1(3月19日) 1.讲解Dev-C++、VC++6.0的单步调试方法 2.学习比赛的基本输入输出,练习C语言网的1085—1092 Lesson2(3月21日) 1.学习挑战程序设计,第1章的题目 2.练习ZOJ平台脑残题、极简单题 脑残题:1001、1048、1763、2186、22 阅读全文
posted @ 2018-03-19 18:05 RunningYY 阅读(308) 评论(0) 推荐(0)
摘要:1.你的朋友提议玩一个游戏:将写有数字的n个纸片放入口袋中,你可以从口袋中抽取4次纸片,每次记下纸片上的数字后都将其放回口袋中。如果这4个数字的和是m,就是你赢,否则就是你的朋友赢。你挑战了好几回,结果一次也没赢过,于是怒而撕破口袋,去除所有纸片,检查自己是否真的有赢的可能性。请你编写一个程序,判断 阅读全文
posted @ 2018-02-23 10:46 RunningYY 阅读(323) 评论(0) 推荐(0)
摘要:作业1 1. 确保已拿到教材《算法竞赛入门经典》 2. 熟悉C编译工具,学会单步调试 3. 阅读完教材第1章。 作业2 1. 阅读完教材第2章。 2. 完成书上例2-1、2-2、2-3、2-4、2-5、2-6。 作业3 1. 阅读完教材第3章37-50。 2. 完成书上例子: 开灯问题、蛇形填数、竖 阅读全文
posted @ 2017-12-07 12:55 RunningYY 阅读(181) 评论(0) 推荐(0)
摘要:0.比赛介绍 (1)浙江省大学生程序设计比赛,3人一组,题目为英文 (2)ACM程序设计比赛 百度百科介绍 1.理论学习 (1)《挑战程序设计竞赛》,秋叶拓哉,巫泽俊 (2)《算法竞赛入门经典》,刘汝佳 2.题库练习 (1)“C语言网” (2)浙大OJ网站 3.工具下载 (1)Dev-C 5.6.1 阅读全文
posted @ 2017-12-07 12:51 RunningYY 阅读(350) 评论(2) 推荐(0)
摘要:3.1 数组 1.在算法竞赛中,常常难以精确计算出需要的数组大小,数组一般会声明得稍大一些。在空间够用的前提下,浪费一点是不会有太大影响。 2.比较大的数组应尽量声明在main函数外,否则程序可能无法运行。 3.整型数组a复制k个元素到数组b,memcpy(b,a,sizeof(int)*k。 浮点 阅读全文
posted @ 2017-11-21 22:33 RunningYY 阅读(164) 评论(0) 推荐(0)
摘要:2.1 for循环 1.建议尽量缩短变量的定义范围。例如,在for循环的初始化部分定义循环变量。 例题2-1 aabb 输出所有形如aabb的4位完全平方数(即前两位数字相等,后两位数字也相等)。 浮点数计算存在误差,四舍五入的做法floor(x+0.5) 思路反转,枚举平方根,再判断是否符合aab 阅读全文
posted @ 2017-11-21 18:27 RunningYY 阅读(162) 评论(0) 推荐(0)
摘要:1.1 算术表达式 1.2 变量及其输入 1.竞赛程序和C语言教材程序的区别 (1)不要再用户输入之前打印提示信息(例如“Please input n:”),这不仅不会为程序赢得更高的“界面友好分”,反而会让程序丢掉大量的(甚至所有的)分数——这些提示信息会被当做输出数据的一部分。 (2)不要让程序 阅读全文
posted @ 2017-11-21 16:28 RunningYY 阅读(244) 评论(0) 推荐(0)
摘要:It's Saturday today, what day is it after 11 + 22 + 33 + ... + NN days? Input There are multiple test cases. The first line of input contains an integ 阅读全文
posted @ 2017-04-21 14:53 RunningYY 阅读(175) 评论(1) 推荐(0)
摘要:Hart is engaged in playing an interesting game, Gnome Tetravex, these days. In the game, at the beginning, the player is given n*n squares. Each squar 阅读全文
posted @ 2017-04-12 21:21 RunningYY 阅读(173) 评论(0) 推荐(0)
摘要:Produce a table of the values of the series for the 2001 values of x, x= 0.000, 0.001, 0.002, ..., 2.000. All entries of the table must have an absolu 阅读全文
posted @ 2017-03-22 14:03 RunningYY 阅读(290) 评论(2) 推荐(0)
摘要:Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one 阅读全文
posted @ 2017-03-14 20:22 RunningYY 阅读(245) 评论(0) 推荐(0)
摘要:IIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallo 阅读全文
posted @ 2017-03-12 21:07 RunningYY 阅读(209) 评论(0) 推荐(0)
摘要:How can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT: 颠倒字母顺序构成的词如何产生于 阅读全文
posted @ 2017-03-12 21:05 RunningYY 阅读(302) 评论(0) 推荐(0)
摘要:On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 label 阅读全文
posted @ 2017-03-10 19:34 RunningYY 阅读(307) 评论(1) 推荐(0)
摘要:Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a 阅读全文
posted @ 2017-03-08 18:49 RunningYY 阅读(723) 评论(3) 推荐(0)
摘要:Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output For 阅读全文
posted @ 2017-03-08 18:47 RunningYY 阅读(214) 评论(0) 推荐(0)
摘要:第1章 程序设计入门 第2章 循环结构程序设计 第3章 数组和字符串 第4章 函数和递归 第5章 C++与STL入门 第6章 数据结构基础 第7章 暴力求解法 第8章 高效算法设计 第9章 动态规划初步 第10章 数学概念与方法 第11章 图论模型与算法 第12章 高级专题 阅读全文
posted @ 2017-03-08 18:29 RunningYY 阅读(686) 评论(0) 推荐(0)
摘要:请大家把自己在练习中遇到的一些经验编程段子,写在评论里。 阅读全文
posted @ 2016-03-15 18:44 RunningYY 阅读(136) 评论(0) 推荐(0)
摘要:一、比赛规则1. 比赛时间为5个小时。 2. 参赛队必须准时进入统一竞赛场地,先按照竞赛专家委员会主任的指示,进入竞赛网页登录。当比赛开始时,即可通过链接打开题目,并根据页面提示提交程序。 3. 参赛队员可以携带诸如书、手册、 程序清单等参考资料。 4. 参赛队员不能携带任何可用计算机处理的软件或数 阅读全文
posted @ 2016-03-08 14:26 RunningYY 阅读(306) 评论(0) 推荐(0)

1