![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
枚举
文章平均质量分 84
mrcoderrev
C
展开
-
uva 725 Division
枚举啊,同志们#include #include #include #include using namespace std;int book[20];int main(){ int n, t=0; while(cin>>n,n!=0) { if(t!=0) {原创 2016-05-19 18:34:19 · 269 阅读 · 0 评论 -
poj 3295 Tautology (模拟栈操作+状压)
WFF 'N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these原创 2017-04-13 16:21:11 · 138 阅读 · 0 评论 -
ZOJ 3715 (贪心)
At the beginning of the semester in kindergarten, the n little kids (indexed from 1 to n, for convenience) in class need to elect their new leader.The ith kid will vote for his best friend fi (where原创 2017-04-29 20:06:59 · 212 阅读 · 0 评论 -
Wannafly模拟赛4 B Distance(枚举 最大曼哈顿距离模板)
题目描述FST作为小朋友,经常会遇到和距离有关的问题,但是他已经厌倦了曼哈顿距离和欧几里德距离,所以FST就定义了一种FST距离。这种距离并不用于空间或平面中,而运用于FST发明的一些神奇的算法中(唔... ...)。设i号元素的特征值为Ai,则i和j的FST距离是 |i2 - j2|+|Ai2 - Aj2|。为了实现某新的数据结构,FST想在一大堆元素中找出距离最大的一对原创 2017-10-21 10:31:38 · 590 阅读 · 0 评论 -
hdu 6184 Counting Stars(求无向图的三元环数量)
Counting StarsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 309 Accepted Submission(s): 82Problem DescriptionLittle A is an原创 2017-09-03 22:00:55 · 1122 阅读 · 0 评论 -
hiho 大礼堂地毯(strstr 查找函数)
题目1 : 大礼堂地毯时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi的学校大礼堂的地毯是由很多块N × M大小的基本地毯拼接而成的。例如由2×3的基本地毯ABCABD拼接而成的大礼堂整片地毯如下: ... ABCABCABCABCAB ABDABDABDA原创 2017-07-23 17:35:17 · 476 阅读 · 0 评论 -
POJ 2785 4 Values whose Sum is 0(折半枚举)
4 Values whose Sum is 0Time Limit: 15000MS Memory Limit: 228000KTotal Submissions: 20123 Accepted: 6017Case Time Limit: 5000MSDescriptionThe SUM problem can原创 2016-10-25 19:41:36 · 180 阅读 · 0 评论 -
POJ 2594 Sumsets(时间复杂度+搜索)
SumsetsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10648 Accepted: 2906DescriptionGiven S, a set of integers, find the largest d such that a + b + c原创 2016-10-25 10:22:09 · 321 阅读 · 0 评论 -
hdu 2572
终曲Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1823 Accepted Submission(s): 554Problem Description最后的挑战终于到了!站在yifenfei和M原创 2016-07-30 08:30:30 · 311 阅读 · 0 评论 -
UVA - 10976 Fractions Again?!
这题虽然说是枚举,但没有一定的数学功底的话可能要想很长时间#include using namespace std;const int N=10000;int dpx[N], dpy[N];int main(){ int k; while(cin>>k) { int scnt=0; for(int i原创 2016-05-19 19:03:14 · 245 阅读 · 0 评论 -
UVA - 11059 Maximum Product
这题用枚举最简单啦,如果想用背包的话情况就会变得很复杂,毕竟加法不同于乘法#include using namespace std;const int N = 25;typedef long long LL;int book[N];LL judge(int x, int y);int main(){ int n, ncase=0;; wh原创 2016-05-19 18:46:23 · 264 阅读 · 0 评论 -
light oj 1191 - Bar Codes(记忆化搜索解决 DP问题)
1191 - Bar Codes PDF (English)StatisticsForumTime Limit: 0.5 second(s)Memory Limit: 32 MBA bar-code symbol consists of alternating dark and light bars原创 2017-04-06 15:19:26 · 213 阅读 · 0 评论