w****x 发帖数: 2483 | 1 /*
scramble string,judge if one string can be scrambled to another one
tiger
/ \
ti ger
/ \ / \
t i g er
/ \
e r
rotation is allowded
itreg
/ \
it reg
/ \ / \
t i g re
/ \
e r
then tiger can be changed to itreg
*/
bool _inner_can_scramble(const char* szStr1, const char* szStr2, int n);
bool CanScramble(const char* szStr1, const char* szStr2)
{
assert(szStr1 && szStr2);
int nLen1 = strlen(szStr1);
int nLen2 = strlen(szStr2);
if (nLen1 !... 阅读全帖 |
|
w****x 发帖数: 2483 | 2 贴一个递归和DP的:
/*
scramble string,judge if one string can be scrambled to another one
tiger
/ \
ti ger
/ \ / \
t i g er
/ \
e r
rotation is allowded
itreg
/ \
it reg
/ \ / \
t i g re
/ \
e r
then tiger can be changed to itreg
*/
bool _inner_can_scramble(const char* szStr1, const char* szStr2, int n);
bool CanScramble(const char* szStr1, const char* szStr2)
{
assert(szStr1 && szStr2);
int nLen1 = strlen(szStr1);
int nLen2 = strlen(szStr2);
... 阅读全帖 |
|
w****x 发帖数: 2483 | 3 /*
scramble string,judge if one string can be scrambled to another one
tiger
/ \
ti ger
/ \ / \
t i g er
/ \
e r
rotation is allowded
itreg
/ \
it reg
/ \ / \
t i g re
/ \
e r
then tiger can be changed to itreg
*/
bool _inner_can_scramble(const char* szStr1, const char* szStr2, int n);
bool CanScramble(const char* szStr1, const char* szStr2)
{
assert(szStr1 && szStr2);
int nLen1 = strlen(szStr1);
int nLen2 = strlen(szStr2);
if (nLen1 !... 阅读全帖 |
|
w****x 发帖数: 2483 | 4 N queen
int _inner_get_ways(int pRec[], int n, int nCur)
{
if (nCur >= n)
return 1;
int nRet = 0;
for (int i = 0; i < n; i++)
{
bool bNoneAttack = true;
for (int j = 0; j < nCur && bNoneAttack; j++)
{
if (pRec[j] == i || abs(nCur - j) == abs(i - pRec[j]))
bNoneAttack = false;
}
if (bNoneAttack)
{
pRec[nCur] = i;
nRet += _inner_get_ways(pRec, n, nCur+1);
}
}
... 阅读全帖 |
|
w****x 发帖数: 2483 | 5 int _inner_get_ways(int pRec[], int n, int nCur)
{
if (nCur >= n)
return 1;
int nRet = 0;
for (int i = 0; i < n; i++)
{
bool bNoneAttack = true;
for (int j = 0; j < nCur && bNoneAttack; j++)
{
if (pRec[j] == i || abs(nCur - j) == abs(i - pRec[j]))
bNoneAttack = false;
}
if (bNoneAttack)
{
pRec[nCur] = i;
nRet += _inner_get_ways(pRec, n, nCur+1);
}
}
return n... 阅读全帖 |
|
发帖数: 1 | 6 http://rosettacode.org/wiki/24_game/Solve#C
改一下就行了。这是输入4个的,可以改成输入3个的。
6 17 3 7: No solution
……
#include
#include
#include
#define n_cards 4
#define solve_goal 29
#define max_digit 9
typedef struct { int num, denom; } frac_t, *frac;
typedef enum { C_NUM = 0, C_ADD, C_SUB, C_MUL, C_DIV } op_type;
typedef struct expr_t *expr;
typedef struct expr_t {
op_type op;
expr left, right;
int value;
} expr_t;
void show_expr(expr e, op_type prec, int is_r... 阅读全帖 |
|
s**u 发帖数: 383 | 7 经高手指导,compile 没有问题了, 但是initial 又出问题了, 说是NIL
dereference (read), 查了manual, 说是 'NIL dereference (read)' can occur at
compilation in some circumstances when an inappropriate transformation is
made, for example an array into a scalar.用gen initial也出现同样的error.
请高人指导,谢谢。
model {
for (i in 1:k-1) {
for (j in i+1:k){
win1[i,j] ~ dbin(p[i,j], n)
logit(p[i,j]) <- d[i]-d[j]}
# p[i] <- phi(d[ind1[i]] - d[ind2[i]])
}
d[1:k] ~dmnorm(dmu[ ]... 阅读全帖 |
|
|
|
C*****H 发帖数: 7927 | 10 ☆─────────────────────────────────────☆
dumbCoder (HumbleCoder) 于 (Tue Jan 15 13:53:47 2013, 美东) 提到:
经常看到有怀疑古希腊文明有水分的帖子
http://bbs.tianya.cn/post-no01-458848-1.shtml
我是菜鸟,请版上高人指点。
☆─────────────────────────────────────☆
yenite (燕岭悲歌) 于 (Tue Jan 15 16:11:29 2013, 美东) 提到:
呵呵,要怀疑先看看原著吧,否则会闹些特洛伊不是希腊的笑话。。。
btw,为啥国内突然兴起了一股质疑希腊罗马的风气,而且还是一帮对希腊罗马没啥了
解的人?
☆─────────────────────────────────────☆
maywind (五月风) 于 (Tue Jan 15 16:31:59 2013, 美东) 提到:
这叫两手都要硬
☆────────────────────────────────────... 阅读全帖 |
|
I**********s 发帖数: 441 | 11 最喜欢 wwwyhx的解法: recursive descent.
我也写了个, 用的是建造AST, 再evaluate AST. 应该相当完整了: 数字之前可以有+-
号, 中间可以有一个小数点. 数字和运算符号之间可以有空格. 可以使用+,-,*,/,^,以
及括号. 可以检测错误输入并报出错误位置. 就是比较长, 不适合面试用. 供大家参考.
#include
#include // for pow()
using namespace std;
struct Node {
double val;
char op;
int op_prec; // precedence of operator
int type; // 0 - operand, 1 - operator
Node * left;
Node * right;
Node(double _val, char _op, int _type) : val(_val), op(_op),
type(_type), lef... 阅读全帖 |
|
I**********s 发帖数: 441 | 12 最喜欢 wwwyhx的解法: recursive descent.
我也写了个, 用的是建造AST, 再evaluate AST. 应该相当完整了: 数字之前可以有+-
号, 中间可以有一个小数点. 数字和运算符号之间可以有空格. 可以使用+,-,*,/,^,以
及括号. 可以检测错误输入并报出错误位置. 就是比较长, 不适合面试用. 供大家参考.
#include
#include // for pow()
using namespace std;
struct Node {
double val;
char op;
int op_prec; // precedence of operator
int type; // 0 - operand, 1 - operator
Node * left;
Node * right;
Node(double _val, char _op, int _type) : val(_val), op(_op),
type(_type), lef... 阅读全帖 |
|
k****r 发帖数: 807 | 13 function double sqrt(double d, int p). p is precision option. My code is as
follows. Please let me know if you see any error. Thanks,
public static double sqrt(double d, int p) {
if (d < 0) {
return Double.NaN;
}
double prec = Math.pow(10, - p);
double start = 0;
double end = d;
while (start < end) {
double mid = start + (end - start) / 2;
if (mid == 0) {
return mid;
}
if (... 阅读全帖 |
|
s**x 发帖数: 7506 | 14 if ( d < 0) return -1;
prec = ...;
start = d > 1 ? 1: d;
end = d > 1 ? d : 1;
While(1) {
m = (start + end) / 2;
v = m * m - d;
if(v > prec)
end = m;
else if( v < -prec)
start = m;
else
return m;
}
} |
|
s**u 发帖数: 383 | 15 "check model" and "load data"没问题,一complie就显示
expected multivariate node
那位有经验的讲讲这个是什么错误?
model {
for (i in 1:k-1) {
for (j in i+1:k){
win1[i,j] ~ dbin(p[i,j], n)
logit(p[i,j]) <- d[i]-d[j]}
}
d[1:k] ~dmnorm(dmu[ ], prec.Sigma[,])
## Inverse Wishart Prior for Sigma
dmu[1:k] <-0
prec.Sigma[1:k,1:k] ~dwish(Omega[,],k)
Sigma[1:k,1:k]<-inverse(prec.Sigma[,])
for (i in 1:k){ Omega[i,i] <- 0.001}
}
Data:
... 阅读全帖 |
|
s**u 发帖数: 383 | 16 "check model" and "load data"没问题,一complie就显示
expected multivariate node
那位有经验的讲讲这个是什么错误?
model {
for (i in 1:k-1) {
for (j in i+1:k){
win1[i,j] ~ dbin(p[i,j], n)
logit(p[i,j]) <- d[i]-d[j]}
}
d[1:k] ~dmnorm(dmu[ ], prec.Sigma[,])
## Inverse Wishart Prior for Sigma
dmu[1:k] <-0
prec.Sigma[1:k,1:k] ~dwish(Omega[,],k)
Sigma[1:k,1:k]<-inverse(prec.Sigma[,])
for (i in 1:k){ Omega[i,i] <- 0.001}
}
Data:
... 阅读全帖 |
|
f*****h 发帖数: 1327 | 17 that is why I prefer Prec, if you can open 1c in prec
things will get more easy, you can ask each other slowly, and effectively... |
|
k***e 发帖数: 7933 | 18 比如如下的日志什么意思? 哪里可以找到日志格式的解释?
<12>Oct 25 21:47:08 kernel: ACCEPT IN=br0 OUT=vlan2 SRC=192.168.2.xxx DST=xx
x.xxx.xxx.xxx LEN=52 TOS=0x00 PREC=0x00 TTL=127 ID=24652 DF PROTO=TCP SPT=60
695 DPT=443 SEQ=1382658461 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405
B40103030801010402)
<12>Oct 26 15:17:37 kernel: ACCEPT IN=vlan2 OUT= MACSRC=00:01:5c:6f:50:46 MA
CDST=ff:ff:ff:ff:ff:ff MACPROTO=0800 SRC=96.120.25.253 DST=255.255.255.255 L
EN=328 TOS=0x00 PREC=0x00 TTL=64 ID=20557 PROTO=UDP SPT=67 DPT=68 L... 阅读全帖 |
|
s**x 发帖数: 7506 | 19 for most of interview codes, if you have more than 10 lines, usually
something wrong.
1) for number less than 1 and great than one, it should be processed
differently.
2) why you need to check mid == 0?
3) why you need add prec to mid each time?
4) always compare with a precision for floats, do not compare directly. |
|
D*******a 发帖数: 3688 | 20 you code is wrong by checking "mid * mid == d"
you should return mid if abs(start-end)
as |
|
e******s 发帖数: 309 | 21 Pap smears are used primarily to detect cancer of the uterine cervix or prec
ancerous conditions - abnormalities of the cervix that may lead to cancer. S
ince its introduction in the early 1940's, the Pap smear is credited with sa
ving tens of thousands of women's lives and decreasing deaths from cervical
cancer by more than 70%. The key is early detection made possible by microsc
opic examination of a specially treated sample of cervical cells. Every woma
n should have an annual Pap smear as pa |
|
|
H****g 发帖数: 2273 | 23 完全跟你老公保险有关,让你老公联系他们hr benefit问一下,再看看保险条例。在这
里问是没有多少结果的,只能说一般是不用担心。
我是学生,但是马上毕业。学生保险cover到今天8月 (due day在10月),老公的保险
问过了,可以在我保险结束的时候加我。问一下因为老公加我时,我的环孕情况已经是
prec........
★ Sent from iPhone App: iReader Mitbbs Lite 7.52 |
|
|
f********a 发帖数: 244 | 25 Item Number Quantity Item Description
1 Precision Mobile Workstation M4500 Laptop
1 15.6 inch HD+(1600x900) Wide View Anti-Glare LED
1 Dell WebCam Central 1.0 software
1 Silver
1 Shipping Material
1 Dell 1501 Wireless-N
1 Certified Refurbished
1 Processor Label
1 Software
1 Integrated Webcam with digital microphone
1 Palmrest W/O Finger Print Reader
1 Miscellaneous
1 Management Eng... 阅读全帖 |
|
b****n 发帖数: 187 | 26 Warning from Harris County Constable
From HC Constable patrol Prec. #5 Be careful at gas stations & parking lots/
criminals giving free key rings with device chip There is a syndicate of
criminals presenting themselves as sales promoters who are giving free key
rings at gas stations and parking lots. The key ring has a tracking device
chip which allows the criminals to track and follow you. Please, please don'
t accept them. They select their seemingly well-to-do potential victims and
if you acc... 阅读全帖 |
|
w****b 发帖数: 623 | 27 3H. What's the problem? I haven't played prec many many years but this still
seems rather natural to show a maximum hand and I'm never too shy to show my
good heart... even off the bridge table. |
|
r*****l 发帖数: 2859 | 28 hehe, your pd has only 10 pts, no A. and not good S support, no good 牌型。
In prec, your 3H does not show that you have 15+ pts.
How dare he bit 4S? Even 3NT is not very promising bah. |
|
c****u 发帖数: 3277 | 29 if your pd jumps to 2NT or 3D or 3H, it would be more ugly.
If playing sayc or 2/1, I might bid, but not when playing prec,
Still, even if you bid, you might not find club fit. |
|
l*********r 发帖数: 65 | 30 Actually you can hardly call today's standard system "most bids are natural".
For example, talking about science as simple as major raises, today we have
3-cd constructive, 4-cd constructive, 3-cd limited, 4-cd limited, limited
forcing (or forcing limited, whatever), forcing raises, good preemptive, bad
preemptive......In the contrast, witho no agreements precision can be
extremely natural and simple too, because most openings are limited.
The real advantage for a strong club system such as prec |
|
m*e 发帖数: 155 | 31 Thanks man. I know you are a better player than I having read some of you
previous
posting. That 1N xfer scheme is interesting/new to me, although I don't get
the idea
of tranfering rather than bidding directly. However, that 1N is a SUITED one,
which
is the key here. What I don't like my p's 1N is his no fit/no suit (and I am
not
defending prec's 1N btw):
1. 6-7hcp, no fit no suit:
very truely indeed opps may well bid and make 1N, but that doesn't
justify that
we have to play 1N, or pla |
|
w****n 发帖数: 241 | 32 depends on if south had chance to bid D suite,
then maybe 6D is possible
if you forsee the necessity to use H to cover C.
but it's hard since N doesn't know how many C South has.
normally after A-inquiry, N would bid 6H for sure.
btw, SAYC or PREC ? |
|
f*****h 发帖数: 1327 | 33 晚上很无聊
adv, prec,any pd is welcome |
|
l****a 发帖数: 272 | 34 - 对方prec, 2H 不逼叫
- 我估计南家叫3D 还是想进局的意思, 可能觉得扣3H 还不够强。
- 四家牌大约是
KJxxx
xx
KQx
J10x
Ax Qx
Jxx AQxxx
Jxxx xxxx
KQxx xx
98xx
K10x
Ax
A98x
一个边缘4S, 主要看东家的首功了和后续防守,
一般来讲,做成的机会不是很大。 |
|
v**********e 发帖数: 1295 | 35 没太理解你指的是什么,是只指转移式争叫还是指某些类似的争叫约定比如CRASH。
对于1NT/1C(prec)/2C之后的争叫有很多成套的约定性争叫,1m之后的也有人设计,但
高花之后的我没见到过。 |
|
l***h 发帖数: 9308 | 36 打算下午到外面跑个5迈tempo,
看了一下天气预报,65F,10% Prec,Hum 84-87%, Wind SE 17mph
室外tempo,之前就跑过一个3迈,所以对温度、湿度、风力没太多概念,是不是有点潮? |
|
e****t 发帖数: 17914 | 37 Item Description:
-- Precision Mobile Workstation M4600 Laptop Genuine Windows 7 Professional
Unit Price: $1,319.00
Quantity: 1
-- Precision Mobile Workstation M4600 Laptop
-- Internal Backlit Keyboard - English
-- Wave Systems Software
-- 9 Cell Primary Battery
-- Information
-- Certified Refurbished
-- NVidia Quadro 1000M with 2GB GDDR3
-- Service Software
-- Service Software
-- Software
-- 256 GB Dell Mobility Solid State Hard Drive, 1.7MM
-- 15.6 inch FHD (1920x1080) Wide View Anti-Gla... 阅读全帖 |
|
b*********n 发帖数: 5846 | 38 Precision Mobile Workstation M4600 Laptop Genuine Windows 7 Professional
-- Genuine Windows 7 Professional 32-Bit Operating System DVD
-- Shipping Material
-- 15.6 inch FHD (1920x1080) Wide View Anti-Glare LED with Premium Panel
-- 8X DVD +/- RW Drive
-- 750 GB SATA Hard Drive (7200RPM)
-- AMD FirePro M5950 Mobility Pro Graphics with 1GB GDDR5
-- 180W A/C Adapter, 3P
-- Processor: Intel Core i7 2820M Quad Core 2.3GHz (8MB Cache)
-- 125V Power Cord
-- Intel 6300 Wireless-N (2x2) Half Mini-Card
--... 阅读全帖 |
|
R*o 发帖数: 3781 | 39 There is not a verse in the Bible, however, which presents Calvinism's radic
al idea that the sinner is incapable of believing the very gospel which offe
rs him forgiveness and salvation and yet he is condemned by God for failing
to believe. In fact, as we shall see, the Bible declares otherwise. "All men
everywhere" (Acts 17:30) are repeatedly called upon to repent and to believ
e on Christ. One would never derive from Scripture the idea that the unregen
erate are unable to believe. Dave Breese... 阅读全帖 |
|
R*o 发帖数: 3781 | 40 Study By: Greg Herrick
A. Introduction
“Charles Darwin died in April 1882. He wished to be buried in his beloved v
illage, but the sentiment of educated men demanded a place in Westminster Ab
bey beside Isaac Newton. As his coffin entered the vast building, the choir
sang an anthem composed for the occasion. It’s text, from the book of Prove
rbs, may stand as the most fitting testimony to Darwin’s greatness: ‘Happy
is the man that findeth wisdom, and getteth understanding. She is more prec
ious ... 阅读全帖 |
|
R*o 发帖数: 3781 | 41 Study By: Greg Herrick
A. Introduction
“Charles Darwin died in April 1882. He wished to be buried in his beloved v
illage, but the sentiment of educated men demanded a place in Westminster Ab
bey beside Isaac Newton. As his coffin entered the vast building, the choir
sang an anthem composed for the occasion. It’s text, from the book of Prove
rbs, may stand as the most fitting testimony to Darwin’s greatness: ‘Happy
is the man that findeth wisdom, and getteth understanding. She is more prec
ious ... 阅读全帖 |
|
R*o 发帖数: 3781 | 42 up
v
Ab
choir
Prove
Happy
prec
co |
|
|
d******c 发帖数: 2407 | 44 tee修改了g,现在tee修改后的函数是uniroot的输入函数,每次被调用的时候都会打印
其输入值. uniroot本身就是把那个输入函数一次次用不同的值迭代
hadley写的太过通用,要搞成一个修改函数的函数,实际上他做的只是这个
g2 <- function(x) {
cat(x, "\n")
cos(x) - x
}
uniroot(g2, c(-5, 5))
> uniroot(g2, c(-5, 5))
-5
5
0.2836622
0.8752034
0.7229804
0.7386309
0.7390853
0.7390243
0.7390853
$root
[1] 0.7390853
$f.root
[1] -2.603993e-07
$iter
[1] 6
$init.it
[1] NA
$estim.prec
[1] 6.103516e-05
这个总容易看懂了吧 |
|
j****x 发帖数: 1704 | 45 再多说几句,这个例子可能比较特别,因为患者很可能是特殊的“小三阳”。
前面有朋友说:“这个e抗原都是阴性,也就是病毒都没有复制,根本就不需要抗病毒
治疗。抗病毒治疗是针对病毒复制旺盛(俗称大三阳)的。”
这个显然是一知半解导致的完全错误的认识,也是所谓“常识”的误区。认为大三阳危
险,小三阳安全。其实是否需要治疗,和大小三阳没有必然的联系,这个只不过是乙肝
免疫学检测两对半结果的一个简单分类而已。
对于LZ母亲这个例子,其实有一定的代表性,正因为这个e抗原阴性。一般情况下,e抗
原阴性是病毒复制维持在低水平处于非活跃期的一个表现,但是眼下这个病例显然不是
这个情况,HBV DNA高于10^6 IU,非常明显病毒处于高水平复制,而为什么e抗原又是
阴性?临床上在小三阳中大约有5%的病例可能出现这种情况,绝大多数是因为患者体内
的HBV病毒出现了preC区域的突变,导致了即便病毒处于高复制水平,但是e抗原因为突
变的原因仍然是阴性。实话实说,这是一个比较危险的信号,这类病人对各种治疗的应
答明显低于普通患者,转归和预后自然也相对要差,发展为进行性肝病的几率会显著高
于一般患者。
总之,乙肝... 阅读全帖 |
|
x********g 发帖数: 47 | 46 请高手指教 。 makefile如下:
# application name
APP = parallel_femsim
# list of source files
SRC = ran2.f90 globals.f90 model.f90 scattering_factors.f90 fem1.f90
parallel_femsim.f90
# list of object files
OBJ = ran2.o globals.o model.o scattering_factors.o fem1.o parallel_femsim
.o
# define libraries needed by the linker
#LIBS = -lmkl
# compiler options for debugging
FC_DEBUG = mpif90 -g -debug -implicitnone
# compiler options for optmized running
#FC_OPT = ifort -O3 -xO -ipo -no-prec-div -static
#F |
|
w*******y 发帖数: 60932 | 47 Link:
http://www.amazon.com/Oral-B-Pro-Health-Battery-Toothbrush-Prec
Click "Clip this coupon" on the product page and proceed to checkout, where
it falls to $9.99.
Improved technology delivers more consistent battery performanceSoft,
rubberized ergonomic handleInterchangeable brush head: PrecisionClean,
FlossAction, ProWhite
|
|