上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 40 下一页

2013年10月22日

介绍四种GCC内置位运算函数

摘要: int __builtin_ffs (unsigned int x)返回x的最后一位1的是从后向前第几位,比如7368(1110011001000)返回4。int __builtin_clz (unsigned int x)返回前导的0的个数。int __builtin_ctz (unsigned int x)返回后面的0个个数,和__builtin_clz相对。int __builtin_popcount (unsigned int x)返回二进制表示中1的个数。int __builtin_parity (unsigned int x)返回x的奇偶校验位,也就是x的1的个数模2的结果。此外, 阅读全文

posted @ 2013-10-22 09:52 电子幼体 阅读(182) 评论(0) 推荐(0)

2013年10月13日

SGU 103 Traffic Lights 经典最短路

摘要: -----------------103. Traffic LightsTime limit per test: 0.5 second(s)Memory limit: 4096 kilobytesinput: standardoutput: standardIn the city of Dingilville the traffic is arranged in an unusual way. There are junctions and roads connecting the junctions. There is at most one road between any two dif 阅读全文

posted @ 2013-10-13 18:22 电子幼体 阅读(269) 评论(0) 推荐(0)

SGU 104 Little shop of flowers 经典DP

摘要: 104. Little shop of flowerstime limit per test: 0.5 sec.memory limit per test: 4096 KBPROBLEMYou want to arrange the window of your flower shop in a most pleasant way. You haveFbunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued onto t 阅读全文

posted @ 2013-10-13 18:19 电子幼体 阅读(171) 评论(0) 推荐(0)

2013年10月11日

SGU 101 Domino 欧拉通路/回路

摘要: 101. Dominotime limit per test: 0.5 sec.memory limit per test: 4096 KBDominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The blocks usually are called bones, dominoes, or pieces and sometimes men, stones, or eve 阅读全文

posted @ 2013-10-11 21:30 电子幼体 阅读(167) 评论(0) 推荐(0)

2013年10月10日

叉姐的魔法训练(第十四课)---- 我不高兴

摘要: 挖坑------------------------------------------------------------------------------------------------------------ 阅读全文

posted @ 2013-10-10 21:08 电子幼体 阅读(133) 评论(0) 推荐(0)

SPOJ 1811 Longest Common Substring SAM

摘要: -----------------A string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is a consecutive sequence of characters occurrences at least once in a string.Now your task is simple, for two given strings, fin 阅读全文

posted @ 2013-10-10 14:00 电子幼体 阅读(157) 评论(0) 推荐(0)

HDU 4622 Reincarnation SAM

摘要: -------------ReincarnationTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1439Accepted Submission(s): 503Problem DescriptionNow you are back,and have a task to do:Given you a string s consist of lower-case English letters only,denote f(s) as the n 阅读全文

posted @ 2013-10-10 13:20 电子幼体 阅读(125) 评论(0) 推荐(0)

2013年10月9日

叉姐的魔法训练(第十三课)---- 无法成为勇者的我,无可奈何决定去打工

摘要: 挖坑------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 阅读全文

posted @ 2013-10-09 20:22 电子幼体 阅读(149) 评论(0) 推荐(0)

2013年10月8日

叉姐的魔法训练(第十二课)---- 想不出名字了呜

摘要: 挖坑--------------------------一 序列调整hdu 3434 Sequence Adjustment题目大意:给你含有n个数的序列,每次你可以选一个子序列将上面所有的数字加1或者减1,目标是把所有数字变成相同的,问最少步数,和那个相同的数字有多少种可能。对序列中的相邻元素做差,假设元素i之前的序列已经相等,此时序列值为sum。#include #include #include #include using namespace std;const int maxn=1111111;typedef long long LL;int a[maxn];LL b[maxn],p 阅读全文

posted @ 2013-10-08 20:01 电子幼体 阅读(210) 评论(0) 推荐(0)

叉姐的魔法训练(第十一课)---- 胜利大逃亡

摘要: 一 状压搜索SGU 527 Explode 'Em All枚举攻击哪一行,将未被消灭的列记录下来,若小于行数,则记录下答案。#include #include #include #include using namespace std;const int maxs=1=col[set]&&row>n>>m; for (int i=0;i>map[i][j]; if (map[i][j]=='*') bit[i]|=(1>1)]+(i&1); dfs(0,0,0); cout<<ans<<end 阅读全文

posted @ 2013-10-08 19:59 电子幼体 阅读(197) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 40 下一页

导航