由买买提看人间百态

topics

全部话题 - 话题: pows
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
y*****n
发帖数: 85
1
http://news.yahoo.com/japans-views-wwii-history-rankles-us-vete
WASHINGTON (AP) — Lester Tenney endured three hellish years as a Japanese
prisoner during World War II, but with the passing of decades and repeated
visits, he's made peace with his former enemy. Yet as Japan's Prime Minister
Shinzo Abe prepares to address Congress next week, in the 70th anniversary
year of the war's end, something rankles the U.S. military veteran about
Japan's attitude toward its past.
"They don't want the young p... 阅读全帖
l******n
发帖数: 9344
2
来自主题: JobHunting版 - T家在线测试面经,感觉好难啊
效率低下的直接循环,应该不会漏
import math
m = 2
n = 16
for i in range(1,m+1):
for j in range(1,n+1):
a = i*1.0
b = j*1.0
if math.ceil(math.pow(a,1.0/3)*math.pow(b,1.0/3)*(math.pow(a,1.0/3)+
math.pow(b,1.0/3))) == math.floor(math.pow(a,1.0/3)*math.pow(b,1.0/3)*(math.
pow(a,1.0/3)+math.pow(b,1.0/3))):
print a,b
g******l
发帖数: 5103
3
老毛用自己儿子+几十万中国士兵的生命换来金家三个胖子。现在朝鲜跟中国的关系还
不如韩国。
Total Deaths of Korean War:
South Korea:
58,127 combat deaths
175,743 wounded
80,000 MIA or POW
United States:
36,516 dead (including 2,830 non-combat)
92,134 wounded
8,176 MIA
7,245 POW
United Kingdom:
1,109 dead
2,674 wounded
1,060 MIA or POW
Turkey:
721 dead
2,111 wounded
168 MIA
216 POW
Canada
516 dead
1,042 wounded
Australia
339 dead
1,200 wounded
France:
300 KIA or MIA
Philippines:
112 KIA
South Africa
28 KIA and 8 MIA
Total: Over 474,000
------... 阅读全帖
l****c
发帖数: 782
4
来自主题: JobHunting版 - a1b2c3d4 变abcd1234
for(int i = 0; pow(2,(i+2)) <= n; i++) {
for(int j = pow(2,i)+ 1; j < n; j = j +pow(2,(i+2))) {
for (int tmp = 0; tmp < pow(2,i); tmp++) {
swap(s[j], s[j+pow(2,i)]);
}
}
}
怎么觉得很难写啊,思路如下
a1b2c3d4.... -> ab12cd34 ->abcd1234
我算是抛个破砖吗
r**h
发帖数: 1288
5
来自主题: JobHunting版 - 请教数学类题目中对于1<<31的处理
由于这个数在正整数中没有对应的数,因此很多时候都要单独处理,不过总觉得把这一
个情况单列出来搞得代码不好看。请问一般来说有什么比较好的处理方法吗?
比如说pow(x),我的代码是这样的, 1<<31的情况单独处理了:
double pow(double x, int n) {
if(n == 0) return 1;
if(x==0 || x==1) return x;
if(n < 0){
if(n == (1<<31)){
double tmp = pow(1/x, 1<<15);
return tmp*tmp;
}
else
return pow(1/x, -n);
}
double tmp = pow(x, n>>1);
if(n&1)
return tmp*tmp*x;
... 阅读全帖
p**o
发帖数: 3409
6
来自主题: JobHunting版 - 请教一道Groupon的题目
只要意识到递归关系:后n位含5 当且仅当 倒数第n位是5 或 后n-1位含5
实现就异常elegant(Python3.3+)
def gen5 (n):
""" Generate all k-digit (1<=k<=n) decimals with digit 5 in ascending
order. """
if n>=1:
POW = 10**(n-1)
yield from (x * POW + y for x in range(5) for y in gen5(n-1))
yield from (5 * POW + y for y in range(POW))
yield from (x * POW + y for x in range(6,10) for y in gen5(n-1))
如果你只是要顺序输出打印“所有含5的N位十进制数”,简单地
>>> list(gen5(0))
[]
>>> list(gen5(1))
[5]
>>> list(gen5(2))
[5, 15, 25, 3... 阅读全帖
b********r
发帖数: 620
7
来自主题: JobHunting版 - 请教一道Groupon的题目
my 2 bricks:
1) find out floor of n/5, let it be m. for all odd numbers smaller or equal
to m, output the product with 5
2) find out the i, such that 6 x pow(10, i) <= n < 6 x pow(10, i+1), then
output everything 5* (such as 50, 51, 59, 500, 501, 599, 5000, 5001, 5999),
which is less than 6 x pow(10, i)
3) substract 6 x pow(10, i) from n, then recursion with base of 6 x pow(10,
i)
will code and see
p**o
发帖数: 3409
8
来自主题: JobHunting版 - 请教一道Groupon的题目
只要意识到递归关系:后n位含5 当且仅当 倒数第n位是5 或 后n-1位含5
实现就异常elegant(Python3.3+)
def gen5 (n):
""" Generate all k-digit (1<=k<=n) decimals with digit 5 in ascending
order. """
if n>=1:
POW = 10**(n-1)
yield from (x * POW + y for x in range(5) for y in gen5(n-1))
yield from (5 * POW + y for y in range(POW))
yield from (x * POW + y for x in range(6,10) for y in gen5(n-1))
如果你只是要顺序输出打印“所有含5的N位十进制数”,简单地
>>> list(gen5(0))
[]
>>> list(gen5(1))
[5]
>>> list(gen5(2))
[5, 15, 25, 3... 阅读全帖
r*****t
发帖数: 7278
9
using System;
namespace QFramework
{
///
/// Represents a Cox-Ross-Rubenstein binomial tree option pricing
calculator. May be used for pricing European or American options
///

public class BinomialTree
{
#region "Private Members"
private double assetPrice = 0.0;
private double strike = 0.0;
private double timeStep = 0.0;
private double volatility = 0.0;
private EPutCall putCall = EPutCall.Call;

... 阅读全帖
a*****c
发帖数: 3525
10
【 以下文字转载自 Military 讨论区 】
发信人: agostic (π-packing), 信区: Military
标 题: (中英文)原子弹下无冤魂:B29飞行员查尔斯•斯韦尼将军1995国会演讲
发信站: BBS 未名空间站 (Wed Aug 15 20:13:42 2012, 美东)
只有记忆才能带来真正的原谅,而遗忘就可能冒重复历史的危险。
One can only forgive by remembering. And to forget, is to risk repeating
history.
学英文是为了更好地了解历史。文章很长,有兴趣学英语同时了解历史的同学,希望耐
心地看完(也可以拷贝下来仔细研读)。不仅仅是学英语,更重要的是学如何写作,如
何摆事实,讲道理,反驳质疑。可以学的东西(中英文)原子弹下无冤魂:B29飞行员查
尔斯•斯韦尼将军1995国会演讲很多,就看你是否能够用心去领悟。这是一篇难
得的informative/historical/linguastic article. Enjoy and welcome to ... 阅读全帖
a*****c
发帖数: 3525
11
【 以下文字转载自 Military 讨论区 】
发信人: agostic (π-packing), 信区: Military
标 题: (中英文)原子弹下无冤魂:B29飞行员查尔斯•斯韦尼将军1995国会演讲
发信站: BBS 未名空间站 (Wed Aug 15 20:13:42 2012, 美东)
只有记忆才能带来真正的原谅,而遗忘就可能冒重复历史的危险。
One can only forgive by remembering. And to forget, is to risk repeating
history.
学英文是为了更好地了解历史。文章很长,有兴趣学英语同时了解历史的同学,希望耐
心地看完(也可以拷贝下来仔细研读)。不仅仅是学英语,更重要的是学如何写作,如
何摆事实,讲道理,反驳质疑。可以学的东西(中英文)原子弹下无冤魂:B29飞行员查
尔斯•斯韦尼将军1995国会演讲很多,就看你是否能够用心去领悟。这是一篇难
得的informative/historical/linguastic article. Enjoy and welcome to ... 阅读全帖
y**********7
发帖数: 769
12
还"横扫千军如卷席!"呢? 在朝鲜战争中,阵亡的中国军人是美军的五倍. 古时说胜仗
是"杀敌三千,自损八百." 按照这个说法,是谁胜了呢? 以38度线划界,最多也就是个平
分秋色,您就别瞎吹了吧.
http://en.wikipedia.org/wiki/%E6%9C%9D%E9%B2%9C%E6%88%98%E4%BA%89
United States
36,516 dead (including 2,830 non-combat deaths)
92,134 wounded
8,176 MIA
7,245 POW
China P.R.
(Official data):
183,108 dead (including non-combat deaths)
383,218 wounded
25,621 MIA
21,400 POW
South Korea
137,899 KIA[10]
450,742 WIA[10]
32,838 MIA or POW[
North Korea:
215,000 dead
303,000 wounded
120,000 MIA or POW

,16国... 阅读全帖
w*********r
发帖数: 42116
13
《韩国战争史》南韩国防部战史编纂委员会编,第五卷“对峙末期”“战果及损失”。
韩军失踪43500
S Korean POWs. AII POW-MIA. [2008年9月9日].
韩军失踪或被俘80,000人
U.S. MILITARY KOREAN WAR STATISTICS. AII POW-MIA [2008年9月9日].
美军失踪8,176人, 被俘7,245人
POWs in Korean War. 美国国防部韩战50周年纪念网站 [2009年3月5日].
志愿军被俘21,839人
Michael Hickey. The Korean War: An Overview. BBC. 2001年8月1日 [2008年9月8日
].
朝军失踪或被俘101,000人
从韩国和西方的文献看, 朝鲜和韩国人都不算人.
朝鲜和中国可能把所有的人都当人算了.
a*****c
发帖数: 3525
14
只有记忆才能带来真正的原谅,而遗忘就可能冒重复历史的危险。
One can only forgive by remembering. And to forget, is to risk repeating
history.
学英文是为了更好地了解历史。文章很长,有兴趣学英语同时了解历史的同学,希望耐
心地看完(也可以拷贝下来仔细研读)。不仅仅是学英语,更重要的是学如何写作,如
何摆事实,讲道理,反驳质疑。可以学的东西(中英文)原子弹下无冤魂:B29飞行员查
尔斯•斯韦尼将军1995国会演讲很多,就看你是否能够用心去领悟。这是一篇难
得的informative/historical/linguastic article. Enjoy and welcome to comment.
(中英文)原子弹下无冤魂:B29飞行员查尔斯•斯韦尼将军1995国会演讲
英文版来源:
http://www.archive.org/stream/smithsonianinsti00unit/smithsonia
Fulltext of Charles W. Sweeney's Hea... 阅读全帖
D*********n
发帖数: 279
15
来自主题: Military版 - Native Americans in the United States
http://en.wikipedia.org/wiki/Native_Americans_in_the_United_Sta
Native Americans in the United States
From Wikipedia, the free encyclopedia
Jump to: navigation, search
"American Indian" redirects here. For other indigenous peoples, see
Indigenous peoples of the Americas and other geographic regions. For
Americans from South Asia, see Indian American.
This article may be too long to read and navigate comfortably. Please
consider splitting content into sub-articles and/or condensing it. (January
2... 阅读全帖
I*3
发帖数: 7012
16
哥早说过了,要舔倭菊不是不可以,但是不能把我菌的弟兄都当傻子。LZ这种睁眼说瞎
话,闭眼舔倭菊的姿势必须得到遏制。
下面嘿嘿哥用理性来打LZ的脸。注意哦,不是瞎打的,被哥打过脸的一般都会悟脸大叫
:打得好。。。
根据LZ给出的LINK,可以看到整段原文是这样的
“Although the Chinese rarely executed prisoners like their North Korean
counterparts, mass starvation and diseases swept through the Chinese-run POW
camps during the winter of 1950–51. About 43 percent of all U.S. POWs died
during this period. The Chinese defended their actions by stating that all
Chinese soldiers during this period were suffering mass starvation and... 阅读全帖
I*3
发帖数: 7012
17
哥早说过了,要舔倭菊不是不可以,但是不能把我菌的弟兄都当傻子。LZ这种睁眼说瞎
话,闭眼舔倭菊的姿势必须得到遏制。
下面嘿嘿哥用理性来打LZ的脸。注意哦,不是瞎打的,被哥打过脸的一般都会悟脸大叫
:打得好。。。
根据LZ给出的LINK,可以看到整段原文是这样的
“Although the Chinese rarely executed prisoners like their North Korean
counterparts, mass starvation and diseases swept through the Chinese-run POW
camps during the winter of 1950–51. About 43 percent of all U.S. POWs died
during this period. The Chinese defended their actions by stating that all
Chinese soldiers during this period were suffering mass starvation and... 阅读全帖
o**********e
发帖数: 18403
18
How should Chinese Americans respond to this coming wave of anti-China
protests by Philipinoes?
June 12th, Fifth Avenue, New York
http://www.thephilippinepride.com/richest-pinay-in-us-urges-people-to-boycott-china-made-apple-products/
我觉得治病要治根,擒贼先擒王。
Instead of responding to Philipinoes, our traditional allies and friends, we
should join them in protest. With a twist. Our slogan should be:
"Shinzo Abe: Admit WW II War Atrocities Against Philipinoes",
"Shinzo Abe: Admit WW II War Atrocities ... 阅读全帖
m***c
发帖数: 1177
19
打佩刀式敌机的能手鲁珉
李大年/侯祖沛/梁南
中国人民志愿军空军某部大队长鲁珉,在去年十二月份的五次空战中,连续英勇地击落
五架美国佩刀式(F—八十六型)喷气机,荣获志愿军空军领导机关颁给的 “特等人
民功臣”、“打佩刀式敌机的能手”和“志愿军空军一级战斗英雄”的光荣称号。朝鲜
民主主义人民共和国政府为了表彰他的功绩,特授予他二级自由独立勋章。
不久以前,我们在前线某基地访问了这位出色的英雄。他有着魁伟的身体,浓黑的眉毛
,鹰一样机警灵活的眼睛。他两手拿着一对铝质喷气式飞机的模型,向我们介绍他在历
次空战中痛击美国空中强盗的英勇事迹。
去年十二月五日,他带领着整齐的编队,飞快地向南方挺进。这一带的天空,他是非常
熟悉的。他清楚地记得:当第一次在这一带上空飞行时,还可以看到地面有几排灰土色
的房屋,第二次飞过这里,灰土色的房屋,便骤然地减少了,到第三次飞到这里,却再
也找不到这些房屋了。他知道,这是美国空中强盗炸毁的。以后,每当飞过这里,他都
愤怒地搜索着敌机。这次,就在这一带的上空,从远远的薄云层中,他发现了六架敌机
,两架在前,四架在后。它们从西往东,正向海岸飞来。
鲁珉率领他的机群... 阅读全帖
r*****y
发帖数: 53800
20
来自主题: Military2版 - 50年后ROC空军全部combat loss
http://www.taiwanairpower.org/history/shootdowns.html
跟58金门空战相关的有:2架F84G,2架F86F,2架C46运输机(其中1架被高炮击落1架被
pla空军击落)。
1958
10/10 27 Sq 張迺軍: POW F-86F Downed by explosion from a downed PLAAF MiG-
17. The POW was released on 06/30/59.
10/02 102 Sq 黃義正, 彭超群, 喻友仁, 郎德馨, 陳孝富: 5 KIA C-46 "199" Downed
by PLA AAA near Kinmen
09/29 2 Sq 華武麟, 劉承理: 2 POW
葛廣白, 李森杰, 王隆庭: 3 KIA C-46 "223" Downed by PLA. The POW were
released on 06/30/59.
08/14 26 Sq 劉光燦: KIA F-86F "307" Failed to return after engagement with
PLA J... 阅读全帖
j*********r
发帖数: 24733
21
英文原文,Cited from page 273 to page 286
Charles W. Sweeney, et al., War's End: An Eyewitness Account of
America's Last Atomic Mission, July 6, 1999, Quill Press
此书Amazon有售
http://www.amazon.com/Wars-End-Eyewitness-Account-Americas/dp/0
Testimony of Major General Charles W. Sweeney, U.S.A.F. (Ret.)
delivered before the United States Senate Committee on Rules and
Administration – hearings on the Smithsonian Institution: Management
Guidelines for the Future, May 11, 1995.
I am Major General Charles W.... 阅读全帖
y***m
发帖数: 7027
22
来自主题: JobHunting版 - 乘方函数还有简解么
一个java稍微优化的,请指点更优化解,thx!
public static double pow(double a, int b) {
if (b == 0)
return 1;
else if (b == 1)
return a;
else if (b == -1)
return a;
else if (b == 1)
return 1 / a;
else if (b == 2)
return a * a;
else if (b == -2)
return 1 / (a * a);
... 阅读全帖
g**********y
发帖数: 14569
23
来自主题: JobHunting版 - 来贡献个小题.
凑热闹
public double power(double x, int n) {
if (n < 0) return 1.0/power(x, -n);
double r = 1.0, pow = x;
while (n > 0) {
if ( (1 & n) > 0 ) r *= pow;
n >>= 1;
pow *= pow;
}
return r;
}
g**********y
发帖数: 14569
24
来自主题: JobHunting版 - 来贡献个小题.
凑热闹
public double power(double x, int n) {
if (n < 0) return 1.0/power(x, -n);
double r = 1.0, pow = x;
while (n > 0) {
if ( (1 & n) > 0 ) r *= pow;
n >>= 1;
pow *= pow;
}
return r;
}
B*******1
发帖数: 2454
25
上个我收藏的火鸡的代码:
public double power(double x, int n) {
if (n < 0) return 1.0/power(x, -n);
double r = 1.0, pow = x;
while (n > 0) {
if ( (1 & n) > 0 ) r *= pow;
n >>= 1;
pow *= pow;
}
return r;
}
S**I
发帖数: 15689
26
☆─────────────────────────────────────☆
gzou (gzou) 于 (Thu May 12 02:26:35 2011, 美东) 提到:
马上就要G on site了,
求祝福。
下面是从本版收集到的Google的试题,便于大家查询。
申明:有的附带有解释说明的,也来自于本版或者网络,大家自己看, 不保证真确
http://www.mitbbs.com/article_t1/JobHunting/31847453_0_1.html
本人ECE fresh PhD,背景是电路/EDA,跟G业务基本没什么关系
同学内部推荐的,很简单的一次电面就给了onsite
题都不难,但是自己没把握好机会,出了一些小bug。
总的感觉,出错就是硬伤,宁可从最简单的算法写起,也不能出错。
电面:
1,Skip list, http://en.wikipedia.org/wiki/Skip_list
写code实现struct skip_list * find(struct skip_list *head, int value)
2,sorted array... 阅读全帖
S**I
发帖数: 15689
27
☆─────────────────────────────────────☆
gzou (gzou) 于 (Thu May 12 02:26:35 2011, 美东) 提到:
马上就要G on site了,
求祝福。
下面是从本版收集到的Google的试题,便于大家查询。
申明:有的附带有解释说明的,也来自于本版或者网络,大家自己看, 不保证真确
http://www.mitbbs.com/article_t1/JobHunting/31847453_0_1.html
本人ECE fresh PhD,背景是电路/EDA,跟G业务基本没什么关系
同学内部推荐的,很简单的一次电面就给了onsite
题都不难,但是自己没把握好机会,出了一些小bug。
总的感觉,出错就是硬伤,宁可从最简单的算法写起,也不能出错。
电面:
1,Skip list, http://en.wikipedia.org/wiki/Skip_list
写code实现struct skip_list * find(struct skip_list *head, int value)
2,sorted array... 阅读全帖
T******7
发帖数: 1419
28
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
public class ManhattanDistansIterator {

PriorityQueue pList = null;
int len;
int index;

public ManhattanDistansIterator(List points) {
len = points.size();

pList = new PriorityQueue<>(len, new Comparator() {
public int compare(Point p1, Point p2){
... 阅读全帖
l*******4
发帖数: 406
29
BOOM BOOM POW,你可以把POW听成爆或者梆,怎么说都说的过去。
配合节奏感的背景音乐
“BOOM BOOM POW!卧槽,卖单当买单下了!BOOM BOOM POW!”
o**********e
发帖数: 18403
30
【 以下文字转载自 Military 讨论区 】
发信人: onetiemyshoe (onetiemyshoe), 信区: Military
标 题: 明天老中对菲律宾美国人的反华货抗议的对策
发信站: BBS 未名空间站 (Thu Jun 11 13:11:36 2015, 美东)
How should Chinese Americans respond to this coming wave of anti-China
protests by Philipinoes?
noon time, June 12th, Walmart, LA
http://www.abs-cbnnews.com/global-filipino/06/10/15/la-pinoys-h
我觉得治病要治根,擒贼先擒王。
Instead of responding to Philipinoes, our traditional allies and friends, we
should join them in protest. With a twist. Our slogan should be: ... 阅读全帖
o**********e
发帖数: 18403
31
【 以下文字转载自 NewYork 讨论区 】
发信人: onetiemyshoe (onetiemyshoe), 信区: NewYork
标 题: 明天纽约老中对菲律宾人的反华货抗议的对策 (转载)
发信站: BBS 未名空间站 (Thu Jun 11 13:14:25 2015, 美东)
发信人: onetiemyshoe (onetiemyshoe), 信区: Military
标 题: 明天老中对菲律宾美国人的反华货抗议的对策
发信站: BBS 未名空间站 (Thu Jun 11 13:11:36 2015, 美东)
How should Chinese Americans respond to this coming wave of anti-China
protests by Philipinoes?
June 12th, Fifth Avenue, New York
http://www.thephilippinepride.com/richest-pinay-in-us-urges-people-to-boycott-china-made-apple-produc... 阅读全帖
o**********e
发帖数: 18403
32
【 以下文字转载自 Military 讨论区 】
发信人: onetiemyshoe (onetiemyshoe), 信区: Military
标 题: 明天老中对菲律宾美国人的反华货抗议的对策
发信站: BBS 未名空间站 (Thu Jun 11 13:11:36 2015, 美东)
How should Chinese Americans respond to this coming wave of anti-China
protests by Philipinoes?
June 12th, Fifth Avenue, New York
http://www.thephilippinepride.com/richest-pinay-in-us-urges-people-to-boycott-china-made-apple-products/
我觉得治病要治根,擒贼先擒王。
Instead of responding to Philipinoes, our traditional allies and friends, we
should join them in protes... 阅读全帖
G*******9
发帖数: 4371
33
发信人: agostic (π-packing), 信区: Military
标 题: (中英文)原子弹下无冤魂:B29飞行员查尔斯•斯韦尼将军1995国会演讲
发信站: BBS 未名空间站 (Wed Aug 15 20:13:42 2012, 美东)
只有记忆才能带来真正的原谅,而遗忘就可能冒重复历史的危险。
One can only forgive by remembering. And to forget, is to risk repeating
history.
学英文是为了更好地了解历史。文章很长,有兴趣学英语同时了解历史的同学,希望耐
心地看完(也可以拷贝下来仔细研读)。不仅仅是学英语,更重要的是学如何写作,如
何摆事实,讲道理,反驳质疑。可以学的东西(中英文)原子弹下无冤魂:B29飞行员查
尔斯•斯韦尼将军1995国会演讲很多,就看你是否能够用心去领悟。这是一篇难
得的informative/historical/linguastic article. Enjoy and welcome to comment.
(中英文)原子弹下无冤魂:B29... 阅读全帖
a*****c
发帖数: 3525
34
【 以下文字转载自 Military 讨论区 】
发信人: agostic (π-packing), 信区: Military
标 题: (中英文)原子弹下无冤魂:B29飞行员查尔斯•斯韦尼将军1995国会演讲
发信站: BBS 未名空间站 (Wed Aug 15 20:13:42 2012, 美东)
只有记忆才能带来真正的原谅,而遗忘就可能冒重复历史的危险。
One can only forgive by remembering. And to forget, is to risk repeating
history.
学英文是为了更好地了解历史。文章很长,有兴趣学英语同时了解历史的同学,希望耐
心地看完(也可以拷贝下来仔细研读)。不仅仅是学英语,更重要的是学如何写作,如
何摆事实,讲道理,反驳质疑。可以学的东西(中英文)原子弹下无冤魂:B29飞行员查
尔斯•斯韦尼将军1995国会演讲很多,就看你是否能够用心去领悟。这是一篇难
得的informative/historical/linguastic article. Enjoy and welcome to ... 阅读全帖
s******8
发帖数: 7105
35

Various scholars have estimated the Axis suffered 850,000 casualties of all
types (wounded, killed, captured...etc) among all branches of the German
armed forces and its allies, many of which were POWs who died in Soviet
captivity between 1943 and 1955. 400,000 Germans, 200,000 Romanians, 130,000
Italians, and 120,000 Hungarians were killed, wounded or captured. Of the
91,000 German POWs taken at Stalingrad 27,000 died within weeks and only 5,
000 returned to Germany in 1955. The remainder of t... 阅读全帖
r*****y
发帖数: 53800
36
1 电影里好像喊的是斯大林命令不许撤退。
--------------------------------------------------
凤凰大视野里也说了,城防委员会本来是准备组织平民撤退的,但是斯大林很不高兴认
为这会造成恐慌,所以后来没有组织。大喇叭喊斯大林命令不许撤退很正常。
2 GLANTZ的书里有一句话提到伏尔加舰队晚上把伤员和平民运到河东,不过这是10月的
事情了,9月也许没有。
-----------------------------------------------
凤凰大视野里也有采访的俄国老百姓说他们是乘船和伤员一起运到河东的,不过人数少
,也不一定是事先组织的,而是个人行为。100多万平民被留在河西,逃到河东的平民
大约10万。
3 处决1万4逃兵的具体出处是哪里?
-----------------------------------------
wiki
http://en.wikipedia.org/wiki/Battle_of_stalingrad
Various scholars have estimated the Axis suffere... 阅读全帖
b********n
发帖数: 38600
37
THE TRUE MILITARY RECORD OF JOHN MCCAIN WRITTEN BY AN ACTIVE MARINE.
9/03/08
McCain has never really earned anything. He is from a wealth pampered
background and not fit to lead this nation.
A “war hero” doesn’t finished 894th out of 899 and still get stationed at
a Navy champagne unit and promoted ahead of all but two of his 898 other
classmates.
A “war hero” doesn’t crash three U.S. Navy jets out of sheer incompetence
and ineptitude, including two during non-combat training sessions.
A “war he... 阅读全帖
m******d
发帖数: 3243
38
来自主题: USANews版 - 马侃还有一个
他自己身为POW但是千方百计阻挠有关POW信息的解密,很多人连自己的亲人是死是活都
不知
https://www.thenation.com/article/why-has-john-mccain-blocked-info-mias/
Does this hint at explanations for McCain’s efforts to bury information
about prisoners or other disturbing pieces of the Vietnam War? Does he
suppress POW information because its surfacing rekindles his feelings of
shame?
a****a
发帖数: 186
39
来自主题: JobHunting版 - Google电面详细经历
这里怎么会用到pow(2,i).如果函数的参数是一个unsigned char,具体是怎么操作两位
交换的呢(用到for-loop)?求答案。

我:(完蛋了,被看出来是背下来的答案,怎么办?)
于是我开始另一个函数reverse_slow.用for循环写,循环四次,每次用位操作交换两位
。中间犯了好几次错误,都是搞反了“与”和“或”,主要是因为紧张。面试官提醒了
好几次还有错误,幸好都是我自己挑出的错误。其中我用了一个函数pow(2, i).
官:pow函数返回的是 double
我:我可以自己定义这个函数,返回整数
官:请优化你的reverse_slow
j*****u
发帖数: 1133
40
来自主题: JobHunting版 - fb 面经
明白了,类似这样:
// assume x > 0, y > 0
int Power(int x, int y)
{
int pow = 1;
while (y > 0)
{
if ((y & 1) != 0) pow *= x;
x *= x;
y >>= 1;
}
return pow;
}
h*********3
发帖数: 111
41
来自主题: JobHunting版 - 这么多G的面经,我也想想 ~~
你得到每个upperbound后,为什么还要binary search呢,难道不是只可能在
upperbound 和 upperbound-1 之间取一个吗?
比如 target is 31,
ceiling(pow(31,1/2)) = 5, 就只需要考虑 2^4 和2^5,
ceiling(pow(31,1/3)) = 4, 就只需要考虑 3^3 和3^4
一直到 ceiling(sqrt(31)) = 6,
ceiling(pow(31,1/6)) = 2, 只考虑 6^2
y***m
发帖数: 7027
42
来自主题: JobHunting版 - 乘方函数还有简解么

处理 -1 就行了吧
这样省了些代码,但b=1时多执行了 1/2的取整操作,b=2时多执行了2-3步代码吧...
nod
public static double pow(double a, int b) {
if (b == 0)
return 1;
else if (b == -1)
return 1/a;
else if (b == 1)
return a;
else if (b == 2)
return a*a;
else if (b == -2)
return 1/(a*a);
else if (b % 2 == 0) {
... 阅读全帖
l*****a
发帖数: 559
43
来自主题: JobHunting版 - [cloudera面试] senior engineer
void PrintFactors(vector & factor, int num, int index, vector& o,
vector >& res){
if(num == 1){
res.push_back(o);
return;
}
if(index >= factor.size()){
return;
}
for(int i = 0; pow(factor[index], i) <= num; i++){
if((num % (int)pow(factor[index], i)) != 0) continue;
for(int j = 0; j < i; j++){
o.push_back(factor[index]);
}
PrintFactors(factor, num / pow(factor[index], i), index + 1, o, r... 阅读全帖
g**********y
发帖数: 14569
44
来自主题: JobHunting版 - 写给申请L的同学
今天收到recruiter电话offer。写下来跟大家分享。特别感谢yangcheng和PixelClassic,他们写的面经和心得对我帮助很大。
【Phone Interview】
都是老题。先问LinkedIn最喜欢的:
double pow(double a, int b)
我的Algorithm Project里有这个题,当时很想直接贴答案。后来忍住了。这是个中等
难度的题,里面很多细节,如果贴的话,他一问,我没有过脑子,有可能被问住,那个
印象就太差了。如果自己解的,哪怕有错,思考过之后,我很快 会有相应的回答。我
就是这样一个人:不管多简单的题,我都会错,但我会补得很快。
想清楚,开始写。尽管很小心,最后还是在边界条件错了,就是第一句:
if (b < 0) return pow(a, -b);
我少写了1.0/pow(a, -b);
但是我不觉得后悔。如果他因为这个把我毙了,那我也只能认倒霉。
接着给Amazon的favorite, 2-sum to fixed number, 我不喜欢写这个题。就直接告诉
他:两种答案,hashtable, 2个指针,我都写过,你要哪种... 阅读全帖
s*******f
发帖数: 1114
45
来自主题: JobHunting版 - 面经
日子久了,忘了一些。搅拌到一起,无公司名。有些板上看见过的不列了,呵呵
注意编码,很难得算法不咋会考。
1.实现BigInt类。实现 ‘+’ 即可。
2.国际象棋棋盘中两个queen之间最短路径(queen只能斜着走),返回步数即可。就是
一个queen最少几步能走到另一个queen
3.class SortedArrays{
listofSortedArrays;
public:
bool HasNext();
bool Next();
}
1,3 ..
2,5 ..
4,5 ...
--> 1,2,3,4,5,5....
4. // return a^b
// pow(2, 3) = 8;
// pow(2, -3); = 1 / 8;
// if a < 0;
double pow(double a, int b){
5. binary search in sorted, but head-in-middle array. [15, 16, 1, 3, 9, 11,
13]
6. 1boogle game. give a boogle and a word, retu... 阅读全帖
g*********e
发帖数: 14401
46
来自主题: JobHunting版 - Google
要考虑溢出吗
double pow(x,y){
if(y<0)
return 1.0/pow(x,-y);
if(y==0)
return x;
if(y==1)
return x;
double half=pow(x,y/2);
return half*half*(odd(y)?x:1);
}
l**********1
发帖数: 415
47
来自主题: JobHunting版 - 求问一道面试题
被问pow(double, int)然后扩展到
如何实现 pow(double,double) in java
eg pow(2.5,2.3)
不会了
以前好像板上讨论过,不过找不到了。
d****o
发帖数: 2
48
来自主题: JobHunting版 - 面试F家让先做programming puzzle
抛砖引玉
#include
#include
#include
const int kMaxK = 5;
const int kMaxN = 8;
const int kMaxS = 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5;
#define DEBUG(v) std::cerr << #v << " = " << (v) << "\n"
int N, K, max_state;
short top[kMaxS][kMaxK];
int G[kMaxS][kMaxK * (kMaxK - 1) + 1];
int src = 0, dst = 0;
int f[kMaxS];
int pow(int base, int power) {
int r = 1;
for (int i = 0; i < power; r *= base, ++i);
return r;
}
int get(int num, int d) {
for (int i = 0; i < d; num /= K, ++i)... 阅读全帖
d****o
发帖数: 2
49
来自主题: JobHunting版 - 面试F家让先做programming puzzle
抛砖引玉
#include
#include
#include
const int kMaxK = 5;
const int kMaxN = 8;
const int kMaxS = 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5;
#define DEBUG(v) std::cerr << #v << " = " << (v) << "\n"
int N, K, max_state;
short top[kMaxS][kMaxK];
int G[kMaxS][kMaxK * (kMaxK - 1) + 1];
int src = 0, dst = 0;
int f[kMaxS];
int pow(int base, int power) {
int r = 1;
for (int i = 0; i < power; r *= base, ++i);
return r;
}
int get(int num, int d) {
for (int i = 0; i < d; num /= K, ++i)... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)