注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
HRT的新鲜OA, 一共四道题,新人不知道怎么发附件或者图片,就把文字跟大家分享一下:
第一题:
The Fibonacci sequence is defined as follows:
f=1
f=1
fn = fn-1+ fn-2 for n > 2
The first few numbers of the sequence are:
1,1,2, 3,5, 8....
A Fibonacci number is any number found in this
sequence. Note that this definition does not consider
0 to be a Fibonacci number.
Given a list of numbers, determine if each number is
the sum of two Fibonacci numbers.
Example
Given an input of [2, 5, 17] , the function is
expected to return [true, true, false]. This is
because 1 + 1 = 2, 2 + 3 = 5 but there are no two
Fibonacci numbers that sum to 17.
• [execution time limit] 1 seconds (cpp)
• [input] array.integer64 a
A list of numbers which we want to query. The
length is guaranteed toctangular-prism.
Given a list of 4 ≤ N ≤ 1000 points on a Cartesian Plane, count the number of rectangles
such that all 4 corners of the rectangle lie on the points.
All points will have integer values for 2 and y, and no point will be repeated. Each point satisfies
-100000 ≤ xi, yi ≤ 100000.
Note: the rectangle does not need to be axis aligned.
新手小白积分不够,不能在自己的帖子下面回复评论,还请好人加点米,希望能早日看到面经~
祝大家拿到很多很多offer!!! |