由买买提看人间百态

topics

全部话题 - 话题: subtract
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
t*********r
发帖数: 845
1
来自主题: JobHunting版 - find the first missing positive integer.
新手,欢迎大家拍砖
假设数组有n个大于0的而且不重复的整数,
(1) sum all elements, if sum=n(n+1)/2, then we know its n+1
(2) if not, compare with n/2, we will have two new arrays, one contains
elements <= n/2, one >n/2. Subtract the second one with n/2. find the sum of
first array, if sum=n'(n'+1)/2, the missing element must be in the second
array
(3) split the second one into two by comparing with n/4, and repeat again..
s******e
发帖数: 108
2
来自主题: JobHunting版 - make matrix all 0
Given an N x M matrix having only positive values, we have to nullify the
matrix i.e make all entries 0.
We are given two operations
1) multiply each element of any one column at a time by 2.
2) Subtract 1 from all elements of any one row at a time
Find the minimum number of operations required to nullify the matrix.
Note: no range of input was given
s*****n
发帖数: 162
3
来自主题: JobHunting版 - G题一道(2)
Given an N x M matrix having only positive values, we have to nullify the
matrix i.e make all entries 0.
We are given two operations
1) multiply each element of any one column at a time by 2.
2) Subtract 1 from all elements of any one row at a time
Find the minimum number of operations required to nullify the matrix.
Note: no range of input was given
http://www.careercup.com/question?id=14691685
l***i
发帖数: 1309
4
来自主题: JobHunting版 - 贡献一道M的链表题
bonus point, if subtraction results in leading zeros, remove them.
e.g.
123 - 123 = 0, you need to remove the two leading zeros.
c***p
发帖数: 221
5
Two's complement 居多。比如: x86, amd64, sparc都用 Two's complement.
http://en.wikipedia.org/wiki/Two's_complement
The two's-complement system has the advantage that the fundamental
arithmetic operations of addition, subtraction, and multiplication are
identical to those for unsigned binary numbers (as long as the inputs are
represented in the same number of bits and any overflow beyond those bits is
discarded from the result). This property makes the system both simpler to
implement and capable of eas... 阅读全帖
b******b
发帖数: 300
6
来自主题: JobHunting版 - 问一个c++ 函数指针的问题
class Calculator{
public:
int add(int a, int b){
return a+b;
}
int subtraction(int a , int b){
return a-b;
}

};
typedef int(Calculator::*CalPointer)(int,int);
int _tmain(int argc, _TCHAR* argv[])
{
CalPointer fun;
fun = Calculator::add;
fun(2,4);
}
总是报错,求问 应该怎么写函数指针啊
j*****y
发帖数: 1071
7
来自主题: JobHunting版 - 问一个c++ 函数指针的问题
加一个地址符号
fun = &Calculator::add;

