随笔分类 - 竞赛
摘要:题目链接 文件类型是 64 位 ELF。 开了 NX 保护。 用 IDA64 查看一下: 可以看到 print_name 最多只能溢出 2 个字节。 也就是说只能覆盖 rbp 的最低 2 个字节。 此时需要使用栈迁移的技巧。 此题相对容易,因为已经给出了 buf 的地址,我们只需要把 main 函数
阅读全文
摘要:题目链接 checksec 看一下: 没有保护。 IDA 反汇编看一下: 可以栈溢出。 没有 system 函数。 gdb vmmap 看一下栈是可执行的: 可以把 shellcode 放在返回地址之后,然后把返回地址指向 shellcode。 exp 如下: from pwn import * i
阅读全文
摘要:题目链接 文件类型是 64 位 ELF。 开了 NX 保护。 用 IDA64 查看一下: 可以看到可以栈溢出。 objdump -d stack3 | grep 'plt' 可以看到有 system 函数,地址为 0x400600。 ROPgadget --binary stack3 --strin
阅读全文
摘要:比赛链接: "kick start Round A 2020" A. Allocation "题目链接" 题意 给出 $N$ 栋房子的价格,第 $i$ 栋房子的价格为 $A_i$,你有 $B$ 美元,问最多可以买多少栋房子? 思路 典型的贪心问题,将所有的房子按价格从低到高排序后选取即可。 代码 c
阅读全文
摘要:题目链接: "1121 Damn Single (25 分)" "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are al
阅读全文
摘要:题目链接: "HDU 1269" Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N 输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。 Output
阅读全文
摘要:题目链接: "1154 Vertex Coloring" A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edg
阅读全文
摘要:题目链接: "1155 Heap Paths (30 分)" In computer science, a heap is a specialized tree based data structure that satisfies the heap property: if P is a pare
阅读全文
摘要:题目链接: "HDU 2063" Problem Description RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把
阅读全文
摘要:题目链接: "HDU 2512" Problem Description 因为长期钻研算法, 无暇顾及个人问题,BUAA ACM/ICPC 训练小组的帅哥们大部分都是单身。某天,他们在机房商量一个绝妙的计划"一卡通大冒险"。这个计划是由wf最先提出来的,计划的内容是,把自己的联系方式写在校园一卡通的
阅读全文
摘要:题目链接: "1067 Sort with Swap(0, i) (25 分)" 题意 给定长度为 $n$ 的排列,如果每次只能把某个数和第 $0$ 个数交换,那么要使排列是升序的最少需要交换几次。 思路 贪心 由于是排列,所以排序后第 $i$ 个位置上的数就是 $i$。所以当 $a[0] \neq
阅读全文
摘要:题目链接: "HDU 4513" Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1
阅读全文
摘要:题目链接: "POJ 3974" Description Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple
阅读全文
摘要:最长回文子串 回文串 就是原串和反转字符串相同的字符串。比如 ,`acca`。前一个是奇数长度的回文串,后一个是偶数长度的回文串。 最长回文子串 就是一个字符串的所有子串中,是回文串且长度最长的子串。 Brute Force 做法 枚举所有子串,判断是否是回文串,然后寻找最大长度。寻找所有子串要两重
阅读全文
摘要:题目链接: "LightOJ 1418" Problem Description I have bought an island where I want to plant trees in rows and columns. So, the trees will form a rectangula
阅读全文
摘要:题目链接: "POJ 1410" Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line
阅读全文
摘要:题目链接: "HDU 1028" Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "Th
阅读全文
摘要:题目链接: "POJ 1860" Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular cu
阅读全文
摘要:题目链接: "HDU 5183" Problem Description When given an array $(a_0,a_1,a_2,⋯a_{n−1})$ and an integer $K$, you are expected to judge whether there is a pai
阅读全文
摘要:题目链接: "POJ 2287" Description Here is a famous story in Chinese history. That was about 2300 years ago. General Tian Ji was a high official in the coun
阅读全文

浙公网安备 33010602011771号