数论
文章平均质量分 73
旻宇
New Acmer
展开
-
Uva 10168 - Summation of Four Primes
URL: Euler proved in one of his classic theorems that prime numbers are infinite in number. But can every number be expressed as a summation of four positive primes? I don’t know the answer. May b原创 2014-07-26 21:51:34 · 579 阅读 · 0 评论 -
Uva10533 - Digit Primes
A prime number is a positive number, which is divisible by exactly two different integers. A digit prime is a prime number whose sum of digits is also prime. For example the prime number 41 is a dig原创 2014-07-26 22:25:02 · 622 阅读 · 0 评论 -
poj 2262 Goldbach's Conjecture 素数筛
Description In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Every even number greater than 4 can be written原创 2014-07-26 21:16:03 · 525 阅读 · 0 评论 -
Leetcode Majority Element系列 摩尔投票法
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 挺有意思的摩尔投票法 public: vector majorityElement(vec原创 2015-08-01 18:59:36 · 1964 阅读 · 0 评论