由买买提看人间百态

topics

全部话题 - 话题: dist
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
R*****s
发帖数: 41236
1
☆─────────────────────────────────────☆
Rodimus (变叔 - 永动机器) 于 (Mon Jan 13 15:15:00 2014, 美东) 提到:
参加活动的进来占个楼,然后更新同一个帖子就好了,免得满版都是log贴,
请不要单独再开楼了,欢迎大家参加活动!
大使的【此恨绵绵】活动规则的link:
http://www.mitbbs.com/article_t2/Running/31713537.html
☆─────────────────────────────────────☆
Rodimus (变叔 - 永动机器) 于 (Mon Jan 13 15:17:29 2014, 美东) 提到:
我不参加最后活动奖励了,不过还是尽力坚持每天跑吧,实在跑不动了就歇.
(鞋都是inov8 155, 3.5mi都是Spin Class之后的砖头训练,跑步机上用foot pod
测的数据, 和跑步机自己的距离,速度大体吻合,不同机器,有些差异)
log:
date days score Distance... 阅读全帖
m*********g
发帖数: 273
2
来自主题: Linux版 - Debian apt-get 一问
be careful when you use dist-upgrade if you are using debian/testing or
debian/sid. Because of the broken packages, dist-upgrade could remove some
essencial packages. So please look at the apt-get message before you do dist
-upgrade.
For normal people using testing/sid, dist-upgrade is not recommended. Please
upgrade.
g****e
发帖数: 172
3
sudo apt-get update and get the following. Deos any one know how to solve it?
what's the problem?
---------------------
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/InRelease
W: Failed to fetch
http://dl.google.com/linux/talkplugin/deb/dists/stable/InReleas
W: Failed to fetch
http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg Could not
resolve 'extras.ubuntu.com'
W: Failed to fetch
http://dl.google.com/linux/talkplugin/deb/dists/stable/Release.
Could not resolve 'dl.g... 阅读全帖
g******2
发帖数: 234
4
来自主题: Statistics版 - quant analyst 一道概率的面试题
if you explore a little further:
mean.unmatch <- NULL
for (j in 1 : 100) {
dist.unmatch <-NULL
for(i in 1:100) {
dist.unmatch <- c(dist.unmatch, unmatch(j))
}
mean.unmatch <- c(mean.unmatch, mean(dist.unmatch))
}
x <- 1 / (1:100)
summary(lm(mean.unmatch ~ x)
you can see that the R^2 is almost 1.0.
I think the solution is in the form of a+b/x, where x is the number of
trials.
b*x
发帖数: 5456
5
我在其他组看到某人copy过来没有quotation的论调, 我看着应该是尼大叔的高论.
我来反驳一下.
1. SB16和SB1 都是同一堆人提议的, 猪党吗, 看看general provision就知道了. SB16
因为大家强烈反对被postpone了. 本来猪党准备在Quinn下台前强行通过的. 现在继续
来还能改方向?
2. 这个太扯, 自己看看provision . Sec. 18-8.15. Basis for apportionment of
primary State financial aid to the common schools for the 2015-2016 ---"
This formula approach imputes a level of per pupil Available Local
Resources and provides for the basis to calculate a per pupil level of
primary State financial aid that, when added to Ava... 阅读全帖
d**g
发帖数: 167
6
County of Nassau v Levine
2010 NY Slip Op 20305 [29 Misc 3d 474]
July 12, 2010
Kluewer, J.
District Court Of Nassau County, First District
Published by New York State Law Reporting Bureau pursuant to Judiciary Law
§ 431.
As corrected through Wednesday, November 17, 2010
[*1]
County of Nassau, Plaintiff,
v
Samuel M. Levine, Defendant.
District Court of Nassau County, First District, July 12, 2010
APPEARANCES OF COUNSEL
Samuel M. Levine, Long Beach, defendant pro se. John Ciampoli, County
Attorney... 阅读全帖
d**********x
发帖数: 4083
7
来自主题: JobHunting版 - A家电面被拒贡献个题攒人品吧
一个简洁一点的办法
先用O(V^3)的算法找出all pair shortest paths
设起点为S,终点为T
然后从目标点递归回溯,回溯过程中取点v,使得S到v距离加上v到其下一点u的距离之
和为S到u的距离。大体上如下:
find_path(Vertex source, Vertex target)
static list path
path.push(target)
if source == target
output path
path.pop(source)
return
for Vertex v in t.neighbors
if dist(source, v) + dist(v, target) == dist(source, target)
find_path(source, v)
path.pop(target)
w***o
发帖数: 109
8
来自主题: JobHunting版 - 问两道字符串的题
对第一题的理解有点混乱,我想可能有三种情况:
1. dist = sum_i(s1[i] - s2[i]);
2. dist = sum_i(|s1[i] - s2[i]|);
3. dist = |sum_i(s1[i] - s2[i])|;
我觉得这题本意是要考第三种情况。
f*******t
发帖数: 7549
9
来自主题: JobHunting版 - leetcode出了新题word ladder
public int ladderLength(String start, String end, HashSet dict) {
if (start == null || end == null || start.length() != end.length())
return 0;
int dist = 1;
HashSet used = new HashSet();
HashSet cur = new HashSet();
cur.add(start);
while(!cur.isEmpty()) {
HashSet newCur = new HashSet();
dist++;
for (String s : cur) {
char[] s... 阅读全帖
f*******t
发帖数: 7549
10
来自主题: JobHunting版 - leetcode出了新题word ladder
public int ladderLength(String start, String end, HashSet dict) {
if (start == null || end == null || start.length() != end.length())
return 0;
int dist = 1;
HashSet used = new HashSet();
HashSet cur = new HashSet();
cur.add(start);
while(!cur.isEmpty()) {
HashSet newCur = new HashSet();
dist++;
for (String s : cur) {
char[] s... 阅读全帖
k*******t
发帖数: 144
11
来自主题: JobHunting版 - 贡献A 家online assement
感觉应该建立个max heap, 每次比较某点距离dist和top of max heap,
if dist < max_heap.top, then pop max_heap, push dist;
else ignore, do nothing;
最后得到的就是k smallest distances啦
Z**********4
发帖数: 528
12
来自主题: JobHunting版 - linkedin电面题
已挂,发了攒人品。
有一个array ["this", "is", "a", "is", "fox", "happy"]
需要返回两个单词的最近距离(用index计算)。
int dist(string word1, string word2)
比如dist("fox", "happy") = 1
dist("is", "fox") = 1 注意“is”是有重复的。
每个单词都是有可能重复的。
Z**********4
发帖数: 528
13
来自主题: JobHunting版 - linkedin电面题
已挂,发了攒人品。
有一个array ["this", "is", "a", "is", "fox", "happy"]
需要返回两个单词的最近距离(用index计算)。
int dist(string word1, string word2)
比如dist("fox", "happy") = 1
dist("is", "fox") = 1 注意“is”是有重复的。
每个单词都是有可能重复的。
f**********t
发帖数: 1001
14
来自主题: JobHunting版 - linkedin电面题
#include "common.h"
class WordsDistance {
vector _array;
public:
WordsDistance(initializer_list l) : _array(l) {}
int dist(string word1, string word2) {
int res = INT_MAX;
size_t left = 0;
while (left < _array.size() && _array[left] != word1 && _array[left] !=
word2) {
++left;
}
if (left == _array.size()) {
return res;
}
size_t right = left + 1;
while (right < _array.size()) {
if (_array[right] == _array[left]) {
l... 阅读全帖
w****a
发帖数: 710
15
bool one_dist(Iterator&& i0, Iterator&& i1) {
int dist = 0;
while(i0.has_next() || i1.has_next()) {
bool h0 = i0.has_next(), h1 = i1.has_next();
int v0 = h0 ? i0.get_next() : 0, v1 = h1 ? i1.get_next() : 0;
if(h0 && h1) {
if(v0 == v1) continue;
else {
h0 = i0.has_next(), h1 = i1.has_next();
if(!h0 && !h1) return dist == 0;
int next0 = h0 ? i0.get_next() : 0, next1 = h1 ? i1.get_next
() : 0;
... 阅读全帖
n*****x
发帖数: 686
16
来自主题: JobHunting版 - 问道面试题,关于bst的
写了一下。不用build tree,找ancestor,求p和q到ancestor的距离即可,只是corner
case实在多,发现bug记得告诉我一声
int BST_distance(vector& nums, int p, int q){
if (p>q) return BST_distance(nums,q,p);
int ancestor=-1, grandpa=-1;
bool left;
for (int i=0; i if (nums[i]>=p && nums[i]<=q){
ancestor=i;
for (int j=i-1, dist=INT_MAX; j>=0; j--){
if (abs(nums[j]-nums[i]) if (nums[j]>nums[i]) left=true;
else... 阅读全帖
b*x
发帖数: 5456
17
来自主题: Chicago版 - 为了孩子的教育,向SB1说NO!!!
我在其他组看到某人copy过来没有quotation的论调, 我看着应该是尼大叔的高论.
我来反驳一下.
1. SB16和SB1 都是同一堆人提议的, 猪党吗, 看看general provision就知道了. SB16
因为大家强烈反对被postpone了. 本来猪党准备在Quinn下台前强行通过的. 现在继续
来还能改方向?
2. 这个太扯, 自己看看provision . Sec. 18-8.15. Basis for apportionment of
primary State financial aid to the common schools for the 2015-2016 ---"
This formula approach imputes a level of per pupil Available Local
Resources and provides for the basis to calculate a per pupil level of
primary State financial aid that, when added to Ava... 阅读全帖
g****n
发帖数: 3313
18
BUYER ONLY! NO AGENT PLEASE.
3个星期前刚进入CONTRACT的一个95051 学区房,因为买房贷款问题,现在OFF MARKET,
有兴趣的赶紧联系我,保证拿到房子。[email protected]
邻居sold for $2.6m. this Forest Park neighborhood is top of the class.
Private and wide streets. Very quiet and family friendly. Remodeled a little
bit about 10 years ago. Good condition; move-in ready.
Beds: 4
Baths: 2
Square Feet: 1,910
Garage: 2
Year Built: 1963
Area of Town: Forest Park Santa Clara
Lot Size: 7410
School District: Cupertino
S&H Score™ is 9.5, Map View
1... 阅读全帖
z**k
发帖数: 945
19
来自主题: Virginia版 - 大Richmond都会区 华人俱乐部 QQ群
标 题: Top VA High/Middle/Elementary Schools (Richmond and North VA) 2010-
11
发信站: BBS 未名空间站 (Sun Jun 10 23:02:10 2012, 美东)
没有调查就没有发言权
调查结果显示
Herico的学校并没有想象的那么好
Richmond City的学校也没有想象的那么差
Chesterfield 确实有不少好学校,特别是Middle school,
3 out of 10 best VA middle schools are in Chesterfield.
同时North VA教育是很好,但是并没有想象的那么好,很多VA很好的学校
不在北VA,不过有几个顶尖的高中在NVA
VA High School Ranking
http://www.usnews.com/education/best-high-schools/virginia/rank
Chesterfield ranking
http://www.usnews.com/education/best-h... 阅读全帖
z**k
发帖数: 945
20
来自主题: Virginia版 - 大Richmond都会区 华人俱乐部 QQ群
标 题: Top VA High/Middle/Elementary Schools (Richmond and North VA) 2010-
11
发信站: BBS 未名空间站 (Sun Jun 10 23:02:10 2012, 美东)
没有调查就没有发言权
调查结果显示
Herico的学校并没有想象的那么好
Richmond City的学校也没有想象的那么差
Chesterfield 确实有不少好学校,特别是Middle school,
3 out of 10 best VA middle schools are in Chesterfield.
同时North VA教育是很好,但是并没有想象的那么好,很多VA很好的学校
不在北VA,不过有几个顶尖的高中在NVA
VA High School Ranking
http://www.usnews.com/education/best-high-schools/virginia/rank
Chesterfield ranking
http://www.usnews.com/education/best-h... 阅读全帖
z**k
发帖数: 945
21
没有调查就没有发言权
调查结果显示
Herico的学校并没有想象的那么好
Richmond City的学校也没有想象的那么差
Chesterfield 确实有不少好学校,特别是Middle school,
3 out of 10 best VA middle schools are in Chesterfield.
同时North VA教育是很好,但是并没有想象的那么好,很多VA很好的学校
不在北VA,不过有几个顶尖的高中在NVA
VA High School Ranking
http://www.usnews.com/education/best-high-schools/virginia/rank
Chesterfield ranking
http://www.usnews.com/education/best-high-schools/virginia/dist
Henrico ranking
http://www.usnews.com/education/best-high-schools/virginia/dist
Deep Run High Sch... 阅读全帖
z**k
发帖数: 945
22
标 题: Top VA High/Middle/Elementary Schools (Richmond and North VA) 2010-
11
发信站: BBS 未名空间站 (Sun Jun 10 23:02:10 2012, 美东)
没有调查就没有发言权
调查结果显示
Herico的学校并没有想象的那么好
Richmond City的学校也没有想象的那么差
Chesterfield 确实有不少好学校,特别是Middle school,
3 out of 10 best VA middle schools are in Chesterfield.
同时North VA教育是很好,但是并没有想象的那么好,很多VA很好的学校
不在北VA,不过有几个顶尖的高中在NVA
VA High School Ranking
http://www.usnews.com/education/best-high-schools/virginia/rank
Chesterfield ranking
http://www.usnews.com/education/best-h... 阅读全帖
z**k
发帖数: 945
23
标 题: Top VA High/Middle/Elementary Schools (Richmond and North VA) 2010-
11
发信站: BBS 未名空间站 (Sun Jun 10 23:02:10 2012, 美东)
没有调查就没有发言权
调查结果显示
Herico的学校并没有想象的那么好
Richmond City的学校也没有想象的那么差
Chesterfield 确实有不少好学校,特别是Middle school,
3 out of 10 best VA middle schools are in Chesterfield.
同时North VA教育是很好,但是并没有想象的那么好,很多VA很好的学校
不在北VA,不过有几个顶尖的高中在NVA
VA High School Ranking
http://www.usnews.com/education/best-high-schools/virginia/rank
Chesterfield ranking
http://www.usnews.com/education/best-h... 阅读全帖
O****e
发帖数: 3290
24
来自主题: Running版 - 我也来奔一个mile splits
Distance: 7.24 mi (Change units)
Average Speed: 6.9 mph
Average Pace: 0:08:38/mi
Duration: Total: 1:03:16
Active: 0:59:53
Resting: 0:03:23
Difficulty: 5 / 10
Tracks
Lap 1
Dist: 1.01 mi Points: 146 Calories: 125
Time: 0:08:57 Speed: 6.9 mph Pace: 8:44 / mi
Lap 2
Dist: 1.03 mi Points: 146 Calories: 129
Time: 0:08:52 Speed: 6.9 mph Pace: 8:38 / mi
Lap 3
Dist: 1.02 mi Points: 161 Calories: 128
Time: 0:08:57 Speed: 6.9 mph Pace: 8:41
h*********e
发帖数: 75
25
来自主题: Programming版 - 雨天哭求呀。
有一段matlab代码,想对他进行小小改动,谁能帮一下忙呀?
代码中定义了一个"t"值,
这个"t"值是固定的。我现在想用一组“t"值。怎么才能实现呢.
我最初的想法是把这一系列t做成一个一维数组,让程序去读这个数组,但是不成功。
谁能帮一下呀。
for i=1:n2
dist(k,i)=x3(window,i)-x3(window,p(i,1));
if abs(dist(k,i))>t
if dist(k,i)>0
B_Short(k,i)=-1;
B_Long(k,p(i,1))=+1;
else
B_Short(k,p(i,1))=-1;
B_Long(k,i)=+1;
end
end
g*****g
发帖数: 34805
26
来自主题: Programming版 - 主力程序员离职后怎么办?
你是真不懂还是装嫩?高负载的稳定性是指系统在过载的情况下仍然能够提供degraded
service的能力,而不是直接重启还雪崩效应。而交易延迟来源于整个TCP/IP 5层协议
的实现。实现不同,延迟自然
不同。LSE能狠心把几个亿打水漂,从头写,还不就是Windows再优化也达不到延迟的要
求。
Linux有很多dist比win server贵不错。但用户有得选,大IT企业普遍采用免费的dist
,自己维护。
。典型如Goog, Amazon。小IT企业同样普遍采用流行的免费dist,因为没license cost
。金
融企业不差钱,则喜欢买redhat之类的全套服务,稳定性安全性好。所以到头来Win
Server多见于IT/金融之外的中小企业,不是没有原因的。
b***i
发帖数: 3043
27
来自主题: Programming版 - C++两个问题
希望大牛们能帮忙
1. 我在Visual Studio2015里面建了一个Solution,里面我建立了多个项目。我的最终
结果是一个可执行文件,而且最后是要在Linux下用Xilinx SDK的,这个本质就是
Eclipse。
那么,我一个项目要引用另一个项目,这个被引用的叫做Utils.Include很容易搞定。
但是类的static函数必须在cpp里面实现。结果linker说找不到symbol.这个我理解,
obj在另一个目录里。那么如何才能让主项目找到这些被引用的ojb?而且,最好不用生
成lib,我就在这个solution里面使用,不用给其他工程使用。静态编译进去就行了。
以前用Qt的时候,Qmake可以自动找到这些关联,然后生成make文件。如果我用visual
studio 2015或者Xilinx SDK (Eclipse, g++4.9.2),有这样的自动的工具吗?
2. 我看到一个生成uuid的例子,里面使用了很多C++11的技术。我想能不能把一部分
变量放进class的static 成员变量?我试过,会出现很多错误。另外,这个const char
ch_set... 阅读全帖
m*********g
发帖数: 646
28
再说了,你要非说这个DIST不MAKE SENSE,那人家气乐了,说,行,咱换个@#$@#$
DIST,你做吧。
或者就告诉你DIST是D,你讲讲你推出来了什么。
m*********g
发帖数: 646
29
再说了,你要非说这个DIST不MAKE SENSE,那人家气乐了,说,行,咱换个@#$@#$
DIST,你做吧。
或者就告诉你DIST是D,你讲讲你推出来了什么。
x*******9
发帖数: 1
30

Yes. Even if you've got the stationary dist, it's just half way down.
Now simplify the question to: putting 16 balls into 16 boxes with equal prob
, what's the dist. of the No. of empty box?
My simplification might be wrong, depends on whether I got the stationary
dist. right.
p******r
发帖数: 1279
31
well 我觉得x variable没有必要normal dist的,其实只要residue满足normal dist就
好。
不过我的y和其中一个x都很skewed,我把它们用log变来变去好像最后residue还是不满
足normal dist,所以people may question我的significance of coefficient
estimates,because t-test is not valid。。。
y*****w
发帖数: 1350
32
It seems survreg() in R and PROC LIFEREG in SAS run the same type of
survival analysis. However, when I ran both of them on a survival data, I
got different results. Both were set as exponential distribution, and have
right censored data. See below. Could anybody tell me why the results are
different? Did I miss specifying any important parameters in R? Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The R code:
survFit <- survreg(Surv(time, event, type="right") ~... 阅读全帖
g******2
发帖数: 234
33
来自主题: Statistics版 - quant analyst 一道概率的面试题
not sure how to get analytical solution. Here's my simulation:
unmatch <- function(k) {
x <- 1:1000
y <- 1:1000
for (i in 1 : k) {
x.sample <- sample(x)
y.sample <- sample(y)
match.index <- (x.sample >= y.sample)
x <- x.sample[match.index==FALSE]
y <- y.sample[match.index==FALSE]
}
length(x)/1000
}
dist.unmatch <-NULL
for(i in 1:100) {
dist.unmatch <- c(dist.unmatch, unmatch(10))
}
q********g
发帖数: 10694
34
来自主题: _Molecular_Simulation版 - 热导率计算的in文件
相关搜索: 热导率, 文件, 计算
作者: zhxlhdd2008 于 2010-10-28 16:23
看到有不少人在找热导率计算方面的in文件,我就贡献三个in文件吧,仅供参考。
同时,附件里贴出了我的计算结果。EMD的输出结果(compute heat/flux command
+compute tc command的计算结果)中, “ac.dat”(见附件中的"ac.wmf")是热流自
相关函数(我已经修改了compute_tc.cpp,目前输出的是normalized HCACF,但结果中
给出的还是没有归一化的热流自相关函数,但形状和归一化的是一样的,请注意!)随
m的变化,"tc.dat"(见附件中的"tc.wmf")是热导率随m的变化(m的涵义请参看热导率
计算的Green Kubo离散化公式,见附件"Comparison of atomic-level simulation
methods for computing thermal conductivity”中的(9)式),"tc_time.dat"(见附
件中的"tc_time.wmf")是热导率随时间的变... 阅读全帖
f****w
发帖数: 947
35
来自主题: _FanLaw版 - Maryland CIS 的近期改进
Summary of June 3, 2004 meeting with Baltimore CIS
Memo: Summary of June 3, 2004 meeting with Baltimore CIS
From: Leslie Dellon, Chair of American Immigration Lawyers Association (AILA),
DC,Chapter
Date: June 3,2004
In attendance were Richard Caterisano (Dist. Dir. CIS-Baltimore), William
Donohue (Asst. Dist. Dir. CIS-Baltimore), Barbara Johnson (Supr. Dist.
Adjudications Officer CIS-Baltimore), Shapel Hall (Exams Assistant and liaison
contact, Baltimore-CIS), Leslie Dellon (DC chapter chair), J
x**n
发帖数: 1936
36
那就给你几个例子,
Tax Rate (Year 2009)
KLEIN ISD 1.3600
HARRIS CO 0.3922
HARRIS CO HOSPITAL 0.1922
LONE STAR COLLEGE SYS DIST 0.1101
HARRIS CO ESD 16 0.0500
HARRIS COUNTY EMSD 11 0.0300
HARRIS CO FLOOD CONTRL 0.0292
PORT OF HOUSTON AUTH 0.0164
HARRIS CO DPT EDUC 0.0061
Total Tax Rate 2.1861
————————————————————————————
Tax Rate (Year 2009)
KLEIN ISD 1.3600
HARRIS CO 0.3922
CYPRESS FOREST PUD 0.3100
HARRIS CO HOSPITAL 0.1922
LONE STAR COLLEGE SYS DIST 0.1101
HARRIS CO ESD 16 0.0500
HARRIS
v********7
发帖数: 426
37
来自主题: Automobile版 - 道奇 Challenger RT Classic 咋样?
我也觉得challenger更拉风,但是它有一个死穴,而且很容易被人忽略。你要是追求性能,野马绝对优于挑战者
2011 Dodge Challenger R/T : Curb weight (f/r dist) 4078 lb (55/45%)
2011 Ford Mustang GT : Curb weight (f/r dist) 3620 lb (55/45%)
重400磅是什么概念,过个弯就知道了
v********7
发帖数: 426
38
来自主题: Automobile版 - 道奇 Challenger RT Classic 咋样?
我也觉得challenger更拉风,但是它有一个死穴,而且很容易被人忽略。你要是追求性能,野马绝对优于挑战者
2011 Dodge Challenger R/T : Curb weight (f/r dist) 4078 lb (55/45%)
2011 Ford Mustang GT : Curb weight (f/r dist) 3620 lb (55/45%)
重400磅是什么概念,过个弯就知道了
y****i
发帖数: 778
39
来自主题: Investment版 - 多少钱可以提前退休?
No, individual bonds are different with bond fund or ETF, please see bond
club to buy and sell individual tax free muni bond and taxable corporate or
muni/BAB bond.
http://www.mitbbs.com/club_bbsdoc/Bond.html
I can only recommemd corporate bonds which you can buy any time at Fidelity:
CUSIP 18683KAB7, a CLF bond coupon 4.8%, ask price $97.237, yield 5.32% till
10/1/2020 w/o call risk.
CUSIP 74348YAS0 (PSEC, coupon 5.85%) can offer you short term 4% yield to 9/
15/2014 if called or intermediate t... 阅读全帖
y****i
发帖数: 778
40
来自主题: Investment版 - 多少钱可以提前退休?
No, individual bonds are different with bond fund or ETF, please see bond
club to buy and sell individual tax free muni bond and taxable corporate or
muni/BAB bond.
http://www.mitbbs.com/club_bbsdoc/Bond.html
I can only recommemd corporate bonds which you can buy any time at Fidelity:
CUSIP 18683KAB7, a CLF bond coupon 4.8%, ask price $97.22, yield 5.32% till
10/1/2020 w/o call risk.
CUSIP 74348YAS0 (PSEC, coupon 5.85%) can offer you short term 4% yield to 9/
15/2014 if called or intermediate te... 阅读全帖
g*******y
发帖数: 1930
41
来自主题: JobHunting版 - 微软面试题一道
我们算法课作业题
用suffix当然是最好的
不会suffix的话,用DP有两种复杂度
一种是O(A.size * B.size * dist.size)
一种是O(dist.size^2)
l********e
发帖数: 6
42
来自主题: JobHunting版 - amazon question
My solution:
use each element of B as hash table key, a link list as value that contains
the positions this element appear in A. For example:
5 => 2,5
3 => 0,4
Next, the problem becomes find the min(dist(b1,b2,b3,...)):
1) scan link list head for all keys, find the min,max position, record min_
dist =max-min so far
2) move to next link for the link list with min position, calc distance with
max
3) loop 2) until no position available in the link list with min pos so far
For this example:
1) min =
l********e
发帖数: 6
43
来自主题: JobHunting版 - amazon question
My solution:
use each element of B as hash table key, a link list as value that contains
the positions this element appear in A. For example:
5 => 2,5
3 => 0,4
Next, the problem becomes find the min(dist(b1,b2,b3,...)):
1) scan link list head for all keys, find the min,max position, record min_
dist =max-min so far
2) move to next link for the link list with min position, calc distance with
max
3) loop 2) until no position available in the link list with min pos so far
For this example:
1) min =
B*****t
发帖数: 335
44
来自主题: JobHunting版 - 刚刚被Google电面了,真失败
this is right!在head到end之间进行二分,还可以降低复杂度了。
注意到dist(head, i) and f(k-1, i, end)>=f(k-1, j, end) for i
r****o
发帖数: 1950
45
来自主题: JobHunting版 - GOOGLE电面到ONSITE
我的想法是用一个vector来存{c,b,a},并且记载每个元素出现次数,元素在vector中
按出现顺序从大到小排列。如果distance大于vector.size(),且vector中存在至少一
个元素出现>=2次,则无解。比如说distance=4, vector.size()=3, a出现2次, b,c各
一次,无解。
每次在vector中取dist个元素(unique)放到output中相应位置,然后对vector重新排逆
序。
若vector中剩下不到dist个元素,则
如果存在至少一个某元素出现>=2次,无解;
否则将残余元素拷贝到output数组后面。
例如:
Input: {c, 4}, {b, 2}, {a, 1}, Distance 2
Output: c, b, vector {c3,b1,a1}
c, b, c, b, vector{c2,b0,a1} -> resort {c2,a1,b0}
c, b, c, b, c, a, vector{c1,a0,b0}
c, b, c, b, c, a,
b*******8
发帖数: 37364
46
来自主题: JobHunting版 - 尘埃落定里的两道题
#6主体DP代码大概如下吧(未测试)
//0~N-1
min[0][0] = 0;
for (int i=1; i min[0][i] = MAX_INT;
for (int i=1; i for (int j=0; j if (min[0][i] < min[0][j] + dist[j][i]) {
min[0][i] = min[0][j] + dist[j][i];
last[i] = j; //last[] 用来回溯路径
}
s********g
发帖数: 29
47
来自主题: JobHunting版 - 问个字符串距离的问题
就是那个经典的比较两个字符串距离的问题,看两个字符串需要多少步变换才能成为相
同的字符串。我用递归写的,可是死活不对。谁给指点一下问题在哪儿?
这是我的C# code:
public int CalcDistance(string src, int srcBegin, int srcEnd, string
dst, int dstBegin, int dstEnd)
{
if (srcBegin > srcEnd)
{
if (dstBegin > dstEnd)
return 0;
else
return dstEnd - dstBegin + 1;
}
if (dstBegin > dstEnd)
{
if (srcBegin > srcEnd)
... 阅读全帖
S******t
发帖数: 151
48
来自主题: JobHunting版 - 问一道题(groupon)
假设这两点是u, v,枚举剩下的点w,计算dist(u,w) + dist(w,v),给出second
shortest就行了

getShortestPath
Y**Y
发帖数: 66
49
来自主题: JobHunting版 - 问一道题(groupon)
这个不行:
三角形:abc, ab: 3, ac: 1, bc 1:
a->b最短路径 a->c->b.
如果第二短路径的定义是可以和第一短相同的话,所有剩下的边(x,y), 计算dist(u,x)
+w(x,y)+dist(y,u),找出最小。否则很难。
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)