上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 109 下一页

2015年6月10日

1034. Head of a Gang (30) -string离散化 -map应用 -并查集

摘要: 题目如下: One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A a... 阅读全文

posted @ 2015-06-10 14:23 张大大123 阅读(170) 评论(0) 推荐(0) 编辑

2015年6月9日

1031. Hello World for U (20)

摘要: 题目如下: Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed a... 阅读全文

posted @ 2015-06-09 13:12 张大大123 阅读(136) 评论(0) 推荐(0) 编辑

1032. Sharing (25) -set运用

摘要: 题目如下: To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share th... 阅读全文

posted @ 2015-06-09 13:03 张大大123 阅读(264) 评论(0) 推荐(0) 编辑

1033. To Fill or Not to Fill (25) -贪心算法

摘要: 题目如下: With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to ... 阅读全文

posted @ 2015-06-09 12:42 张大大123 阅读(191) 评论(0) 推荐(0) 编辑

2015年6月5日

1029. Median (25)

摘要: 题目如下: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14... 阅读全文

posted @ 2015-06-05 16:00 张大大123 阅读(111) 评论(0) 推荐(0) 编辑

1028. List Sorting (25)

摘要: 题目如下: Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file contains one test case.... 阅读全文

posted @ 2015-06-05 15:52 张大大123 阅读(169) 评论(0) 推荐(0) 编辑

1027. Colors in Mars (20)

摘要: 题目如下: People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit nu... 阅读全文

posted @ 2015-06-05 15:42 张大大123 阅读(120) 评论(0) 推荐(0) 编辑

2015年6月3日

在 Mac OS X 10.10 安装 pyenv 的一个小坑

摘要: 小记一下。 因为全面转向 Python 3.4 作为主力开发版本,但是手上的 Mac OS X 和服务器上用的都是 Python 2.7,所以需要安装 pyenv。 按其 github 页面的说明,使用 homebrew 安装brew updatebrew install pyen... 阅读全文

posted @ 2015-06-03 13:08 张大大123 阅读(188) 评论(0) 推荐(0) 编辑

2015年6月2日

使用C++的string实现高精度加法运算

摘要: 对于超大数字的运算,用long long int仍然不能解决,这时候就需要考虑通过模拟运算和数组存储来实现高精度运算。 本文讨论借助C++的string来实现高精度的运算。 首先输入的量直接存储为string,设为s1和s2。 接下来设计一个反转函数,用于把整个字符串反转(为了方便后续计算)。 ... 阅读全文

posted @ 2015-06-02 20:58 张大大123 阅读(658) 评论(0) 推荐(0) 编辑

1025. PAT Ranking (25)

摘要: 题目如下: Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed ... 阅读全文

posted @ 2015-06-02 20:38 张大大123 阅读(153) 评论(0) 推荐(0) 编辑

上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 109 下一页

导航