E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
hackerrank
Identify Smith Numbers
Link: https://www.
hackerrank
.com/challenges/identify-smith-numbers 1 def sum_digits(n):
·
2015-10-31 14:53
number
Sherlock and Squares
//Link https://www.
hackerrank
.com/challenges/sherlock-and-squares 1 from math import sqrt # 用什么
·
2015-10-31 14:51
Lock
ACM ICPC Team
Link: https://www.
hackerrank
.com/challenges/acm-icpc-team/submissions/code/11617807 1 def count_max_topics
·
2015-10-31 14:49
ICPC
Halloween party
https://www.
hackerrank
.com/challenges/halloween-party 1 def main(): 2 t = int(raw_input
·
2015-10-31 14:47
part
Lonely Integer
https://www.
hackerrank
.com/challenges/lonely-integer 1 def main(): 2 n = int(raw_input())
·
2015-10-31 14:45
Integer
Service Lane
Link https://www.
hackerrank
.com/challenges/service-lane def main(): n, t = map(int,
·
2015-10-31 14:44
service
Hackerrank
(1): CodeStorm 2015 > Little Alexey's Tree
题目:ProblemStatementLittleAlexeywasplayingwithtreeswhilestudyingpowerfultreealgorithms.Recently,hediscoveredatreewithnvertices.Oneachedge,there'salowercaseEnglishletterwrittenonit.Ifweconcatenateallthe
u011029779
·
2015-10-31 13:00
Algorithm
面试题
hackerrank
Hackerrank
--Prime Sum
题目链接 The problem is quite simple. You're given a number N and a positive integer K. Tell if N can be represented as a sum of K prime numbers (not necessarily distinct). Input FormatThe first lin
·
2015-10-31 11:32
rank
Hackerrank
--Kundu and Tree
题目链接 Kundu is true tree lover. Tree is a connected graph having N vertices and N-1 edges. Today when he got a tree, he colored each edge with one of either red(r) or black(b) c
·
2015-10-31 11:32
tree
hackerrank
---List Comprehensions
题目链接 刷刷Python基本功...列表解析 附上代码: 1 x = int(input()) 2 y = int(input()) 3 z = int(input()) 4 n = int(input()) 5 print [[i, j, k] for i in xrange(x+1) for j in xrange(y+1) for k in xrange(z+1) if i+j+k
·
2015-10-31 10:36
list
hackerrank
---Find a string
题目链接 在字符串a中查找字符串b出现的次数...貌似不可以用a.count() 附上代码: 1 a = raw_input().strip() 2 b = raw_input().strip() 3 cnt = 0; 4 for i in xrange(len(a)): 5 cnt += 1 if a.find(b, i, i+len(b))!= -1 else 0 6 prin
·
2015-10-31 10:36
String
hackerrank
---Sets - Symmetric Difference
题目链接 集合操作 附上代码: 1 M = int(input()) 2 m = set(map(int, raw_input().strip().split())) 3 N = int(input()) 4 n = set(map(int, raw_input().strip().split())) 5 tmp = sorted(m.union(n).difference(m.inter
·
2015-10-31 10:36
rank
【
HackerRank
】Closest Numbers
Sorting is often useful as the first step in many different tasks. The most common task is to make finding things easier, but there are other uses also. Challenge Given a list of unsorted number
·
2015-10-31 09:56
number
【
HackerRank
】Median
题目链接:Median 做了整整一天T_T 尝试了各种方法: 首先看了解答,可以用multiset,但是发现java不支持; 然后想起来用堆,这个基本思想其实很巧妙的,就是维护一个最大堆和最小堆,最大堆存放前半部分较小的元素,最小堆存放后半部分较大的元素,并且最大堆的所有元素小于最小堆的所有元素;保持最大堆最多比最小堆多一个元素。每次插入元素的时候都先插入到最大堆,如果发现最大堆比最小堆多
·
2015-10-31 09:56
media
【
HackerRank
】Encryption
One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). The width
·
2015-10-31 09:56
encrypt
【
HackerRank
】Missing Numbers
Numeros, The Artist, had two lists A and B, such that, B was a permutation of A. Numeros was very proud of these lists. Unfortunately, while transporting them from one ex
·
2015-10-31 09:56
number
【
HackerRank
】Pairs
题目链接:Pairs 完全就是Two Sum问题的变形!Two Sum问题是要求数组中和正好等于K的两个数,这个是求数组中两个数的差正好等于K的两个数。总结其实就是“骑驴找马”的问题:即当前遍历ar[i],那么只要看数组中是否存在ar[i]+K或者ar[i]-K就可以了,还是用HashMap在O(1)的时间完成这个操作。 题目有一点没说清楚的就是元素是否有重复,从Editorial来看似乎是没
·
2015-10-31 09:56
rank
【
HackerRank
】 Sherlock and The Beast
Sherlock and The Beast Sherlock Holmes is getting paranoid about Professor Moriarty, his archenemy. All his efforts to subdue Moriarty have been in vain. These days Sherlock is working on a problem w
·
2015-10-31 09:55
Lock
【
HackerRank
】Bus Station
有n组好朋友在公交车站前排队。第i组有ai个人。还有一辆公交车在路线上行驶。公交车的容量大小为x,即它可以同时运载x个人。 当车站来车时(车总是空载过来),一些组从会队头开始走向公交车。 当然,同一组的朋友不想分开,所以仅当公交车能容纳下整个组的时候,他们才会上车。另外,每个人不想失去自己的位置,即组的顺序不会改变。 问题时如何选择公交车的容量大小x使得它可以运走所有组的人,并且公交车每次从车站出
·
2015-10-31 09:55
rank
【
HackerRank
】Lonely Integer
There are N integers in an array A. All but one integer occur in pairs. Your task is to find out the number that occurs only once. Input Format The first line of the input contains an
·
2015-10-31 09:55
Integer
【
HackerRank
】 The Full Counting Sort
In this challenge you need to print the data that accompanies each integer in a list. In addition, if two strings have the same integers, you need to print the strings in their original order. Hence,
·
2015-10-31 09:55
count
【
HackerRank
】Ice Cream Parlor
Sunny and Johnny together have M dollars which they intend to use at the ice cream parlour. Among N flavors available, they have to choose two distinct flavors whose cost equals M. Given a list of cos
·
2015-10-31 09:55
rank
【
HackerRank
】Sherlock and Array
Watson gives an array A1,A2...AN to Sherlock. Then he asks him to find if there exists an element in the array, such that, the sum of elements on its left is equal to the sum of elements on its right.
·
2015-10-31 09:55
array
【
HackerRank
】 有洞的地图
给你一个n*n的地图。地图中的每个格子有一个值表示该地区的深度。我们称一个地图中的一个格子为空洞,当且仅当该格子不在地图边缘并且每个和它相邻的格子都具有比它更小的深度。两个格子称为相邻如果它们共有一条边。 你要找到地图中所有的空洞,并且用X描述。 输入格式 第一行包含一个整数n,表示地图的规模。 接下来n行中每行包含n个无空白的正数字。每个数字(1-9)表示对应区域的深度。 输出格式 输
·
2015-10-31 09:55
rank
【
HackerRank
】The Love-Letter Mystery
James找到了他的朋友Harry要给女朋友的情书。James很爱恶作剧,所以他决定要胡搞一下。他把信中的每个单字都变成了回文。对任何给定的字符串,他可以减少其中任何一个字符的值,例如'd'可以变成'c',这算是一次操作。(另外,他最多只能将字符的值减少至'a','a'不能再被减少成'z')。找出将给定字符串转换成回文所需的最少操作次数。 输入格式 第一行包含整数 T 代表测试数据的组数。
·
2015-10-31 09:54
rank
【
HackerRank
】Gem Stones
Gem Stones John has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lowercase latin letter from 'a' to 'z'. An element can be present multipl
·
2015-10-31 09:54
rank
【
HackerRank
】Utopian tree
The Utopian tree goes through 2 cycles of growth every year. The first growth cycle of the tree occurs during the monsoon, when it doubles in height. The second growth cycle of the tree occurs during
·
2015-10-31 09:54
tree
【
HackerRank
】Maximizing XOR
给定两个整数:L 和 R ∀ L ≤ A ≤ B ≤ R, 找出 A xor B 的最大值。 输入格式 第一行包含 L 第一行包含 R 数据范围 1 ≤ L ≤ R ≤ 103 输出格式 输出最大的异或和 题解: 1 import java.io.*; 2 import java.util.*; 3 import java.text.*; 4 import ja
·
2015-10-31 09:54
rank
【
HackerRank
】Manasa and Stones
Change language : Manasa 和 她的朋友出去徒步旅行。她发现一条小河里边顺序排列着带有数值的石头。她开始沿河而走,发现相邻两个石头上的数值增加 a 或者 b. 这条小河的尽头有一个宝藏,如果Manasa能够猜出来最后一颗石头上的数值,那么宝藏就是她的。假设第一个石头的上数值为0,找出最后一个石头的可能的所有数值。 输入格式 第一行包含整数 T, 代表测试数据的组数。
·
2015-10-31 09:54
rank
【
HackerRank
】Halloween party
Change language : Alex is attending a Halloween party with his girlfriend Silvia. At the party, Silvia spots a giant chocolate bar. If the chocolate can be served as only 1 x 1 sized pieces and Alex
·
2015-10-31 09:54
rank
【
HackerRank
】 Filling Jars
Animesh has N empty candy jars, numbered from 1 to N, with infinite capacity. He performs M operations. Each operation is described by 3 integers a, b and k. Here, a and b are index of the jars, and k
·
2015-10-31 09:54
rank
【
HackerRank
】 Find Digits
Find Digits Problem Statement Given a number you have to print how many digits in that number exactly divides that number. Input format The first line contains T (number of test cases followed by
·
2015-10-31 09:54
find
hackerrank
--- challenges/fp-update-list
纯属为了练习haskell, 竟然贴代码都没办法高亮。 challenges/fp-update-list Update the values of a list with their absolute values. The input and output portions will be handled automatically during grading. You only
·
2015-10-30 14:22
update
Schedule(
Hackerrank
Quora Haqathon)
题目链接 Problem Statement At Quora, we run all our unit tests across many machines in a test cluster on every code push. One day, we decided to see if we could optimize our test cluster for c
·
2015-10-27 15:28
schedule
Hackerrank
--Mixing proteins(Math)
题目链接 Some scientists are working on protein recombination, and during their research, they have found a remarkable fact: there are 4 proteins in the protein ring that mutate after every second acc
·
2015-10-27 15:15
Math
Hackerrank
--Lexicographic paths
题目链接 Krishnakant is standing at (0,0) in the Cartesian plane. He wants to go to the point (N,M) in the same plane using only horizontal and vertical moves of 1 unit.
·
2015-10-27 15:14
Graph
Hackerrank
--Team Formation
题目链接 For an upcoming programming contest, Roy is forming some teams from the n students of his university. A team can have any number of contestants. Roy knows the skill level of each
·
2015-10-27 15:14
format
Hackerrank
--XOR love (Math系列)
题目链接 Devendra loves the XOR operation very much which is denoted by ∧ sign in most of the programming languages. He has a list A of N numbers and he wants to know the
·
2015-10-27 15:14
Math
Hackerrank
--Savita And Friends(最小直径生成树MDST)
题目链接 After completing her final semester, Savita is back home. She is excited to meet all her friends. Her N friends live in different houses spread across the city. There are M&
·
2015-10-27 15:13
rank
Hackerrank
--Volleyball Match
题目链接 Tatyana is a big sports fan and she likes volleyball a lot! She writes down the final scores of the game after it has ended in her notebook. If you are not familiar with the rules of volley
·
2015-10-27 15:13
Volley
Hackerrank
--String Function Calculation(后缀数组)
题目链接 Jane loves string more than anything. She made a function related to the string some days ago and forgot about it. She is now confused about calculating the value of this function. She has a
·
2015-10-27 15:12
function
Hackerrank
--Ashton and String(后缀数组)
题目链接 Ashton appeared for a job interview and is asked the following question. Arrange all the distinct substrings of a given string in lexicographical order and concatenate them. Print
·
2015-10-27 15:12
String
Hackerrank
--Divisibility of Power(Math)
题目链接 You are given an array A of size N. You are asked to answer Q queries. Each query is of the form : i j x You need to print Yes if x divides
·
2015-10-27 15:10
visibility
Hackerrank
--Emma and sum of products (FFT)
题目链接 Emma is really fond of integers and loves playing with them. Her friends were jealous, and to test her, one of them gave her a problem. Emma is given a list A of N in
·
2015-10-27 15:10
rank
Hackerrank
--Stock Maximize(DP Practice)
题目链接 Your algorithms have become so good at predicting the market that you now know what the share price of Wooden Orange Toothpicks Inc. (WOT) will be for the next N days. Each day, you can eit
·
2015-10-27 15:09
rank
Make the Most (
Hackerrank
Codeagon)
题目链接 Problem Statement Codenation is sending N of its employees to a High Profile Business Conference and the goal is to cover maximum number of presentations, to create maximu
·
2015-10-23 08:44
code
Hackerrank
-Data structures-Tree
基本的简单题目,很适合数据结构入门用,基本就是先中后遍历、层序遍历、测树的高度、打印树的左右侧节点、插入、交换子树、哈夫曼解码等等基础操作难度是Moderate的1.Tree:HuffmanDecoding/*名称:Tree:HuffmanDecoding难度:Moderate类别:/思路:题目本身不难,弄懂题意就好:按照他的意思将哈夫曼编码解码即可*/#include#includeusingn
Ava1anche
·
2015-07-25 14:20
Hackerrank
数据结构
Oj
数据结构及算法笔记
【HackerRank】
[
hackerrank
] Sherlock and Squares
https://www.
hackerrank
.com/challenges/sherlock-and-squares这个题就是求两个数字之间的平方数,比如3到9之间,有4和9两个平方数最初我选择的是简单粗暴的数列方法
七郡
·
2015-06-16 23:00
ACM ICPC Team
https://www.
hackerrank
.com/challenges/acm-icpc-teamget到了新用法itertools的一点点知识另外复习了二进制的一些利用(好吧,其实已经忘光了,如果不用二进制来解题
七郡
·
2015-06-16 20:00
[
HackerRank
] The Longest Common Subsequence
This is the classic LCS problem. Since it requires you to print one longest common subsequence, just use the O(m*n)-space version here. My accepted code is as follows. 1 #include <iostream>
·
2015-06-14 23:00
sequence
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他