上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 57 下一页
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5163题目意思:有 n 个车站,给出相邻两个车站的距离,即车站 i 和车站 i+1 的距离为 di (1≤ i y(ans = 2*sum[n] + sum[y] - sum[st];); 当 x > ... 阅读全文
posted @ 2015-01-25 12:28 windysai 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5154题目意思:有 n 门 processes(编号依次为1,2,...,n),然后给出 m 种关系: a,b。表示 process b 要在 process a 之前完成。问经过 m 种关系之后,有没有... 阅读全文
posted @ 2015-01-10 23:29 windysai 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/500/B题目意思:给出一个含有 n 个数的排列:p1, p2, ..., pn-1, pn。紧接着是一个 n * n 的矩阵A,当且仅当 Aij = 1 时,pi 与 pj 可以交换数值。现在问如何交换数值... 阅读全文
posted @ 2015-01-03 16:13 windysai 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002题目意思:就是大整数加法。 两年几前做的,纯粹是整理下来的。 1 #include 2 #include 3 4 #define max 1010 5 char a[max], b[ma... 阅读全文
posted @ 2015-01-02 21:38 windysai 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2389题目意思:就是大整数乘法。 题目中说每个整数不超过 40 位,是错的!!!要开大点,这里我开到100. 其实大整数乘法还是第一次写 = =.......大整数加法写得比较多。百练也有一条是大整数乘法,链接如下:http://b... 阅读全文
posted @ 2015-01-02 21:33 windysai 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1014题目意思:给出 STEP 和 MOD,然后根据这个公式:seed(x+1) = [seed(x) + STEP] % MOD,问是否在一个周期里可以产生 0 ~ mod-1 的数。可以的话输出 "G... 阅读全文
posted @ 2015-01-02 16:30 windysai 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1102题目意思:就是根据给出的格式 s 和 数字 n,输出数值 n 的 LCD 显示。数值 n 的每个数字要占据 s + 2 列 和 2s + 3 行。数字和数字之间要有一个空格。数值与数值之间有一个空行。 首先对于LCD 的 7 个... 阅读全文
posted @ 2015-01-02 00:02 windysai 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/500/A题目意思:给出 n-1 个 cell,每个 cell 有一个值 ai,表示在这个编号为 i 的 cell,能到达i + ai 的cell,但不能反过来,即从 i+ai 到达i 这个 cell。问从第... 阅读全文
posted @ 2014-12-31 23:50 windysai 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5150题目意思:就是直接求素数。 不过 n = 1,也属于答案范围!!只能说,一失足成千古恨啊~~~~~ 1 #include 2 #include 3 #include 4 #include... 阅读全文
posted @ 2014-12-27 21:22 windysai 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/499/A题目意思:有两种按钮:1、如果当前观看的时间是 t,player 可以自动处理下一分钟,姑且理解为跳到t+1; 2、直接跳过 x 分钟,如果player在第 t 分钟,则可以跳到 t+x 分钟。问恰... 阅读全文
posted @ 2014-12-26 23:55 windysai 阅读(326) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 57 下一页