1129 - 喵哈哈村的战斗魔法师丶坏坏い月 Time Limit:3s Memory Limit:256MByte Submissions:315Solved:71 DESCRIPTION 坏坏い月是月大叔的ID,他是一个掌握者772002种魔法的物理系战士,最擅长的技能就是搞事.今天他又要开始搞事了. 给你n 个数,你需要实现一下操作: l r v ,在[l,r]区间内找到第一个大于等于v的数,输出这个数的下标,如果找不到的话,请输出-1噢 l r v,让[l,r]区间所有数增加v INPU…
1129 - 喵哈哈村的战斗魔法师丶坏坏い月 Time Limit:3s Memory Limit:256MByte Submissions:490Solved:107 DESCRIPTION 坏坏い月是月大叔的ID,他是一个掌握者772002种魔法的物理系战士,最擅长的技能就是搞事.今天他又要开始搞事了. 给你n 个数,你需要实现一下操作: l r v ,在[l,r]区间内找到第一个大于等于v的数,输出这个数的下标,如果找不到的话,请输出-1噢 l r v,让[l,r]区间所有数增加v INP…
/*斐波那契数列,又称黄金分割数列,指的是这样一个数列: 0.1.1.2.3.5.8.13.21.…… 在数学上,斐波纳契数列被定义如下: F0=0,F1=1, Fn=F(n-1)+F(n-2)(n>=2,n∈N*) 现在问题是:输入n,0≤n ≤1000,计算该数列第n项的值. */ #include<iostream> using namespace std; int main() { int n,i; long long a,b,c; while(cin>>n) { |…
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. Follow up: Could you do it without an…
1045 - Digits of Factorial Factorial of an integer is defined by the following function f(0) = 1 f(n) = f(n - 1) * n, if(n > 0) So, factorial of 5 is 120. But in different bases, the factorial may be different. For example, factorial of 5 in base 8 i…
1152 - Expected value of the expression Time Limit:2s Memory Limit:128MByte Submissions:128Solved:63 DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents op…
博客搬至blog.csgrandeur.com,cnblogs不再更新. 新的题解会更新在新博客:http://blog.csgrandeur.com/2014/01/15/LeetCode-OJ-Solution/ ———————————————————————————————————————— ———————————————————————————————————————— LeetCode OJ 题解 LeetCode OJ is a platform for preparing tech…
使用CM离线安装CDH-5.4.3,如下: cdh5.4.3安装 配置/etc/hosts vim /etc/hosts 192.168.10.1 s1 192.168.10.2 s2 192.168.10.3 s3 192.168.10.4 s4 192.168.10.5 s5 192.168.10.6 s6 关闭防火墙 service iptables stop chkconfig iptables off service iptables status 关闭selinux vim /etc…
Problem Description ztr loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits other than 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Lucky number is…
PKU OJ 1002 487-3279 487-3279 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by dialin…