HackerRank
文章平均质量分 80
完美世界xx
Happiness is more than pleasure without pain
展开
-
Gem Stones
Problem Statement John 发现了很多种岩石。每种岩石都有一个独一无二成分:由小写英文字母组成。宝石是由一个单一的字符组成,并且将在所有岩石中出现。 给出一些岩石的成分,输出有多少种不同的宝石存在。 输入格式 第一行包含一个整数 N, 代表岩石的个数 接下来的N行,每行包含岩石的构成,由小写的英文字母组成。 输出格式 输出有多少种不同的原创 2015-05-03 10:42:00 · 521 阅读 · 0 评论 -
Project Euler #77: Prime summations 回溯法得不到满分
Problem Statement This problem is a programming version of Problem 77 from projecteuler.net It is possible to write ten as the sum of primes in exactly five different ways: 7+35+55+3+23原创 2015-05-07 13:06:57 · 746 阅读 · 0 评论 -
Merge two sorted linked lists
Problem Statement This challenge is part of a tutorial track by MyCodeSchool You’re given the pointer to the head nodes of two sorted linked lists. The data in both lists will be sorted in原创 2015-05-06 11:24:35 · 617 阅读 · 0 评论 -
最长公共子序列
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int LCS(String a,String b){ int sa=a.length();原创 2015-05-05 09:22:19 · 388 阅读 · 0 评论 -
Reverse a linked list
Problem Statement This challenge is part of a tutorial track by MyCodeSchool and is accompanied by a video lesson. You’re given the pointer to the head node of a linked list. Change the ne原创 2015-05-04 23:19:14 · 456 阅读 · 0 评论 -
Maximizing XOR 这么顺利地解决。。。
Problem Statement 给定两个整数:L 和 R ∀ L ≤ A ≤ B ≤ R, 找出 A xor B 的最大值。 输入格式 第一行为 L 第二行为 R 数据范围 1 ≤ L ≤ R ≤ 103 输出格式 输出最大的异或和 样例输入 1 10 样例输出 15 样例解释 当B = 10, A =原创 2015-05-03 08:14:53 · 551 阅读 · 0 评论 -
Anagram
Problem Statement Sid is obsessed with reading short stories. Being a CS student, he is doing some interesting frequency analysis with the books. He chooses strings S1 and S2 in such a way th原创 2015-05-03 17:41:01 · 571 阅读 · 0 评论 -
交替的字符
Problem Statement Shashank非常喜欢字符串,特别是那些连续字符都是不一样的字符串。比如:他喜欢ABABA,但他不喜欢ABAA。给定一个字符串,该字符串只可能由字母A和B组成。Shashank想把这个字符串转变成他喜欢的字符串,在转变的过程中,他允许删除字符串中的某些字符。 你的任务就是找出最少需要删除几个字符,才能把给定的字符串转变成Shashank喜欢的原创 2015-05-03 08:57:05 · 562 阅读 · 0 评论 -
Make it Anagram
Problem Statement Chinese Version Russian Version Alice recently started learning about cryptography and found that anagrams are very useful. Two strings are anagrams of each other if the原创 2015-05-03 12:55:02 · 436 阅读 · 0 评论 -
Fibonacci Modified 大整数
Problem Statement A series is defined in the following manner: Given the nth and (n+1)th terms, the (n+2)th can be computed by the following relation Tn+2 = (Tn+1)2 + Tn So, i原创 2015-05-07 23:14:11 · 879 阅读 · 0 评论