解法三种: Sln 1. 笨办法,移位。时间复杂度太高,基本就是O(n * sizesof(int)).Sln 2. 利用一个小技巧,偶数除二,在其另外一个乘数左移 1bit而得;奇数在前所得上加1Sln 3. Hamming Weight; 利弊: Sln 1不考虑,复杂度过高。相对来说Sln 2 ...
分类:
其他好文 时间:
2016-06-05 15:20:44
阅读次数:
290
题意:n个字符串,如果元音就是输出大写,否则输出小写。 析:没啥可说的,只要判断AEIOU就OK了。 代码如下: ...
分类:
其他好文 时间:
2016-06-02 19:46:16
阅读次数:
131
前言
在iOS5之后apple推出了相对于MRC(Mannul Reference Counting)的ARC(Automatic
Reference Counting)的内存管理机制,前者是对内存的手动管理,后者是系统对内存的智能化管理。其实我学习iOS的时候已经推出到iOS7了,对于MRC机制我甚至连一知半解都算不上。有时候和iOS老司机交流的时候他们对于各种内存都很熟悉,感觉包括我...
分类:
编程语言 时间:
2016-05-30 15:50:43
阅读次数:
219
题目链接:https://leetcode.com/problems/counting-bits/
题目:
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representa...
分类:
其他好文 时间:
2016-05-30 15:35:05
阅读次数:
174
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题。 ZOJ 3944 http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=3944 In a BG (dinner gathering) for ZJU ICPC team, th ...
分类:
其他好文 时间:
2016-05-29 18:25:05
阅读次数:
215
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 28220 Accepted: 14160 Description Due to recent rains, water has pooled in va ...
分类:
其他好文 时间:
2016-05-29 18:13:12
阅读次数:
207
前言在iOS5之后apple推出了相对于MRC(Mannul Reference Counting)的ARC(Automatic Reference Counting)的内存管理机制,前者是对内存的手动管理,后者是系统对内存的智能化管理。其实我学习iOS的时候已经推出到iOS7了,对于MRC机制我甚至连一知半解都算不上。有时候和iOS老司机交流的时候他们对于各种内存都很熟悉,感觉包括我在内的很多最近...
分类:
编程语言 时间:
2016-05-27 12:25:50
阅读次数:
229
http://219.244.176.199/JudgeOnline/problem.php?id=1239 这是这次陕西省赛的G题,题目大意是一个n*n的点阵,点坐标从(1, 1)到(n, n),每个点都有权值,然后从(x, y)引x轴的垂线,然后构成一个三角形,三个顶点分别是(0, 0),(x, ...
分类:
编程语言 时间:
2016-05-24 15:13:26
阅读次数:
257
Digit Counting
Time Limit: 3000MS
Memory Limit: Unknown
64bit IO Format: %lld & %llu
SubmitStatus
Description
Trung is bored with his mathematics homeworks. He ta...
分类:
其他好文 时间:
2016-05-22 12:36:29
阅读次数:
364
How I Mathematician Wonder What You Are! Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 3568 Accepted: 1906 Description After counting so ...
分类:
其他好文 时间:
2016-05-20 00:39:45
阅读次数:
248