题目:The sum of the squares of the first ten
natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first
ten natural numbers is,(1 + ...
分类:
其他好文 时间:
2014-05-26 02:15:16
阅读次数:
216
add two numbers without arithmetic
分类:
其他好文 时间:
2014-05-26 01:25:43
阅读次数:
224
输入一个字符串(长度在100以内),统计其中数字字符出现的次数。样例输入Ab100cd200样例输出6#include"stdio.h"int main(){
char a[100]; int i; int sum=0; scanf("%s",a); for(i=0;...
分类:
其他好文 时间:
2014-05-26 00:09:23
阅读次数:
193
战斗
懵懂的少年,不懂学习,整天旷课逃学,直到毕业
无意中成了村里伙伴唯一考上初中的,老人们说,厉害
上了初中还继续跟同学打架,老师批评,竟然落泪,然后老师说,你太小,留级
留级后黑暗中点日光灯,触电,怕怕,考试竟然进了班里的前三名
去重点高中!从此懂得了努力,第一次人生的战斗
在远离家乡的县城里,我看着眼花缭乱的游戏机,听到里面喊
three,two,one,zero,fight
...
分类:
其他好文 时间:
2014-05-25 12:50:32
阅读次数:
188
Flip GameDescriptionFlip game is played on a
rectangular 4x4 field with two-sided pieces placed on each of its 16 squares.
One side of each piece is w...
分类:
其他好文 时间:
2014-05-25 03:21:52
阅读次数:
255
题目:
Given an array S of n integers, are there elements a, b, c in S such that a + b + c =
0? Find all unique
triplets in the array which gives the sum of zero.
Note:
Elements...
分类:
其他好文 时间:
2014-05-25 00:39:37
阅读次数:
343
http://poj.org/problem?id=3463
大致题意:给出一个有向图,从起点到终点求出最短路和次短路的条数之和。
解法:
用到的数组:dis[i][0]:i到起点的最短路,dis[i][1]:i到起点的严格次短路
vis[i][0],vis[i][1]:同一维的vis数组,标记距离是否已确定
sum[i][0]:i到起点的最短路条数,sum[i][1]:...
分类:
其他好文 时间:
2014-05-24 21:50:31
阅读次数:
287
2014百度之星资格赛——XOR SUM
Problem Description
Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。P...
分类:
其他好文 时间:
2014-05-24 20:53:55
阅读次数:
266
之所以说leetcode的测试用例有问题,是因为我刚开始理解错了题意,写下了如下的错误的代码。但是却AC了。
错误代码为:
bool canJump(int A[], int n) {
if(n == 0) return true;
int sum = 0; //记录当前的最远距离
int i = 0;
...
分类:
其他好文 时间:
2014-05-24 19:45:57
阅读次数:
1081
An integer is divisible by 3 if the sum of its digits is also divisible by 3. For example, 3702 is divisible by 3 and 12 (3+7+0+2) is also divisible by 3. This property also holds for the integer 9.
...
分类:
其他好文 时间:
2014-05-24 14:30:47
阅读次数:
208