1.

[编程|15分] Calculate survival fishes
时间限制:1秒
空间限制:32768K
题目描述
Given two zero-indexed arrays A and B consisting of N (N >= 0) integers, which represent N fishes in a river, ordered from west to east. 
The fish are numbered from 0 to N-1, and Fish number X is represented by A[X] and B[X]. Array A contains the sizes of the fishes, while array B contains the directions they swim, which can be 1 (from west to east) or -1 (from east to west).

If two fishes move in opposite directions meet each other, the larger fish will eat the smaller one, and the survival will still follow its original direction.

We assume that all fishes are in different sizes and swimming at the same speed. The goal is to calculate the number of fishes that will stay alive.

For example:

A is [3, 5, 9, 1, 2]
B is [1, -1, 1, 1, -1]

Fish number 1 will eat Fish number 0, Fish number 4 will eat Fish number 3 and be eaten by Fish number 2. Therefore the output should be 2 (Fish number 1 and Fish number 2 are still alive)
输入描述:
Array A and B as described above

输出描述:
The number of fishes that will stay alive
输入例子:
3 5 9 1 2
1 -1 1 1 -1
输出例子:
2

2.

[编程|20分] Sum of Minimum Distatnce
时间限制:5秒
空间限制:2097152K
题目描述
Give a undirected graph, each edge’s length is 1, each node has a numeric ID. There are some special nodes in the graph, node’s the minimum distance to the special node is the length of shortest path to the nearest special node. Please calculate all the nodes’ minimum distance to special node. If a node could not reach any special node the distance is –1.
输入描述:
First line is a number N means that the next N lines are the N edges in the graph. Each of the N lines has two value v1 v2 which are the two nodes’ ID linked by this edge. 0 < N < 10000000
After that there is a single line with a number M which means the next M lines are the M special nodes. Each of the M lines has one value v which means the node’s ID. 0 <= M <= N/2

输出描述:
Sum of All nodes' minimum distance
输入例子:
2
1 2
2 3
1
2
输出例子:
2

3.

[编程|30分] Calculate longest "solid variable group"
时间限制:4秒
空间限制:65536K
题目描述
Given two zero-indexed arrays A and B consisting of M and N (M > 0, N > 0) strings, which represent M and N variables in two different models P and Q. Each variable is a string, which contains letters "a-z" in lower case only. Variables in arrays A and B are initially sorted by their contribution to the model, from large to small, which means, A[0] has the largest contribution to model P, while A[M-1] has the smallest contribution to model P. If there are X variables existing in same order in both A and B, they form a "solid variable group" of which the length is X. The goal is to calculate the length of the longest "solid variable group", and find out the variables in the longest "solid variable group". If there are more than 1 longest "solid variable groups", find out the one which has the largest contribution to model P. For example: A is ['paypal', 'business', 'money', 'innovation', 'strong'] B is ['innovation', 'paypal', 'strong', 'inclusion'] The length of the longest "solid variable group" is 2, and two "solid variable groups" of length 2 are ('paypal', 'strong') and ('innovation', 'strong'). Since 'paypal' has larger contribution to model P than 'innovation', the output should be 2 and ('paypal', 'strong').
输入描述:
Array A and B as described above

输出描述:
The first line should be the length of the longest "solid variable group", while the second line should be the longest "solid variable group" which has the largest contribution to model P. If there's no longest "solid variable group" available, the second line should be a blank line.
输入例子:
paypal business money innovation strong
innovation paypal strong inclusion
输出例子:
2
paypal strong

4.

[编程|35分] String puzzle
时间限制:5秒
空间限制:524288K
题目描述
The boss of P company plays an interesting game with employees. At the beginning, the boss gives a very long string with length m. The boss invites n employees to reorder the string with command a, s, e, where a in {0, 1} denotes the type of operation, s and e are positions in the string. If a = 0, all characters from s to e are ordered in non-increasing order. If a = 1, all characters from s to e are ordered in non-decreasing order. After n times operation, the boss wants to know the final string.
输入描述:
The first line contains two integers m, (1 <= m <= 100000), n, (0 <= n <= 50000) - the length of the string and the number of operations. The next line contains a string with length m. Next n lines contain operation command a, s, e, where a in {0, 1} and 1 <= s <= e <= m.

输出描述:
One line contains the final string.
输入例子:
10 3
naitdocexv
1 1 3
0 9 10
1 7 9

输出例子:
aintdocexv

