随笔分类 -  ACM

It's time to be Crazy
摘要:好久没有更新日志了。感觉这两年一直都是很急躁的干事情。有点冲动就干,但是一直没坚持下去。Hadoop一入门就丢了,WebKit还没入门也丢了。每天都挣扎着想应该学什么东西。这是一种不思进取的态度。因为一有阻碍就绕开了,选择了其他东西。如果一辈子都这样下去,我也许会活到很有活力,但是什么也不能留下。颓废的状态不能再有了,有了计划就要去执行,并坚持下去。现在水平很菜了,我需要:1.练习算法——>看算法导论,做ACM2.精通一门技术——>Linux下C语言编程3.制作一个小应用——>Android或IOS或Web应用4.介入一项研究——>搜索再坚持一点点。 阅读全文

posted @ 2013-07-19 16:06 Panderen 阅读(285) 评论(1) 推荐(0)

摘要:1 import java.util.Scanner; 2 3 public class BinaryCode { 4 5 public String[] decode(String message){ 6 String[] original = new String[2]; 7 StringBuffer s1=new StringBuffer(); 8 StringBuffer s2=new StringBuffer(); 9 10 int flag1=0,flag2=0;11 ... 阅读全文

posted @ 2012-04-26 09:34 Panderen 阅读(254) 评论(0) 推荐(0)

摘要:DescriptionA checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detecting transmission errors, validating document contents, and in many other situations where it 阅读全文

posted @ 2012-04-11 23:30 Panderen 阅读(271) 评论(0) 推荐(0)

摘要:DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.This is an example of one of her creations: D ... 阅读全文

posted @ 2012-04-11 22:52 Panderen 阅读(224) 评论(0) 推荐(0)

摘要:DescriptionIn 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 numbers.For example: 8 = 3 + 5. Both 3 and 5 are odd prime numbers. 20 = 3 + 阅读全文

posted @ 2012-04-09 22:00 Panderen 阅读(168) 评论(0) 推荐(0)

摘要:View Code #include <iostream>#include <cmath>#include <cstring>using namespace std;typedef struct move{ int from; int to;} move;int main(){ move m[400]; int shap[400]; int T, N; int x, y, res; cin>>T; while(T--) { memset(shap,0,sizeof(shap)); cin>>N; f... 阅读全文

posted @ 2012-04-09 16:17 Panderen 阅读(634) 评论(0) 推荐(0)

摘要:DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two representations 5 + 7 + 11 + 13 + 17 and 53. The integer 41 has three representations 2+3+5+7+ 阅读全文

posted @ 2012-04-09 13:40 Panderen 阅读(458) 评论(0) 推荐(0)

摘要:来源:http://hi.baidu.com/hking1987/blog/item/3c9525f50db21d66ddc4749b.html素数还有很多东西需要学,先整理三种最简单的判断素数的方法,以后再深究补充。判断n是否为素数1、最简单的方法用n除以2-sqrt(n),有一个能除尽就不是素数,否则是素数。时间复杂度:O(sqrt(n))2、素数判断法:这种方法是对上面方法的改进,上面方法是对2-sqrt(n)之间的数进行判断是否能除尽,而因为有如下算术基本定理,可以减少判断量。算术基本定理:又称为素数的唯一分解定理,即:每个大于1的自然数均可写为素数的积,而且这些素因子按大小排列之后, 阅读全文

posted @ 2012-04-09 10:14 Panderen 阅读(624) 评论(0) 推荐(0)

导航