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

bytedance

parent bc88fa1e
No related branches found
No related tags found
No related merge requests found
/* Bytedance
* 笔试 q1
* 有1 4 16 64这几种硬币,凑出N元钱,最少用多少个硬币?N<=1024
*
*/
#include <iostream>
#include <utility>
......
/* 字节跳动
* 笔试q2
* 转换字符串。对于字符串中的AAA,去掉一个变成AA
* 对于字符串中的AABB,去掉一个变成AAB
* 从左往右操作。
*
* 输入:第一行N
* 接下来有N行,每行一个待处理字符串
*
* 输出:处理结果
*/
#include <iostream>
#include <string>
......
/*字节跳动
*笔试3
*
* 有M个人围成一个圈,你给他们发礼物。如果有一个人的分数比相邻的某一个人分数高,那他得到的礼物数量必须大于相邻的那个人。已知每个人的分数,求至少需要准备多少礼物?
*
* 输入:
* 第一行:N。
* 下面的内容重复N次 {
* 一行:M,代表下一行的人数
* 一行:空格分割的M个整数的数组,表示每个人的分数
* }
*
*/
#include <iostream>
#include <string>
......
/*自解跳动笔试4 当时我没写玩,正确的做法是二分查找。
*
*
* 已知有N根长度不一的绳子和他们的长度,我现在需要M根长度相等的绳子。你只能切断绳子,不能粘在一起。
* 我想知道我的这M根绳子的最大长度是多少?
*
* 输入:
* N M
* N个整数,表示每个绳子的长度,空格分割
* N M
* N个整数,表示每个绳子的长度,空格分割
* N M
* N个整数,表示每个绳子的长度,空格分割
* .........................
*
*/
/*
*
......
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