05 2012 档案

摘要:E:C++ 与Java时间限制:2000ms内存限制:65536kB描述在百度之星的贴吧里面,Java的爱好者和C++的爱好者总是能为这两种语言哪个更好争论上几个小时。Java的爱好者会说他们的程序更加整洁且不易出错。C++的爱好者则会嘲笑Java程序很慢而且代码很长。另一个Java和C++爱好者不能达成一致的争论点就是命名问题。在Java中一个多个单词构成的变量名应该按照如下格式命名:第一个单词的开头用小写字母,其余单词都以大写字母开头,单词与单词之间不加分隔符,除单词的首字母之外的字母一律使用小写。例如:javaIdentifier, longAndMnemonicIdentifier, 阅读全文
posted @ 2012-05-31 18:53 漂木 阅读(292) 评论(0) 推荐(0)
摘要:2476: Star travelResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K895177StandardIn the future world, one can travel by spaceship from one star to another. Because of the long distance, the fuel consumption is not linear with distance. We should take more material within our spaceship, so th 阅读全文
posted @ 2012-05-16 19:23 漂木 阅读(298) 评论(0) 推荐(0)
摘要:最近上图论,学了单源最短路径的Dijkstra算法。Dijkstra算法的核心思想是贪心策略+动态规划。老师只字不提思想,硬分析过程还是有点@#$%的。结果就是,原先我还挺懂的,听完就凌乱了。在这里写一下吧=================================================参考资料:Wikipedia:http://en.wikipedia.org/wiki/Dijkstra's_algorithmNocow:http://www.nocow.cn/index.php/Dijkstra%E7%AE%97%E6%B3%95CLRS《算法设计与分析》===== 阅读全文
posted @ 2012-05-15 12:23 漂木 阅读(2675) 评论(0) 推荐(0)
摘要:刚安了JDK7,就发现eclipse不能启动了。log如下:!SESSION 2012-05-14 22:52:02.394 -----------------------------------------------eclipse.buildId=I20110613-1736java.version=1.7.0_04java.vendor=Oracle CorporationBootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_USCommand-line arguments: -os linux -ws gtk -arch x8. 阅读全文
posted @ 2012-05-14 23:08 漂木 阅读(1031) 评论(0) 推荐(0)
摘要:一. 下载JDK下载地址在这里http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html二. 解压安装sudo tar zxvf ./jdk-7u4-linux-i586.tar.gz -C /usr/lib/jvmcd /usr/lib/jvmsudo mv jdk1.7.0_04/ java-7-sun三. 配置环境变量vi ~/.bashrc 添加:export JAVA_HOME=/usr/lib/jvm/java-7-sunexport JRE_HOME=${JAVA_H 阅读全文
posted @ 2012-05-14 22:32 漂木 阅读(1376) 评论(0) 推荐(0)
摘要:Python入门的书并没有多少,但其实python也不需要特别像学习C语言一样一板一眼的学,完全可以通过写小程序或者看一些速成的教程(前提是你已经有了程序设计基础)学。我是通过Google Python Class进行学习,在这里记录一下学习笔记。====================================================================================Environment Ubuntu12.04 LTS 32-bitAuthor:majieGoogle Python class:https://code.google.com/.. 阅读全文
posted @ 2012-05-12 21:56 漂木 阅读(1310) 评论(0) 推荐(0)
摘要:一直想写个小游戏什么的,俄罗斯方块是个不错的选择,遂在网上查找了相应资料。 这里推荐大郑同学写得教程(http://iask.sina.com.cn/u/2172782541/ish?folderid=567144) 很不错,一步一步循序渐进地讲解了俄罗斯方块需要的各个函数怎么实现。效果图(其实我基本上就是照着敲了大郑同学的做图的各个函数,略加入了少许自己的东西):代码太丑了,就不贴了。神化模式我的设想是让程序自己判定落在哪里合适,尝试用枚举写了一下,不过好像有些复杂,而且智商有点低。CSDN上有同学说要用到人工智能的一些知识(个人觉得不至于吧...),这个暂时不会。以后再研究。 阅读全文
posted @ 2012-05-12 18:33 漂木 阅读(1608) 评论(0) 推荐(0)
摘要:1968: Common SubsequenceResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s4096K781227StandardA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence Z = < z1, z2, ..., zk > is a subse 阅读全文
posted @ 2012-05-08 10:35 漂木 阅读(199) 评论(0) 推荐(0)
摘要:2511: Number triangleResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s65536K467233Standard 5 3 4 8 1 2 5 4 3 62 1 7 9 8A number trangle is composed of N(N<=100) line numbers, the i-th line contains i positive integers(<=100). A chess can walk from the top line ... 阅读全文
posted @ 2012-05-07 22:40 漂木 阅读(385) 评论(0) 推荐(0)
摘要:1148: Prime CutsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1346447StandardA prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbe 阅读全文
posted @ 2012-05-06 20:24 漂木 阅读(226) 评论(0) 推荐(0)
摘要:1196: GoldbachResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K2275745StandardIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can be written as the sum of two odd prime num 阅读全文
posted @ 2012-05-06 19:11 漂木 阅读(397) 评论(0) 推荐(0)
摘要:2573: Product of two primesResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K929287Standard输出所有在10000 – 20000之间,恰好可以分解为两个素数乘积的整数。将这些数从小到大输出。Input无Output每一行输出一个符合要求的数,按照从小到大排列。下面是输出的头和尾,中间部分需自行计算10001.........19999Problem Source:skywindThis problem is used for contest:131Submit/Problem List/S 阅读全文
posted @ 2012-05-06 18:37 漂木 阅读(276) 评论(0) 推荐(0)
摘要:1483: ExponentiationResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K365109StandardProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems.This prob 阅读全文
posted @ 2012-05-05 23:02 漂木 阅读(235) 评论(0) 推荐(0)
摘要:1920: JojerResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K784242StandardMr Jojer is a teacher, and he is crazy in programming, he wants the computer to do every thing for him, one day, one of his colleague Mr NEtiger asks him to write a procedure for him. But Mr Jojer has another difficult 阅读全文
posted @ 2012-05-04 22:20 漂木 阅读(337) 评论(0) 推荐(0)
摘要:2154: Hungry RabbitsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1231423StandardA group of hungry rabbits had got a basket of carrots, but these carrots isn't enough for all the rabbits to stay alive. So they had a meeting to solve the problem. They determined to drive off some rabbi 阅读全文
posted @ 2012-05-03 22:33 漂木 阅读(339) 评论(0) 推荐(0)
摘要:1873: Power StringsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE10s8192K650258StandardGiven two stringsaandbwe definea*bto be their concatenation. For example, ifa = "abc"andb = "def"thena*b = "abcdef". If we think of concatenation as multiplication, exponentiation 阅读全文
posted @ 2012-05-03 17:27 漂木 阅读(181) 评论(0) 推荐(0)