Sum square difference
Problem 6
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ....
分类:
其他好文 时间:
2014-05-23 02:22:57
阅读次数:
193
数学推导题,f(n)=n*(n+1)*(n+2)/6
推导思路如下:
#include"cstdio"
#include"cstring"
#include"cmath"
#include"cstdlib"
#include"iostream"
#include"algorithm"
#include"queue"
using namespace std;
int main()...
分类:
其他好文 时间:
2014-05-23 02:13:15
阅读次数:
269
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly di...
分类:
其他好文 时间:
2014-05-23 01:51:13
阅读次数:
261
What Is Your Grade?
Problem Description
“Point, point, life of student!”
This is a ballad(歌谣)well known in colleges, and you must care about your...
分类:
其他好文 时间:
2014-05-23 00:59:22
阅读次数:
375
Problem 2: Even Fibonacci numbers
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2,...
分类:
其他好文 时间:
2014-05-22 23:29:44
阅读次数:
435
题目:http://poj.org/problem?id=3261
仍然是后缀数组的典型应用----后缀数组+lcp+二分
做的蛮顺的,1A
但是大部分时间是在调试代码,因为模板的全局变量用混了,而自己又忘了,,,等西安邀请赛还有四省赛结束之后,该冷静反思下尝试拜托模板了
错误 :1、k用错,题目的k和模板的k用混;
2、还是二分的C()函数,这个其实跟前一篇《poj
1...
分类:
其他好文 时间:
2014-05-22 23:14:51
阅读次数:
361
Problem 4: Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest pal...
分类:
其他好文 时间:
2014-05-22 18:48:46
阅读次数:
355
Problem 3: Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
求出最大素因子
我的python代码如下:
又不懂的,或者更好的可以留言,大家互相...
分类:
其他好文 时间:
2014-05-22 18:40:17
阅读次数:
198
题目:
Problem Description
Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).
Input
输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统...
分类:
其他好文 时间:
2014-05-22 17:31:06
阅读次数:
307
题目:http://poj.org/problem?id=1226
http://acm.hdu.edu.cn/showproblem.php?pid=1238
其实用hash+lcp可能也可以,甚至可能写起来更快,不过我没试,我最近在练习后缀数组,所以来练手
后缀数组的典型用法之一----------------后缀数组+lcp+二分
思路:1、首先将所有的字符串每读...
分类:
其他好文 时间:
2014-05-22 17:14:08
阅读次数:
289