Turing Tree Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4658    Accepted Submission(s): 1640 Problem Description After inventing Turing Tree, 3xian always felt boring when solving problems…
1005. Spell It Right (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: E…
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 34762 Accepted: 9126 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your…
DP 对于第i个状态(房子),有两种选择:偷(rob).不偷(not rob) 递推公式为: f(i)=max⎧⎩⎨⎪⎪{f(i−1)+vali,f(i−2)+vali,robi−1==0robi−1==1f(i−1),robnot rob f(i)为动态规划表(DP表)(状态i下的最优解) val为每间房子里的钱(val表) rob为记录是否已经偷过,0表示没偷过,1表示偷了(is_robbed表). 有了递推公式代码就很好写了 class Solution: # @param {intege…
Lowest Bit Time Limit: 2 Seconds      Memory Limit: 65536 KB Given an positive integer A (1 <= A <= 100), output the lowest bit of A. For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output shou…
hadooop提供了一个设置map个数的参数mapred.map.tasks,我们可以通过这个参数来控制map的个数.但是通过这种方式设置map的个数,并不是每次都有效的.原因是mapred.map.tasks只是一个hadoop的参考数值,最终map的个数,还取决于其他的因素.      为了方便介绍,先来看几个名词: block_size : hdfs的文件块大小,默认为64M,可以通过参数dfs.block.size设置 total_size : 输入文件整体的大小 input_file_…
介绍性内容来自:http://www.uml.org.cn/sjjm/201305171.asp 一.Ganglia简介 Ganglia 是 UC Berkeley 发起的一个开源监视项目,设计用于测量数以千计的节点.每台计算机都运行一个收集和发送度量数据(如处理器速度.内存使用量等)的名为 gmond 的守护进程.它将从操作系统和指定主机中收集.接收所有度量数据的主机可以显示这些数据并且可以将这些数据的精简表单传递到层次结构中.正因为有这种层次结构模式,才使得 Ganglia 可以实现良好的扩…
Self Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 22101   Accepted: 12429 Description In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to…
Binary Tree Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6355   Accepted: 2922 Description Background Binary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the node…
地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=102 //a^b mod c=(a mod c)^b mod c很容易设计出一个基于二分的递归算法. #include<stdio.h> #include<stdlib.h> //快速幂算法,数论二分 long long powermod(int a,int b, int c) //不用longlong就报错,题目中那个取值范围不就在2的31次方内 { long long t;…