摘要: #if 要求判断条件为常量表达式,不得包含变量。且返回值为整数。 与 #else #elif #endif 使用。 和 if else 的用法类似。 例如: 1 #include <stdio.h> 2 3 #define M 100 4 5 int main(){ 6 7 #if M==100 8 阅读全文
posted @ 2020-01-28 20:07 Arrokoth 阅读(612) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/501/B https://vjudge.net/problem/CodeForces-501B#author=fishdog ^▽^神秘的三角洲里还有一个传说中的谜题等你来解开! 三角洲里的小学生小明是个小天才,知天 阅读全文
posted @ 2020-01-19 12:34 Arrokoth 阅读(165) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/problem/UVA-10474 主要是练习lower_bound 的应用:返回一个迭代器,指向键值为k的第一个元素。而且也很方便的找出排序后需查找的元素的位置。 cin和c里面的输入输出用的话好像不太好,但是不想改了。 1 #include <bits/st 阅读全文
posted @ 2020-01-19 12:04 Arrokoth 阅读(131) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1088 题目描述: Glory非常喜欢玩滑滑梯游戏,下面给出了一个n,m的滑道,其中的数字表示滑道的高度。Glory可以从一个点出发向下滑行,每次只能滑行到相邻的位置(上下左右)中高度严格低于当前高度的地方,不能重复划行已经滑行过的地方,但他希望 阅读全文
posted @ 2020-01-15 10:56 Arrokoth 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3414 题目描述: 给你两个容器,分别能装下A升水和B升水,并且可以进行以下操作 FILL(i) 将第i个容器从水龙头里装满(1 ≤ i ≤ 2); DROP(i) 将第i个容器抽干 POUR(i,j) 将第i个容器里的水倒入第j个容器(这次操作 阅读全文
posted @ 2020-01-14 22:25 Arrokoth 阅读(170) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1029 这道题最容易想到的写法就是用一个数组来记录每个数字出现的次数。但是,如果数的范围大的话就不太友好了,容易超时。 然后一开始做的时候也是很纠结。然后就了解到了这个写法~ 真的很厉害!(题解思路来自灯神~) 这 阅读全文
posted @ 2020-01-12 23:01 Arrokoth 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 写了好久orz。。。 http://acm.hdu.edu.cn/showproblem.php?pid=1022 姑且贴个题目吧。 Train Problem I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K 阅读全文
posted @ 2020-01-11 23:31 Arrokoth 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1263 第一题就这么的 令 (rang) 人 难 (tu) 忘 (xue)。。。 //有错误请您大力指出,谢谢~ 主要是map的嵌套,定义了一个map < string, map < string, int > > 阅读全文
posted @ 2020-01-11 23:16 Arrokoth 阅读(237) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2084 https://vjudge.net/contest/342215#problem/D 题目描述: 数塔 Time Limit: 1000/1000 MS (Java/Others) Memory Limi 阅读全文
posted @ 2019-12-17 16:55 Arrokoth 阅读(222) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6480 https://vjudge.net/contest/342215#problem/G 解题思路: 其实我就是想水个糖,keke 对于这道题,我想到的有两种写法。一种是用数列求和公式,另一种就是用动态规划了 阅读全文
posted @ 2019-12-17 10:42 Arrokoth 阅读(194) 评论(0) 推荐(0) 编辑