Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
interview-questions
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
interview-questions
Commits
758d8bdf
There was an error fetching the commit references. Please try again later.
Verified
Commit
758d8bdf
authored
6 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
bytedance
parent
bc88fa1e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
1.cc
+5
-0
5 additions, 0 deletions
1.cc
2.cc
+12
-0
12 additions, 0 deletions
2.cc
3.cc
+13
-0
13 additions, 0 deletions
3.cc
4.cc
+17
-0
17 additions, 0 deletions
4.cc
with
47 additions
and
0 deletions
1.cc
+
5
−
0
View file @
758d8bdf
/* Bytedance
* 笔试 q1
* 有1 4 16 64这几种硬币,凑出N元钱,最少用多少个硬币?N<=1024
*
*/
#include
<iostream>
#include
<utility>
...
...
This diff is collapsed.
Click to expand it.
2.cc
+
12
−
0
View file @
758d8bdf
/* 字节跳动
* 笔试q2
* 转换字符串。对于字符串中的AAA,去掉一个变成AA
* 对于字符串中的AABB,去掉一个变成AAB
* 从左往右操作。
*
* 输入:第一行N
* 接下来有N行,每行一个待处理字符串
*
* 输出:处理结果
*/
#include
<iostream>
#include
<string>
...
...
This diff is collapsed.
Click to expand it.
3.cc
+
13
−
0
View file @
758d8bdf
/*字节跳动
*笔试3
*
* 有M个人围成一个圈,你给他们发礼物。如果有一个人的分数比相邻的某一个人分数高,那他得到的礼物数量必须大于相邻的那个人。已知每个人的分数,求至少需要准备多少礼物?
*
* 输入:
* 第一行:N。
* 下面的内容重复N次 {
* 一行:M,代表下一行的人数
* 一行:空格分割的M个整数的数组,表示每个人的分数
* }
*
*/
#include
<iostream>
#include
<string>
...
...
This diff is collapsed.
Click to expand it.
4.cc
+
17
−
0
View file @
758d8bdf
/*自解跳动笔试4 当时我没写玩,正确的做法是二分查找。
*
*
* 已知有N根长度不一的绳子和他们的长度,我现在需要M根长度相等的绳子。你只能切断绳子,不能粘在一起。
* 我想知道我的这M根绳子的最大长度是多少?
*
* 输入:
* N M
* N个整数,表示每个绳子的长度,空格分割
* N M
* N个整数,表示每个绳子的长度,空格分割
* N M
* N个整数,表示每个绳子的长度,空格分割
* .........................
*
*/
/*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment