摘抄自http://www.cnblogs.com/springfor/p/3870801.html“这道题运用位运算的异或。异或是相同为0,不同为1。所以对所有数进行异或,得出的那个数就是single number。初始时先让一个数与0异或,然后再对剩下读数挨个进行异或。这里运用到异或的性质:对于...
分类:
其他好文 时间:
2015-04-23 12:41:05
阅读次数:
151
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming
weight).
For example, the 32-bit integer ’11' has binary representation 000000...
分类:
其他好文 时间:
2015-04-23 10:59:45
阅读次数:
206
Employment PlanningProblem DescriptionA project manager wants to determine the number of the workers needed in every month. He does know...
分类:
其他好文 时间:
2015-04-23 01:57:04
阅读次数:
136
DescriptionConsider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that sta...
分类:
编程语言 时间:
2015-04-23 01:52:14
阅读次数:
144
create database s000create table student(sno int primary key not null,--学生的学号 number的简称sname varchar(50) not null,--学生的名字ssex varchar(50) not null,-.....
分类:
数据库 时间:
2015-04-22 23:29:32
阅读次数:
168
优先队列,真是水的不行~
保持队列里只有K个元素即可
#include
#include
using namespace std;
priority_queue, greater >mapp;
int n,k;
string cmd;
int main()
{
while(cin>>n>>k)
{
while(mapp.size()) mapp.pop();
while(n--)
...
分类:
其他好文 时间:
2015-04-22 22:21:58
阅读次数:
105
Write an algorithm to determine if a number is "happy".
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares...
分类:
移动开发 时间:
2015-04-22 22:20:40
阅读次数:
137
/*
*读取文件中的数据(数据以结构体存放)
*/#include
#include //#define Field 31 //field_anal number
#define Field 15 //field_post numberusing namespace std;
//the level restore certain level data...
分类:
其他好文 时间:
2015-04-22 22:18:47
阅读次数:
165
Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of...
分类:
移动开发 时间:
2015-04-22 22:15:41
阅读次数:
1099
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:
其他好文 时间:
2015-04-22 20:32:54
阅读次数:
145