
HackerRank
文章平均质量分 80
完美世界xx
Happiness is more than pleasure without pain
展开
-
Gem Stones
Problem StatementJohn 发现了很多种岩石。每种岩石都有一个独一无二成分:由小写英文字母组成。宝石是由一个单一的字符组成,并且将在所有岩石中出现。给出一些岩石的成分,输出有多少种不同的宝石存在。输入格式 第一行包含一个整数 N, 代表岩石的个数 接下来的N行,每行包含岩石的构成,由小写的英文字母组成。输出格式 输出有多少种不同的原创 2015-05-03 10:42:00 · 534 阅读 · 0 评论 -
Project Euler #77: Prime summations 回溯法得不到满分
Problem StatementThis problem is a programming version of Problem 77 from projecteuler.netIt 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 · 755 阅读 · 0 评论 -
Merge two sorted linked lists
Problem StatementThis challenge is part of a tutorial track by MyCodeSchoolYou’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 · 630 阅读 · 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 · 397 阅读 · 0 评论 -
Reverse a linked list
Problem StatementThis 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 · 467 阅读 · 0 评论 -
Maximizing XOR 这么顺利地解决。。。
Problem Statement给定两个整数:L 和 R∀ L ≤ A ≤ B ≤ R, 找出 A xor B 的最大值。输入格式第一行为 L 第二行为 R数据范围1 ≤ L ≤ R ≤ 103输出格式输出最大的异或和样例输入110样例输出15样例解释当B = 10, A =原创 2015-05-03 08:14:53 · 564 阅读 · 0 评论 -
Anagram
Problem StatementSid 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 · 580 阅读 · 0 评论 -
交替的字符
Problem StatementShashank非常喜欢字符串,特别是那些连续字符都是不一样的字符串。比如:他喜欢ABABA,但他不喜欢ABAA。给定一个字符串,该字符串只可能由字母A和B组成。Shashank想把这个字符串转变成他喜欢的字符串,在转变的过程中,他允许删除字符串中的某些字符。 你的任务就是找出最少需要删除几个字符,才能把给定的字符串转变成Shashank喜欢的原创 2015-05-03 08:57:05 · 572 阅读 · 0 评论 -
Make it Anagram
Problem StatementChinese VersionRussian VersionAlice 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 · 443 阅读 · 0 评论 -
Fibonacci Modified 大整数
Problem StatementA 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 + TnSo, i原创 2015-05-07 23:14:11 · 888 阅读 · 0 评论