Careercup - Microsoft面试题 - 5204967652589568
2014-05-11 23:57
原题:
identical balls. one ball is heavy. find the heavy ball with only measurements ........ dead easy.
题目:9个看起来一样的球,其中有一个偏重。给定一个不能给出具体重量,但可以比较轻重的天平,称2次找出那个重球。
解法:9个球三等分,称一次找出包含重球的那三个。3个球三等分,称一次找出重球。
代码:
// http://www.careercup.com/question?id=5204967652589568
Answer:
Split the balls into three groups of balls.
Choose two groups and weigh them on the balance:
If balanced, the heavy ball is in the other group.
If imbalanced, the heavy ball is in the heavier group.
Find the group with the heavy ball, pick two balls from the three and weigh them:
If balanced, the heavy ball is the other one.
If imbalanced, the heavy ball is the heavier one.
Careercup - Microsoft面试题 - 5204967652589568的更多相关文章
- Careercup - Microsoft面试题 - 6314866323226624
2014-05-11 05:29 题目链接 原题: Design remote controller for me. 题目:设计一个遥控器. 解法:遥控什么?什么遥控?传统的红外线信号吗?我只能随便说 ...
- Careercup - Microsoft面试题 - 6366101810184192
2014-05-10 22:30 题目链接 原题: Design database locks to allow r/w concurrency and data consistency. 题目:设计 ...
- Careercup - Microsoft面试题 - 24308662
2014-05-12 07:31 题目链接 原题: I have heard this question many times in microsoft interviews. Given two a ...
- Careercup - Microsoft面试题 - 5700293077499904
2014-05-12 00:02 题目链接 原题: For a given map (ie Bing map) given longitude/latitude/ how would you desi ...
- Careercup - Microsoft面试题 - 5175246478901248
2014-05-11 23:52 题目链接 原题: design an alarm clock for a deaf person. 题目:为聋人设计闹钟? 解法:聋人听不见,那么闪光.震动都可行.睡 ...
- Careercup - Microsoft面试题 - 5718181884723200
2014-05-11 05:55 题目链接 原题: difference between thread and process. 题目:请描述进程和线程的区别. 解法:操作系统理论题.标准答案在恐龙书 ...
- Careercup - Microsoft面试题 - 5173689888800768
2014-05-11 05:21 题目链接 原题: Complexity of a function: int func_fibonacci ( int n) { ) { return n; } el ...
- Careercup - Microsoft面试题 - 6282862240202752
2014-05-11 03:56 题目链接 原题: Given an integer array. Perform circular right shift by n. Give the best s ...
- Careercup - Microsoft面试题 - 5428361417457664
2014-05-11 03:37 题目链接 原题: You have three jars filled with candies. One jar is filled with banana can ...
随机推荐
- IPHONE 字体加粗
UIFONT 没有字体加精参数,但可以修发,字体名,达到加粗的效果正常:Helvetica加粗"Helvetica-Bold""TimesNewRomanPS-BoldM ...
- css style与class之间的区别,cssclass
问题描述: 网页点击[导出]按钮后,将页面table内容另存成excel文件,却发现无法保存表格样式 分析过程: 1.table表格用class,而不是style.导出时并没有导出class定义 ...
- POJ C程序设计进阶 编程题#3: 发票统计
来源: POJ (Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 有一个小型的报账系统,它有如 ...
- kettle的job
1.首先创建一个job 2.拖拽组件形成下面的图 这里需要注意,在作业中的连线分为三类: 黄色锁的线:这个步骤执行之后,无论失败与否都会执行下一个步骤 绿色对号线:步骤执行成功了,才会执行下一个步骤. ...
- 14 个折磨人的 JavaScript 面试题
前端工程师有时候面试时会遇到一类面试官,他们问的问题对于语言本身非常较真儿,往往不是候选人可能期待的面向实际的问题(有些候选人强调能干活就行,至于知不知道其中缘由是无关痛痒的).这类题目,虽然没有逻辑 ...
- C#通过WinAPI获取内存信息,32位64位可用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runti ...
- PopupWindow的简单使用
测试代码: package com.zzw.testpopuwindows; import android.app.Activity; import android.graphics.Color; i ...
- Ubuntu 下安装 Oracle JDK
sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-ins ...
- Red Gate Software 软件推荐
这家公司的Wiki http://en.wikipedia.org/wiki/Redgate http://www.red-gate.com/products/ 好吧 就介绍点免费的 Find SQL ...
- sftp
SFTP 为 SSH的一部分,是一种传输档案至 Blogger 伺服器的安全方式.其实在SSH软件包中,已经包含了一个叫作SFTP(Secure File Transfer Protocol)的安全文 ...