🌓

阿里面试

Table of Contents 笔试 1. 笔试题1 2. 笔试题2 面试 笔试1. 笔试题1题目大意是: 给定n,从n个人中找出一个任意人数的小组,再从组里找出一个队长。求不同的小组数量。(mode10e9+7) 首先很明显可以得到公式:$$\sum_{k=1}^n{k*\binom{n}{k}=n \times \sum_{...

Read More

洛谷10-递推与递归二分

Table of Contents 1. P1192 台阶问题 思路: [2. P1025 数的划分](#2. p1025 数的划分) 思路: 方法1: 方法2: 总结: 1. P1192 台阶问题思路:有N级的台阶,你一开始在底部,每次可以向上迈最多K级台阶(最少11级),问到达第N级台阶有多少种不同方式。 这道题有一种解法是斐波那契数列,但是感...

Read More

Return-to-Libc

This is report of SEED Lab report. Return to Libc is similar to Buffer-overflow lab. But this time the core idea is trying to inject the address of library function and then let...

Read More

Shellshock

This is report of SEED Lab report. Table of Contents Task 1: Experimenting with Bash Function Task 2: Setting up CGI programs Task 3: Passing Data to Bash via Environment Vari...

Read More

洛谷9-简单数学问题

Table of Contents 1. P1088 火星人 思路: STL版本 2. P1045 麦森数 思路: 代码: 3. P1403 [AHOI2005]约数研究 思路: 代码: 4. P1017 进制转换 思路: 5. P1147 连续自然数和 思路: 1. 枚举左右端点 2. 前缀和数组 3. 解二次方程 代码: 6. P10...

Read More

洛谷8-分治算法

Table of Contents 1. P1226 【模板】快速幂||取余运算 思路: 复杂度: 代码: 2. P1010 幂次方 打表版 递归版 3. P1908 逆序对 快读模板: 归并排序: 1. P1226 【模板】快速幂||取余运算思路:这道题就是经典的快速幂。快速幂的思路是,对于a^b这种,把b写成2进制,然后把a^b分解成$ a...

Read More

洛谷7-带有技巧的搜索

Table of Contents 1. P1118 [USACO06FEB]数字三角形 思路: 暴力版: 正解版: 2. P1434 [SHOI2002]滑雪 思路: 3. P1433 吃奶酪 思路: DFS 状态压缩DP 4. P1074 靶形数独 思路: 剪枝技巧: 代码: 1. P1118 [USACO06FEB]数字三角形思路:这...

Read More

洛谷6-广度优先搜索

Table of Contents 1. P1162 填涂颜色 思路: DFS BFS 2. P1032 字串变换 思路: 双向BFS: 注意: 3. P1141 01迷宫 思路: DFS BFS 4. P1443 马的遍历 思路: 代码: 1. P1162 填涂颜色思路:这道题是经典的BFS题目,用DFS也能写,但是为了锻炼BFS我还是坚...

Read More

Dirty-Cow

this report was written by Simon Nie when finishing the SEED Lab — Dirty Cow. Table of Contents Task 1: Modify a Dummy Read-Only File 1. Create a Dummy File 2. Set Up the Memo...

Read More

Format-String

Table of Contents Preparation 1. 什么是格式化字符串 2. 栈与格式化字符串 3. 如果参数数量不匹配 4. 访问任意位置内存 5. 在内存中写一个数字 Task 1: The Vulnerable Program Task 2: Understanding the Layout of the Stack Task ...

Read More