Paypal2017实习生-软件开发-B卷的更多相关文章

  1. 百度软件开发实习生c++方向面经(一面)

    百度2017实习生软件开发(cpp方向) 首先说一下岗位.分为软件开发,开发测试,前端,机器学习数据挖掘,移动开发,据我观察,报的人数来看,软件开发最多,移动开发和开发测试较少.百度前台还准备了吃的喝 ...

  2. 精《记叙“tom”4年的软件开发之旅》

    1.引言 本篇文章是记叙tom四年的软件开发从业经历,虽然他资历不长,况且本身也是个菜鸟,但他也曾有过荣誉.迷茫.困惑与选择,在这里他希望通过自己所经历过的事情分享给大家,给那些真正热爱软件开发的同学 ...

  3. 软件设计模式 B卷

            软件设计模式 试 卷(作业考核 线上)  B  卷   学习中心:            院校学号:             姓名                (共        页 ...

  4. 7 家 IT 厂商 6394.5 万元中标天津公安云项目(虚拟化、数据库、软件开发)

    http://mp.weixin.qq.com/s/kjum54HJorGTPtZiM-HE1g 天津市公安局云计算平台项目分为:大数据部分.虚拟化部分.数据库部分,软件开发部分,预算分别为:2350 ...

  5. Atitit。 沉思录 与it软件开发管理中的总结 读后感

    Atitit. 沉思录 与it软件开发管理中的总结 读后感 1. <沉思录>,古罗马唯一一位哲学家皇帝马可·奥勒留所著 2 2. 沉思录与it软件开发管理中的总结 2 2.1. 要有自己的 ...

  6. nw.js桌面软件开发系列 第0.1节 HTML5和桌面软件开发的碰撞

    第0.1节 HTML5和桌面软件开发的碰撞 当我们谈论桌面软件开发技术的时候,你会想到什么?如果不对技术本身进行更为深入的探讨,在我的世界里,有这么多技术概念可以被罗列出来(请原谅我本质上是一个Win ...

  7. 敏捷软件开发VS传统软件工程

    敏捷软件开发:又称敏捷开发,是一种从1990年代开始逐渐引起广泛关注的一些新兴软件开发方法,是一种应对快速变化的需求的一种软件开发能力. 与传统软件工程相比,它们的具体名称.理念.过程.术语都不尽相同 ...

  8. Atitit.软件开发的三层结构isv金字塔模型

    Atitit.软件开发的三层结构isv金字塔模型 第一层,Implements 层,着重与功能的实现.. 第二次,spec层,理论层,设计规范,接口,等.流程.方法论 顶层,val层,价值观层,原则, ...

  9. BZOJ 1221: [HNOI2001] 软件开发

    1221: [HNOI2001] 软件开发 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1428  Solved: 791[Submit][Stat ...

随机推荐

  1. 【转】JSF中的三大核心组件 UI标签的详细介绍和使用举例

    JSF提供了大量的UI标签来简化创建视图.这些UI标签类似于ASP.NET中的服务器组件.使用这些标签,可以通过其value,binding,action,actionListener等属性直接绑定到 ...

  2. 解决Unable to load native-hadoop library for your platform

    使用hadoop fs相应命令时候总是出现 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your plat ...

  3. sql语句中的join用法(可视化解释)

    一.innerjoin innerjoin总结来说就是 ,如A知道通往B如何走:B知道通往C如何走:但是A不知道通往C如何走,但是A可以通过B获得去往C的通往方式.. 首先,假设有A,B两张表,结构及 ...

  4. windows下安装mysql

    windows 下安装mysql 1.先下载好 mysql5.7 版本的安装包,可以去官网自己下载,也可以从我的百度云分享 里面下载: 链接: https://pan.baidu.com/s/1VXk ...

  5. Windows单机最大TCP连接数的问题

    本文和大家分享一下Windows下单机最大TCP连接数,因为在做Socket 编程时,我们经常会要问,单机最多可以建立多少个 TCP 连接,本文将介绍如何调整系统参数来调整单机的最大TCP连接数. W ...

  6. java 对象属性复制,将一个对象的属性值赋值给另一个对象, 属性名需要相同

    import org.springframework.beans.BeanUtils; BeanUtils.copyProperties(源对象, 目标对象);

  7. Cesium实现文字、点、多段线、多边形的实时绘制

    背景知识 点.线.面以及文字的实时绘制是GIS很重要的一个功能,是用户对感兴趣区域标注的业务需要.同时Cesium提供了点.线(多段线).面及文字(label)绘制的接口,绘制方式总共有两种,一种是通 ...

  8. python3编写网络爬虫21-scrapy框架的使用

    一.scrapy框架的使用 前面我们讲了pyspider 它可以快速的完成爬虫的编写 不过pyspider也有一些缺点 例如可配置化不高 异常处理能力有限对于一些反爬虫程度非常强的网站 爬取显得力不从 ...

  9. 【Teradata】gtwglobal查看

    使用root登录TD数据库节点 cnsterm 6 start gtwglobal cnsterm 3 //上一个命令的window编号 h //帮助 QUIT //退出

  10. n2

    "express-ws": "^3.0.0", "devDependencies": {    "socket.io": ...