![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_暴力穷举
LzyRapX
Just For Fun .
展开
-
HDU 1339 A Simple Task(暴力枚举)
A Simple TaskTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4640 Accepted Submission(s): 2554Problem DescriptionGiven a positive i原创 2016-05-04 13:31:41 · 786 阅读 · 0 评论 -
Problem 17 Number letter counts (统计字母)
Number letter countsProblem 17If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.If all the numbers原创 2016-10-27 13:24:07 · 708 阅读 · 0 评论 -
Problem 19 Counting Sundays (计算星期天)
Counting SundaysProblem 19You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September,April, June a原创 2016-10-27 21:55:19 · 567 阅读 · 0 评论 -
Problem 27 Quadratic primes (暴力枚举)
Quadratic primesProblem 27Euler discovered the remarkable quadratic formula:n2+n+41n2+n+41It turns out that the formula will produce 40 primes for the consecutive integer values 0≤n≤39原创 2016-10-29 01:28:24 · 462 阅读 · 0 评论 -
Problem 30 Digit fifth powers (暴力枚举)
Digit fifth powersProblem 30Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:1634 = 14 + 64 + 34 + 448208 = 84 + 24 + 04 + 84原创 2016-10-29 11:15:14 · 379 阅读 · 0 评论 -
Problem 32 Pandigital products (暴力+set)
Pandigital productsProblem 32We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through原创 2016-10-29 12:43:59 · 557 阅读 · 0 评论 -
Problem 33 Digit cancelling fractions (暴力set+pair)
Digit cancelling fractionsProblem 33The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98 = 4/8, which原创 2016-10-29 20:59:38 · 671 阅读 · 0 评论 -
Problem 34 Digit factorials (暴力)
Digit factorialsProblem 34145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of their digits.Note: as原创 2016-10-29 22:08:44 · 405 阅读 · 0 评论 -
Problem 40 Champernowne's constant (暴力vector)
Champernowne's constantProblem 40An irrational decimal fraction is created by concatenating the positive integers:0.123456789101112131415161718192021...It can be seen that the 12th dig原创 2016-10-30 14:22:03 · 460 阅读 · 0 评论 -
Problem 41 Pandigital prime (暴力set+vector)
Pandigital primeProblem 41We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also pri原创 2016-10-30 14:38:16 · 410 阅读 · 0 评论 -
Problem 43 Sub-string divisibility (暴力...)
Sub-string divisibilityProblem 43The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interestin原创 2016-10-30 15:51:19 · 601 阅读 · 0 评论 -
Problem 44 Pentagon numbers (暴力...)
Pentagon numbersProblem 44Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are:1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...It can be see原创 2016-10-30 16:23:53 · 607 阅读 · 0 评论 -
Problem 45 Triangular, pentagonal, and hexagonal (暴力)
Triangular, pentagonal, and hexagonalProblem 45Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:TriangleTn=n(n+1)/21, 3, 6, 10, 15, .原创 2016-10-30 20:18:50 · 380 阅读 · 0 评论 -
Problem 46 Goldbach's other conjecture (暴力...)
Goldbach's other conjectureProblem 46It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.9 = 7 + 2×1215 = 7 +原创 2016-10-31 19:51:37 · 463 阅读 · 0 评论 -
PE 145 How many reversible numbers are there below one-billion? (暴力)
How many reversible numbers are there below one-billion?Problem 145Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits. For原创 2016-12-27 19:51:39 · 541 阅读 · 0 评论 -
PE 206 Concealed Square (暴力)
Concealed SquareProblem 206Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0,where each “_” is a single digit.题解:被遮挡的平方数找出唯一一个其平方形如1_2_3_原创 2017-01-08 20:05:18 · 476 阅读 · 0 评论 -
PE 118-119 (dfs+暴力)
PE 118题解:next_permutation()+dfs就可以了代码:#includeusing namespace std;typedef long long ll;int ans=0;vectorv;int isprime(ll n){ if(n==1)return 0; for(ll i=2;i*i<=n;i++){ if(n%i==0)return 0原创 2017-02-17 23:10:16 · 557 阅读 · 0 评论 -
Problem 14 Longest Collatz sequence(暴力)
Longest Collatz sequenceProblem 14The following iterative sequence is defined for the set of positive integers:n → n/2 (n is even)n → 3n + 1 (n is odd)Using the rule above and starti原创 2016-10-26 22:30:19 · 941 阅读 · 0 评论 -
Problem 12 Highly divisible triangular number (分解因子)
Highly divisible triangular numberProblem 12The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.原创 2016-10-26 21:29:46 · 504 阅读 · 0 评论 -
HDU 1395 2^x mod n = 1(暴力枚举)
2^x mod n = 1Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15721 Accepted Submission(s): 4870Problem DescriptionGive a number n原创 2016-05-04 19:49:12 · 526 阅读 · 0 评论 -
HDU 1405 The Last Practice(暴力枚举)
The Last PracticeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9522 Accepted Submission(s): 2034Problem DescriptionTomorrow is原创 2016-05-05 10:45:44 · 864 阅读 · 0 评论 -
HDU 1406 完数(枚举+打表)
完数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25482 Accepted Submission(s): 9386Problem Description完数的定义:如果一个大于1的正整数的所有因子之和等于原创 2016-05-05 10:52:55 · 537 阅读 · 0 评论 -
HDU 1407 测试你是否和LTC水平一样高 (暴力)
测试你是否和LTC水平一样高Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16418 Accepted Submission(s): 5405Problem Description大家提到LTC都佩服的不行,原创 2016-05-05 11:05:30 · 578 阅读 · 0 评论 -
如何暴力解决弱N皇后问题(比较sb的做法)
暴力嘛,大概还有一个说法就是枚举,穷举的意思了。穷举, 顾名思义为遍历一个集合。这个集合的意义很广, 在解决不同的问题过程中, 这个需要穷举的集合也不尽相同。 比如,我们可以穷举一遍一个给定的整数数组,寻找其中最大的一个; 我们可以穷举问题域,找出满足特定条件的项;等等。那么,下面我想写一下如何利用穷举去解决比较弱的n(n在N X N格的国际象棋上摆放八个皇后,使其不能互相攻击,即原创 2016-05-29 13:42:49 · 996 阅读 · 0 评论 -
POJ画家问题
DescriptionThere is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks are yellow. Bob is a painter and he wants to paint all the bricks yellow. But there i原创 2016-02-28 00:00:15 · 2554 阅读 · 0 评论 -
HDU 5778 BestCoder Round #85 abs (暴力枚举)
absTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 868 Accepted Submission(s): 309Problem DescriptionGiven a number x, ask positi原创 2016-07-31 14:04:07 · 1021 阅读 · 0 评论 -
HDU 5461 2015沈阳网络赛 Largest Point (暴力)
Largest PointTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2100 Accepted Submission(s): 800Problem DescriptionGiven the sequence原创 2016-09-16 12:48:09 · 1031 阅读 · 0 评论 -
hihocoder #1227 : The Cats' Feeding Spots 北京赛区(2015)网络赛 (暴力枚举)
#1227 : The Cats' Feeding Spots时间限制:1000ms单点时限:1000ms内存限制:256MB描述In Yan Yuan, the Peking University campus, there are many homeless cats. They all live happy lives becaus原创 2016-09-23 20:39:50 · 535 阅读 · 0 评论 -
HDU 4007 Dave (暴力枚举)
DaveTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3944 Accepted Submission(s): 1327Problem DescriptionRecently, Dave is boring, s原创 2016-11-02 22:47:29 · 592 阅读 · 0 评论 -
HDU 5908 Abelian Period (暴力+map)
Abelian PeriodTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 734 Accepted Submission(s): 295Problem DescriptionLet S be a原创 2016-10-14 19:21:51 · 733 阅读 · 0 评论 -
Problem 4 Largest palindrome product (暴力枚举)
Largest palindrome productProblem 4A 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 p原创 2016-10-25 22:22:55 · 546 阅读 · 0 评论 -
Problem 8 Largest product in a series (暴力)
Largest product in a seriesProblem 8The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.73167176531330624919225119674426574742355349原创 2016-10-26 13:53:56 · 578 阅读 · 0 评论 -
Problem 9 Special Pythagorean triplet (毕达哥拉斯三元数组...)
Special Pythagorean tripletProblem 9A Pythagorean triplet is a set of three natural numbers, a b c, for which,a2 + b2 = c2For example, 32 + 42 = 9 + 16 = 25 = 52.There exists exact原创 2016-10-26 14:02:36 · 797 阅读 · 0 评论 -
Problem 11 Largest product in a grid (暴力)
Largest product in a gridProblem 11In the 20×20 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 0849 49原创 2016-10-26 18:49:12 · 900 阅读 · 0 评论 -
#9 (Div. 2 Only) B. Running Student (枚举)
题目链接:点击打开链接http://codeforces.com/contest/9/problem/B题意:给你车的速度,人跑步的速度,和站点的坐标,以及学校的坐标。问你从哪个站点下车可以最快到达学校?题解:直接枚举下车的站点。AC代码:#include using namespace std;double dis(double x1,double原创 2017-04-27 13:17:07 · 702 阅读 · 0 评论