- 博客(153)
- 收藏
- 关注
原创 UVa 10110 Light, more light (数论)
10110 - Light, more lightTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=100&page=show_problem&problem=1051The ProblemThere is man na
2013-09-30 19:44:22 1362
原创 UVa 550 Multiplying by Rotation (模拟乘法)
550 - Multiplying by RotationTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=100&page=show_problem&problem=491Warning: Not all numbers
2013-09-30 19:27:44 1257
原创 while(cin>>val)的调用机理
今天看书的时候看到代码while(cin>>val),忽然就在想这样写的合法性是如何判定的。我们都知道cin是一个流对象,而>>运算符返回左边的流对象,也就是说cin>>val返回cin,于是while(cin>>val)就变成了while(cin),问题就变成了一个流对象在判断语句中的合法性。 不管是while(cin)还是if(cin),都是合法的,为什么呢?我们自己定义一
2013-09-30 09:24:57 1058
原创 UVa 340 Master-Mind Hints (优化查找&复制数组)
学英语:1. Match (i,j) is called strong when i =j, and is called weak otherwise.当i=j时,匹配(i,j)被叫做强匹配,反之叫做弱匹配。2. Two matches (i,j) and (p,q) are called independent when i = p if and only if j = q. A set of matches is called independent when all of its members
2013-09-30 00:22:56 1962
转载 程序员眼中的酒席
大家喝的是啤酒。这时你入座了。 你给自己倒了杯可乐,这叫低配置。 你给自已倒了杯啤酒,这叫标准配置。 你给自己倒了杯茶水,这茶的颜色还跟啤酒一样,这叫木马。 你给自己倒了杯可乐,还滴了几滴醋,不仅颜色跟啤酒一样,而且不冒热气还有泡泡,这叫超级木马。 你的同事给你倒了杯白酒,这叫推荐配置。 人到齐了,酒席开始了。 你先一个人喝了一小口,这叫单元测试。 你跟旁边的人说哥
2013-09-29 09:54:25 1008
原创 UVa 10115 Automatic Editing (字符串中间替换技巧)
10115 - Automatic EditingTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1056Text-processing tools like aw
2013-09-29 09:24:02 1341
原创 UVa 644 Immediate Decodability (前缀匹配)
644 - Immediate DecodabilityTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=585An encoding of a set of sym
2013-09-29 08:41:06 1086 2
原创 UVa 10815 Andy's First Dictionary (分离字符串)
10815 - Andy's First DictionaryTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1756Andy, 8, has a dream -
2013-09-29 08:24:12 1617
原创 UVa 10878 Decode the tape (趣题)
10878 - Decode the tapeTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1819"Machines take me by su
2013-09-29 00:13:31 889
原创 UVa 409 Excuses, Excuses! (字符串匹配)
409 - Excuses, Excuses!Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=350Judge Ito is having a problem wi
2013-09-28 23:46:12 897
原创 UVa 537 Artificial Intelligence? (字符串查找与匹配)
537 - Artificial Intelligence?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=478Physics teachers in high
2013-09-28 23:21:02 1122
原创 UVa 10361 Automatic Poetry (字符串处理&两种读入方式)
10361 - Automatic PoetryTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1302“Oh God”, Lara Croft exclaim
2013-09-28 23:04:06 1075
原创 POJ 2083 Fractal (分形&分治)
Fractalhttp://poj.org/problem?id=2083Time Limit: 1000MSMemory Limit: 30000KDescriptionA fractal is an object or quantity that displays self-similarity, in a somewhat techni
2013-09-28 22:17:21 1767
原创 POJ 1833 排列 (STL)
排列http://poj.org/problem?id=1833Time Limit: 1000MSMemory Limit: 30000KDescription题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3
2013-09-28 21:40:34 2088
原创 POJ 2242 The Circumference of the Circle (计算几何)
The Circumference of the Circlehttp://poj.org/problem?id=2242Time Limit: 1000MSMemory Limit: 65536KDescriptionTo calculate the circumference of a circle seems to be an easy
2013-09-28 21:27:28 2137 1
原创 UVa 10010 Where's Waldorf? (八方向字符串匹配&模板题)
10010 - Where's Waldorf?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=951Given a m by n grid of letter
2013-09-28 18:13:02 1188
原创 UVa 401 Palindromes (字符串匹配)
401 - PalindromesTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=342A regular palindrome is a string of nu
2013-09-28 16:33:40 1281 1
原创 UVa 160 Factors and Factorials (数论)
160 - Factors and FactorialsTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=96题目点这:http://uva.onlinejudge.org/external/1
2013-09-28 15:19:26 2216
原创 UVa 10023 Square root (高精度&开平方公式)
10023 - Square rootTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=964The ProblemYou are to determinate X by given
2013-09-28 11:54:54 2174
原创 UVa 10213 How Many Pieces of Land ? (数学&欧拉公式&高精度)
10213 - How Many Pieces of Land ?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1154You are given an elliptical shape
2013-09-28 10:51:24 1409
原创 UVa 642 Word Amalgamation (查字典&字符串排序)
642 - Word AmalgamationTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=583In millions of newspapers across the United States there
2013-09-28 00:08:44 1334
原创 高精度运算类bign(支持前导零输入)
#include#include#includeusing namespace std;const int maxn = 200;struct bign{ int len, s[maxn]; bign() { memset(s, 0, sizeof(s)); len = 1; } bign(int num) { *this = num; } bign
2013-09-27 20:12:56 1185
原创 UVa 455 Periodic Strings (字符串处理)
455 - Periodic StringsTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=396A character string is said to have period k if it can be f
2013-09-27 19:51:29 2481
原创 UVa 143 Orchard Trees (数学&计算几何&枚举)
143 - Orchard TreesTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=79An Orchardist has planted an orchard in a rectang
2013-09-27 19:21:06 1413
原创 UVa 701 The Archeologists' Dilemma (数学&枚举)
701 - The Archeologists' DilemmaTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=642An archeologist seekin
2013-09-27 13:23:38 1243
原创 UVa 10004 Bicoloring (DFS&二分图)
10004 - BicoloringTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=945In 1976 the ``Four Color Map Theorem" w
2013-09-27 09:46:56 788
原创 UVa 757 / POJ 1042 / East Central North America 1999 Gone Fishing (枚举&贪心&想法题&优先队列)
757 - Gone FishingTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=698John is going on a fishing trip. He has h hours a
2013-09-27 08:17:38 1490
原创 UVa 1193 / POJ 1328 / Beijing 2002 Radar Installation (贪心&区间选点)
1193 - Radar InstallationTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=3634http://poj.org/problem?id=1328Assume the coasting
2013-09-27 07:42:20 1959
原创 UVa 729 The Hamming Distance Problem (全排列输出&小细节)
729 - The Hamming Distance ProblemTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=670
2013-09-26 22:19:40 940
原创 使用bitset实现二进制和十进制的相互转换
#include#include#include#include#include#includeusing namespace std;const int Size = 32;const double log_2 = log(2.0);char str[Size];int main(void){ int num; char *endstr; while (~scan
2013-09-26 21:36:07 9345
原创 UVa 10334 Ray Through Glasses (斐波那契&高精度)
10334 - Ray Through GlassesTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1275Suppose we put two panes of glass back-to-back. How
2013-09-26 17:03:13 1033
原创 UVa 10098 Generating Fast (全排列生成)
10098 - Generating FastTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1039Generating permutation has always been an important prob
2013-09-26 16:16:49 1183
原创 POJ 3544 Journey with Pigs (贪心&排序不等式)
Journey with Pigshttp://poj.org/problem?id=3544Time Limit: 1000MSMemory Limit: 65536KDescriptionFarmer John has a pig farm near town A. He wants to visit his friend living
2013-09-26 07:47:54 1399
原创 UVa 10706 / POJ 1019 Number Sequence (打表&O(1)算法)
10706 - Number SequenceTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1647http://poj.org/problem?id=1019
2013-09-25 21:31:40 1388
原创 UVa 10673 Play with Floor and Ceil (数论)
10673 - Play with Floor and CeilTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1614TheoremFor any tw
2013-09-25 18:24:23 864
原创 UVa 110 Meta-Loopless Sorts (递归&代码模拟&全排列)
110 - Meta-Loopless SortsTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=46Background Sorting holds an im
2013-09-25 18:13:32 1129
原创 UVa 128 Software CRC (模计算&CRC循环冗余校验码)
128 - Software CRCTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=64You work for a company which uses lot
2013-09-24 17:20:16 1193
原创 UVa 79 ClockHands (water ver.)
579 - ClockHandsTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=520The medieval interest in mechanical con
2013-09-24 13:30:50 964
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人