摘要: 1.普通版 第一眼看到这个题,我脑海里就是,“我们是不是在哪里见过~”,去年大一刚学C语言的时候写过一个类似的题目,写了九重循环。。。。就像这样(在洛谷题解里看到一位兄台写的。。。。超长警告,慎重点开) #include <stdio.h> #include <cstdlib> int main() 阅读全文
posted @ 2019-02-10 21:32 czc1999 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <algorithm> #include <string.h> using namespace std; int dp[32768]; int main() { int N; int a[] = { 1,2,3 }; while (cin > 阅读全文
posted @ 2019-02-10 14:58 czc1999 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 递归最重要的两点: 1.base case(递归出口)。必须有某些基本情形,它无需递归就能解出。 2.分解 或者 分类。分解成子问题,或者每层递归分叉,也就是一个N叉树模型。 例题: 打印一个字符串的所有子串 分解:按顺序每个字母是否打印,分解。 base case: 当 pos==length,分 阅读全文
posted @ 2019-02-10 14:42 czc1999 阅读(69) 评论(0) 推荐(0) 编辑