随笔分类 -  算法

上一页 1 ··· 3 4 5 6 7
摘要:紫书第六章 例题+习题 题解代码及总结 阅读全文
posted @ 2020-04-07 22:29 StreamAzure 阅读(200) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-04-03 23:22 StreamAzure 阅读(379) 评论(0) 推荐(0)
摘要:string.find() 用于搜索子串在母串中的位置,如果找到,返回子串首个元素的下标;如果找不到,返回s.npos map.count() map.count(Key),在map中检索索引Key,若其存在,返回true,否则返回false 注意仅能检索索引,不能检索值 C++ include i 阅读全文
posted @ 2020-03-31 18:09 StreamAzure 阅读(150) 评论(0) 推荐(0)
摘要:CF1324A Yet Another Tetris Problem 长度为n的数组a中有一组数,可以任意使其中一项+2,问能否使a中所有项的值相同。 感觉div.3的题目更多地在考简化问题的能力……比如原题目以俄罗斯方块作背景,让我想到的是能不能消除所有方块,导致代码很难写。但如果像上述一样简化题 阅读全文
posted @ 2020-03-29 00:03 StreamAzure 阅读(115) 评论(0) 推荐(0)
摘要:"大吉大利" 给定$n$个整数,依次为$a_1,a_2,...,a_n。$ 求$\sum_{i=1}^n\sum_{j=1}^n(a_i\&a_j)$。$\&$是二进制的与运算符 容易想到二重循环 C++ include include include include using namespace 阅读全文
posted @ 2020-03-27 23:37 StreamAzure 阅读(153) 评论(0) 推荐(0)
摘要:"CF1328A Divisibility Problem" 输入a,b,求a自增的次数,使得最终的a满足a%b==0 第一反应:for循环直到满足条件为止,然后果不其然TLE。说实话A题都是很弱智的,第一反应往往都会T,稍微思考一下就可以了…… 先判断$a \% b==0$,再考虑详细情况:若$a 阅读全文
posted @ 2020-03-27 17:06 StreamAzure 阅读(169) 评论(0) 推荐(0)
摘要:用更高级的方法上分 阅读全文
posted @ 2020-03-27 04:26 StreamAzure 阅读(5890) 评论(8) 推荐(2)
摘要:紫书第五章 例题+习题 题解代码及总结 阅读全文
posted @ 2020-03-25 18:57 StreamAzure 阅读(155) 评论(0) 推荐(0)
摘要:紫书第四章 例题+习题 题解代码及总结 阅读全文
posted @ 2020-03-25 18:34 StreamAzure 阅读(255) 评论(0) 推荐(0)
摘要:紫书第三章 例题+习题 题解代码及总结 阅读全文
posted @ 2020-03-25 02:52 StreamAzure 阅读(134) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7