class Calculator{
public:
int add(int a, int b){
return a+b;
}
int subtraction(int a , int b){
return a-b;
}

};
typedef int(Calculator::*CalPointer)(int,int);
int _tmain(int argc, _TCHAR* argv[])
{
CalPointer fun;
fun = Calculator::add;
}
总是报错,求问 应该怎么写函数指针啊.................
h**6
发帖数: 4160
8
来自主题: JobHunting版 - 问一个c++ 函数指针的问题
class Calculator{
public:
int add(int a, int b){
return a+b;
}
int subtraction(int a , int b){
return a-b;
}
};
typedef int(Calculator::*CalPointer)(int,int);
Calculator calc;
CalPointer func1 = &Calculator::add;
int a = (calc.*func1)(2, 3);
std::function func2 = std::bind(&Calculator::add, &calc, _1, _
2);
int b = func2(4, 5);
printf("a=%d, b=%d\n", a, b);
w********p
发帖数: 948
9
来自主题: JobHunting版 - 最失败的一次onsite - bloomberg
evaluator (String expression)
1。将expression parse 成三块 expr1 operator expr2
2 。如果expr1, expr2 都是数字,return 计算结果。 比如6*6
3。 不然,如果operator 是乘除的话,parse 来string2里的第一个数字,得到结果
4. 再不然,recursively call for rest expression.
有两个links很好和大家分析。
http://www.strchr.com/expression_evaluator
http://compsci.ca/v3/viewtopic.php?t=21703
把网上的code帖出来,给爱偷懒的同伙。我还没仔细看。
无意中运行了下面的code,并不能handle所有的cases 。个人还是喜欢stack的版本。
不会没关系,学学就会了吗。呵呵, 会了不用还是会忘嘛。
本科compiler课是要用java写一个compiler出来的。还有微积分,还给老师的知识还少
嘛?。。。
/*
* The "ExpressionEv... 阅读全帖
g****e
发帖数: 141
10
来自主题: JobHunting版 - 招accountant
急招一位accountant,公司在DC metro
plz send resume to gstide[at]hotmail.com
請勿發站內信,謝謝!
GENERAL DESCRIPTION
Assists professional accounting personnel in performing duties that require
judgment, working knowledge of applicable accounting principles and internal
procedures. Requires a knowledge and understanding of accounting
terminology, account and transaction codes and procedures for operating a
comprehensive computerized accounting system for professional service
industry.
To perform this job successf... 阅读全帖
w*******s
发帖数: 138
11
import java.math.BigInteger
BigInteger result = new BigInteger("123").subtract(new BigInteger("456"));
l*n
发帖数: 529
12
无聊写了个。a、b都是正数,其他符号的组合可以另写个wrapper函数。
String subtract(String a, String b) {
boolean minus = false;
if (b.length() > a.length() || b.length() == a.length()
&& a.compareTo(b) < 0)
minus = true;
if (minus) {
String tmp = a;
a = b;
b = tmp;
}
int alen = a.length();
int blen = b.length();
StringBuilder sb = new StringBuilder(
new String(new char[a.length()]).replace('\0', '0'));
int carry = 0;
for (int i = 0; i < a.length();... 阅读全帖
r**********o
发帖数: 50
13
来自主题: JobHunting版 - 一道面试题,觉得有更优化解
Given a target number and a set of numbers, using only addition,
multiplication, division and subtraction and the set of numbers get as near
to the target as possible
楼主想到的一个解法是用5向递归。具体代码怎么factor才简洁不知道~
function : void getNearest(numbers,target,tempTarget,path,re,visited)
base case :
tempRe = target;

getNearest( .. ,target/current, ...)
getNearest( .. ,target*current, ...)
getNearest( .. ,target+current, ...)
getNearest( .. ,target-current, ...... 阅读全帖
s**x
发帖数: 7506
14
来自主题: JobHunting版 - 求教一个, Leetcode 题.
I believe leetcode provide a simple solution which may overflow, but
actually it is correct.
You can simply use unsigned int. I would think even an int would work as
well.
bool isPalindrome(int num) {
if(num < 0) return false;
unsigned int oldNum = num;
unsigned int rev = 0;
while (num != 0) {
rev = rev * 10 + num % 10;
num /= 10;
}
return rev == oldNum);
}
The following is from gnu comments.
13.2.1 Basics of Integer Overflow
In languages like C, unsigned integer overflow ... 阅读全帖
l*y
发帖数: 70
15
来自主题: JobHunting版 - A面筋
有点晚, 3月的。 当时是个event,所以只面4轮,其中一轮behavioral,两轮程序一轮
设计。
--------------------------------------
Coding
1. Support undo and redo on a picture.
-- Two stacks, one for each
2. Now each command has a cost and we need peekMax() to get the most
expensive command so that we can potentially save the snapshop (of pic) and
store it to server for that command. How do you support the peekMax() method?
-- Suggested a heaping Heap and the stack are just pointers. O(lgn)
-- Hinted to get O(1) with an example
-- So... 阅读全帖
z******g
发帖数: 271
16
来自主题: JobHunting版 - 问一问这个题。
如果不需要把次数用完的话,俺感觉可以用greedy
while(n > 0) {
Find the leftmost array position which is not filled
with optimal number, break if not found;
For each number on the right, calculate its distance
to the position;
Find the largest number with distance <= n, swap it to
the position and subtract n by distance;
}
s********x
发帖数: 81
17
这是网上看到的别人的解答。
http://www.careercup.com/question?id=4827656025538560
Use a ring buffer (circular queue) of type Message of size 5000*60*10 which
is 3000000B or 3MB. The memory footprint will be 3MB*sizeof(Message) so that
gives us upper limit of 100MB (string ticker are no more than 4B and fixed
length for int64/double).
Maintain a rolling sum (type double) and every time adding a stock price,
add it to sum and subtract the last purged value.
Simply return sum/Total entries
Y******g
发帖数: 10
18
小硕一枚,刚转专业一年,因为前期一直focus在修课跟实习上没把找工作放上行程。
因为课程提前修完了,论文也搞完了这个暑假可以提前毕业。这一两个月开始正式着手
找工作,投了一些简历也没什么回复,有些小焦急。努力吭哧吭哧刷题中,希望有
refer机会的站内LZ。
最近电面了三家公司(除了Epic),一家聊得挺好的,tech manager也挺满意的样子(或
许是我的错觉),可是电面第二轮都过了两周了还没有消息。是不是可以move on了?
再求问一下,如果想毕业后relocate到Cali,是不是现在要开始投了?我觉得大公司我
连简历那一关都过不了,小公司可能不会考虑一个那么远的。请版上大牛们提供一些愿
意收本科non-CS的fresh grad的公司名字吧。先谢谢啦!
====================================================================
Section1(IQ):10个题,都不难,我做到第九个答案算出来没来得输入就time up了
。提示:计算器,纸,笔什么的一定要提前standby,我就捣鼓了一下计算器耽误了不少
时... 阅读全帖
o**********e
发帖数: 18403
19
来自主题: JobHunting版 - NY Times那个h1b的影响很大啊

Imagine 1.5 million Indian H1b/L1
NEPOTISTS are subtracted from the 3 million American IT work place.
Nasscom 怒了,坚决要插管吸血,即使
吸血的部位是老美和全世界的大脑。
http://economictimes.indiatimes.com/tech/ites/h-1b-visa-row-nas
原文在这里:
http://www.nytimes.com/2015/06/04/us/last-task-after-layoff-at-
BRIGHTFUTUREJOBS 征集签名BOYCOTT DISNEY的在这里:
boycottdisney-brightfuturejobs.nationbuilder.com

发帖数: 1
20
The description of the problem is : Write a function which takes a positive
integer as a string and returns the minimum number of operations needed to
transform the number to 1. The number is up to 309 digits long, so there won
't too many character than you can express in that many digits. The
transform process is limited to three operations: 1. Add 1 2. Subtract 1 3.
Divide the number by 2 (only even number allow here)
我的想法是用dfstraverse所有可能, 用memorization来剪枝,但是最后还是超时了,
求教如何进一步优化或者一种方法处理。 因为输入时... 阅读全帖
o****e
发帖数: 417
21
阿三简历包装和相关技术令人发指,所有网上材料都是包装
举一个今天我发觉的阿三的包装简历为例,它实际经验美国学习9个月美国工作0个月本
国实习3个月,但是简历写得好于是HR发给我看,而且在github上像模像样搞了一个项
目,把别人的很复杂的代码拷贝过来,每隔一两周加一两个无关文件,看起来很厉害,
实际上什么也没做。但是这个很容易糊弄HR和没时间的经理。另外还在阿三国参加假的
高科技公司实际是一个培训公司,然后在美国某些创投网站上发布自己的一个假的公司
,自己作为唯一员工,开发机器人技术,实际上都是骗人的。
简历如下(人名省略):
OBJECTIVE: Summer Internship/ Co-op in Robotics Engineering with focus on
perception, learning and planning.
EDUCATION: Worcester Polytechnic Institute (WPI), Worcester, MA
... 阅读全帖
g****3
发帖数: 142
22
All,
I am hiring a full time quality engineer III reporting directly to me.
Sorry but no sponsorship, no OPT.
Direct Hire.
Based in Houston TX. TX candidates preferred.Not sure about any relo.
Pays up to 80k/yr with full benefits
Please send your resume to [email protected] if you are interested.
Thanks a lot.
Essential Job Duties and Responsibilities:
Quality Management System
• Responsible for developing, maintaining, and auditing Igoo’s
Quality Management System (QMS) in accorda... 阅读全帖
d***n
发帖数: 12
23
来自主题: JobMarket版 - 寻找Genomics方面的专家
寻找Genomics方面的专家
我们也想借未鸣空间的宝地,公开求贤,寻找Genomics方面的专家,共同创业。
专业方向:
Next Gen DNA sequencing
Roche 454 Genome Sequencer FLX Standard and FLX Titanium
Solexa technology
Applied Biosystems SOLiD
Whole Genome Analysis
PCR Amplicon Sequencing
Metagenomics
Transcriptomics
Small RNA Analysis
Epigenetics
Genome sequencing and re-sequencing
ABI 3730xl, 3130xl
Amersham MegaBACE 4000 and 1000
文库构建
cDNA libraries (including standard cDNA library, large insert cDNA library,
normalized cDNA library and subtracted c
i***k
发帖数: 386
24
来自主题: Living版 - 今天rate怎么样了?
Market Update
Treasuries rally this morning after the GDP comes in worse than anticipated
at 5.6% versus the previous readings of 5.9%. The increase in real GDP in
the fourth quarter was primarily caused by positive contributions from
private inventory investment, exports, personal consumption expenditures,
and nonresidential fixed investment. Imports, which are a subtraction in the
calculation of GDP, increased. Next week we have nonfarm payrolls on
Friday, and thankfully no auctions until th
i******d
发帖数: 565
25
来自主题: Living版 - 买房出现问题了。。。。。。
搜索了一下。严格的说不算high celing二楼上的面积,但是通常county record和
appraisal都会算这部分面积的。估计跟location也有关系,至少我这边都是算计去的
。房子面积的计算没有完全精确的标准。从网上copy一段这方面的讨论。
What if the house in our example has a vaulted ceiling in the family room
with a second story balcony? This would clearly result in the second floor
having less than 625 square feet of actual floor area. Most appraisers won't
subtract the space left out of the second floor to make room for the
vaulted ceilings. Why? Because such a floor plan often enhances the market
p*******s
发帖数: 516
26
没有heated的房间是不能算入面积的。而且面积是从外面算出来的,不是room + room.
我也发现过这个问题。
2个房子,有一个每个房间都比另外一个大,但总面积却小一些。我问过我的agent,他
的回答是:
As far as the square footage the houses are measured on the outside by an
appraiser and they come inside and make sketches to subtract from non heated
and cooled areas. Many times it is difficult to give value to a house
strictly
on square footage unless the homes are exactly identical.
i******k
发帖数: 1078
27
In the US, the standard length for studs (the vertical boards that sustain a
wall) is 92 5/8". In making a wall, the studs are fastened to 2 x 4 sill
plates at the bottom, and a doubled top plate at the top. The top and bottom
plates, all 2 x 4's (in most cases), are nominally 1.5" in thickness. That
makes the total thickness of the plates 4 1/2 inches.
The sill plate is attached to the floor, and the ceiling joists rest on the
uppermost top plate. So, from floor to ceiling, in a framed structur... 阅读全帖
N*****t
发帖数: 209
28
来自主题: Living版 - 买房代理给回扣的方式和利弊
我used 4种方式给我的客户回扣
1:双方谈好价格以后,seller further reduces the agreed price by the rebate
money and then subtract the rebate money from my commission. This is the
easiest way and nobody needs to pay tax and won't show on HUD . But the
seller and other agent have to agree , it won't work for relocation company.
2: 回扣直接写进合同。this rebate money will show as a credit from buyer
agent in the HUD. It has to be agreed by the seller, title company and the
lender. Since buyer agent rebate is a new thing, not many... 阅读全帖
g********3
发帖数: 1281
29
You forgot interest expense. The total operating income is lower than your
number after subtracting interest expense.

have
for
p**********g
发帖数: 9558
30
http://www.getarebaterealestate.com/about_the_rebate_116454.htm
Any real estate attorney will also confirm that rebates are allowed, we have
actually worked with several of them, and below is an attorney, tax expert
and author who confirms that no tax consequences are involved with the
rebate. Per the Department of Justice and the IRS, the rebate lowers the
cost of the home, saving you money. To have to pay tax on that would be like
trying to tax you on the amount you negotiated to a lower price... 阅读全帖
l****g
发帖数: 5080
31
That is not always true. At least not in area where house price increases
rapidly. You have to subtract all price gain from cost, you might get
negative cost after done that, meaning later buyer pays you to live in the
house.
y*****g
发帖数: 193
32
来自主题: Medicine版 - Should I let my son take Keppra?
I understand you are concerned about side effects of Keppra. Acutally, all
antiepilectic drugs have side effects, and keppra as the newest one has less
side effects compared with old meds. Keppra is also thought to be very
broad spectrum and safe.
One of my coworker daughter was put on Keppra for post-occiptial region
seizures. She had been on Keppra for 2 years, a very active volleyball
player through these years. She was just taken off the medication recently.
So far, so good.
I just had an ep... 阅读全帖
n*******y
发帖数: 3337
33
来自主题: Money版 - 呵呵,CHASE很好玩。 (转载)
【 以下文字转载自 EasyMoney 俱乐部 】
发信人: newjersey (NJ furniture dealer), 信区: EasyMoney
标 题: 呵呵,CHASE很好玩。
发信站: BBS 未名空间站 (Tue Mar 27 15:21:29 2012, 美东)
Two sides of Chase
I called the Chase Sapphire customer service desk twice this week. The
first call was a disaster. The second was awesome. Read on.
Background:
Recently I posted how to get huge savings at Kohl’s by buying discount gift
cards, going through Ultimate Rewards Mall, and applying a 20% off coupon.
There was some speculation in the comment... 阅读全帖
y****i
发帖数: 17878
34
card activity -> choose "year to date", subtract credit, then add pending
charges
r******i
发帖数: 610
35
check your credit report
or subtract 1 month from your first statement date
x****g
发帖数: 1512
36
withhold的没有超过去年该交的总额?
Generally, most taxpayers will avoid this penalty if they owe less than $1,
000 in tax after subtracting their withholdings and credits, or if they paid
at least 90% of the tax for the current year, or 100% of the tax shown on
the return for the prior year, whichever is smaller.

exception
d**********n
发帖数: 3634
37
A "debit" is a subtraction and "DDA" means checking account. You should
contact your bank directly for information about exactly WHY your account
was debited, but here are some possible reasons:
- You requested a transfer to another account from your checking account,
and a DDA debit form was used to complete the transfer
- You are overdrafted on another account or owe the bank money and they have
recollected their loss by debiting your checking account
- You deposited checks and totaled them wr... 阅读全帖
x*******i
发帖数: 1590
38
来自主题: Money版 - $5 off $50 at Walmart.com paypal
Merchant Terms
Offer ends 09/29/2014 at 11:59 PM (EST). Other restrictions may apply.
PayPal Terms
You will receive a discount on your next purchase when you use PayPal and
spend the minimum purchase amount at participating stores ("Offer"). Offer
valid at participating stores 12:01 AM EST on the start date through 11:59PM
EST on the expiration date stated on the Offer. Discount will be applied to
merchandise after sales tax has been added and will be subtracted from your
total at checkout.
To a... 阅读全帖
C*****8
发帖数: 102
39
来自主题: Money版 - 求助我这个情况该怎么办
You won't get the refund unless it is a refundable ticket. However, you will
get some (if not all) UA credit (in dollar amount) usable for future
booking (usually within one year), minus whatever applicable fees or
subtractions.
l*********3
发帖数: 292
40
We've had an amazing 2014, introducing more IPOs to the general public than
ever before - with brands such as Santander Consumer USA, GoPro and Dave &
Buster's. And we've added many new stocks, including most recently, Kraft
Foods.
Through the success, we've also learned a lot about how people use LOYAL3.
Credit cards have become a common method for people "gaming" LOYAL3 to gain
credit card points and not for the purpose of investing. This increases our
costs and subtracts from our mission of m... 阅读全帖
c**2
发帖数: 8496
41
Went to office max across town last night, the head 小二 said $20 of $300 or
more, but did not acknowledge the coupon code or $40 off $600. So I only
bought 2x $200 cards for $20 off, and he manually subtracted $20 on the
registry.
b*****s
发帖数: 540
42
买啥?
$15 off a purchase of $15 or more at
1-800-Flowers.com when you pay with PayPal.
Terms apply. See Offer terms below.
Offer expires 9/5/15.
PayPal Terms
You will receive a discount on your next purchase when you use PayPal and
spend the minimum purchase amount at participating stores ("Offer"). Offer
valid at participating stores 12:01 AM EST on the start date through 11:59PM
EST on the expiration date stated on the Offer. Discount will be applied to
merchandise after sales tax has been added... 阅读全帖
j****2
发帖数: 759
43
来自主题: Money版 - Amazon $10 free money for one-click
Get $10 off at Amazon.com by changing your 1-Click default payment method to
an eligible Discover card.
Term and Conditions
This offer is valid for a limited time only. Amazon reserves the right
to modify or cancel the offer at any time.
Credit is valid for $10 off the purchase of physical products sold and
shipped by Amazon.com, and excludes Gift Cards, Kindle eBooks, instant
videos, MP3s, and all other digital downloads and content. Credit may be
redeemed in one or more orders. You wil... 阅读全帖
j****2
发帖数: 759
44
来自主题: Money版 - Amazon $10 free money for one-click
Get $10 off your next card purchase of qualifying products from Amazon.com
by changing your 1-Click default payment method to an eligible Citi credit
card.
Terms & Conditions
This offer is valid for a limited time only. Amazon reserves the right
to modify or cancel the offer at any time.
Credit is valid for $10 off the purchase of physical products sold and
shipped by Amazon.com, and excludes Gift Cards, Kindle eBooks, instant
videos, MP3s, and all other digital downloads and content. Cr... 阅读全帖
k**u
发帖数: 10502
45
【 以下文字转载自 Automobile 讨论区 】
发信人: kuku (小黄猫), 信区: Automobile
标 题: Diminished Value Claim Won in California Superior Court
发信站: BBS 未名空间站 (Sat Jul 16 17:27:28 2016, 美东)
Just received the small claim appeal court’s judgement in my favor. Here is
the story.
In last December my car was rear-ended by a negligent driver. Claim was made
to Allstate Insurance, the at-fault driver’s insurance company. Two weeks
later, we discovered additional damages. Supplemental claim was made.
Allstate quickly denied t... 阅读全帖
N*****5
发帖数: 502
46
The method for qualifying for a higher rate of interest (6.00% APY vs. 2.00%
APY on the first $5,000 in savings) on the funds held in your Mango Savings
Account has changed. In order to qualify for the higher 6.00% APY for a
calendar month, you will have to have “net direct deposits” $800 or more
to your Mango Card Account during the calendar month. Each month we will
calculate net direct deposits by calculating the total amount of ACH direct
deposits to your Mango Card Account for the month a... 阅读全帖
N*****5
发帖数: 502
47
The method for qualifying for a higher rate of interest (6.00% APY vs. 2.00%
APY on the first $5,000 in savings) on the funds held in your Mango Savings
Account has changed. In order to qualify for the higher 6.00% APY for a
calendar month, you will have to have “net direct deposits” $800 or more
to your Mango Card Account during the calendar month. Each month we will
calculate net direct deposits by calculating the total amount of ACH direct
deposits to your Mango Card Account for the month a... 阅读全帖
s******k
发帖数: 6659
48
来自主题: Money版 - HSA
I remember seeing this question, but am still not quite clear how HSA works
in medical cost deduction.
Does HSA has the highest rank in deductions? Say if I visit a doc and incur
$500 charges, would that money be subtracted from my HSA first? Does
insurance company only comes into play when I incur more than $XXXX.XX in
medical spend per year?
s*******2
发帖数: 2898
49
According to the Internal Revenue Service (IRS), credit card rewards may be
taxable as income. The types of rewards and the way in which you receive
them determine whether they are considered taxable. In many cases, the
rewards are viewed by the IRS as a discount, not as income. For example, a
cash-back program for using your credit card is treated as if it were
actually a post-purchase discount. There are some credit card reward
programs that offer large sign-up bonuses, however, which the IRS ... 阅读全帖
b*******c
发帖数: 20683
50
来自主题: Money版 - 失算了,税提前扣多了
看情况吧,欠税不被罚款还是很有可能的。我家每年欠税,从来没被罚款过。
Generally, most taxpayers will avoid this penalty if they either owe less
than $1,000 in tax after subtracting their withholding and estimated tax
payments, or if they paid at least 90% of the tax for the current year or
100% of the tax shown on the return for the prior year, whichever is smaller.
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)