Skip to content
Snippets Groups Projects
Verified Commit 69737e47 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

tx

parent 758d8bdf
No related branches found
No related tags found
No related merge requests found
/*腾讯云计算岗位垃圾笔试题1
*
* 给定一个01组成的字符串,我可以采取一个操作:消去相邻的一对01. 我想知道不断的消去一直到不能消去为止,我最终得到的字符串长度是多少?
*
* 例如: 1000101001 => 10001010 => 001010 => 0010 => 00, 答案是2
*
* 输入:
* 第一行N,字符串长度
* 第二行就是那个字符串。
*/
#include "rlib.min.hpp"
#include <algorithm>
......
/*tx2
*
* 我现在有N种面值的硬币。
* 我现在去菜市场,希望带尽可能少的这些硬币,同时又必须能够凑出[1, M]范围内的任何一个的整数面值。
* 我最少带多少硬币?
*
* 输入:
* M N
* 空格分割的N个整数,表示面值数。
*
* N<1024, M<10^10
*/
#include "rlib.min.hpp"
#include <algorithm>
......
/* tx
*
* 我需要通过一个怪兽谷,这里面依次有N个怪兽
* 每一个怪兽都可以用一定的金币来收买他,这样她就会为你护航。
* 你必须保证,在任何时候,保护你的怪兽的总武力值大于你遇到的这一个怪兽的武力值。
* 求你要通过这个怪兽谷,需要的最少金币数。
*
* 输入:
* N
* N个元素的数组,表示每一个怪兽的武力值。
* N个元素的数组,表示每一个怪兽的价格。
*
* N<1024
*
*/
#include "rlib.min.hpp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment