l*********8 发帖数: 4642 | 1 my 2 cents:
in[k]: k列棋盘时,从最后一列开始的哈密尔顿路的数目
inout[k]: k列棋盘时,从最后一列开始且回到最后一列的哈密尔顿路的数目
inout[0] = 1;
inout[1] = 2;
in[0] = 1;
in[1] = 2;
inout[k] = 2*inout[k-1];
in[k] = 2*in[k-1] + 2*inout[k-1] + 4*inout[k-2];
最终答案:
count[n] = 2*in[n] + sum(4*inout[i]*in[n-i-1] | 1<=i<=n-2) |
|
l*********8 发帖数: 4642 | 2 刚才测试了一下,我的算法也是正确的。
贴个小数据版的程序(没加mod)
int solveSmall(int n) {
if (n < 1) return 0;
vector in(n+1), inout(n+1);
inout[0] = 1, inout[1] = 2;
in[0] = 1, in[1] = 2;
for (int k=2; k<=n; ++k) {
inout[k] = 2 * inout[k-1];
in[k] = inout[k] + 2 * in[k-1] + 4 * in[k-2];
}
int count = min(2, n) * in[n];
for (int i=1; i<=n-2; ++i)
count += 4 * inout[i] * in[n-i-1];
return count;
} |
|
z*******n 发帖数: 1034 | 3 来自主题: MobileDevelopment版 - Swift 出现了个func,既不是个word也不是众所周知的abbreviation
Keywords and Punctuation
The following keywords are reserved and can’t be used as identifiers,
unless they’re escaped with backticks, as described above in Identifiers.
Keywords other than inout, var, and let can be used as external parameter
names in a function declaration or function call without being escaped with
backticks.
Keywords used in declarations: associatedtype, class, deinit, enum,
extension, func, import, init, inout, internal, let, operator, p... 阅读全帖 |
|
d******3 发帖数: 1028 | 4 nonono
should be
chickfla
bk
MD
KFC
TacoBell
Wendy
Subway
QSub
INOUT
PIZZAHUT
chipotile
cici |
|
|
|
l******c 发帖数: 2555 | 7 I don't think so.
Please read stl source code.
input : aaaaaaaa
output: aaaaaaaa
inout: aaab
output: aaab,aaba, abaa, baaa
so, basically, during the interview, if they have question about your answer
, you need ask them if the string has duplicate char or not.
递归 is right if there no duplicate char, but not good solution |
|
l*****a 发帖数: 14598 | 8 我同意你扫描一遍inout array就可以完成
问题是对于其中某个/些值,有可能需要在当前路径上回溯来判断需要插在哪个位置
所以我不认为这是O(n)
max_
是[
parent |
|
b**********y 发帖数: 144 | 9 有没有免费或低价的unlimited video hosting服务,我的有一两个小时长的video.
Thanks for any inout. |
|
b**********y 发帖数: 144 | 10 有没有免费或低价的unlimited video hosting服务?,我的有一两个小时长的video.
Thanks for any inout. |
|
|
R*****s 发帖数: 41236 | 12 我又好奇查了一下,100公里是国际田联IAAF唯一承认的ultra distance:
http://www.iaaf.net/statistics/records/inout=o/discType=5/disc=
男子女子100公里世界纪录都是日本人:
男子
6:13:33 Takahiro Sunada 19/01/1973 JPN Tokoro 21
/06/1998
女子
6:33:11 Tomoe Abe 13/08/1971 JPN Yubetsu 25/06/
2000
Ann Trason是全美洲女子第一:
7:00:48 Ann Trason 30/08/1960 USA Winschoten 16/
09/1995
破任何项目的世界纪录,都是无穷难的...当然,如果日本人能做到,咱老中也应该能
做到不是... |
|
|
|
p****i 发帖数: 5597 | 15
我倒是发现西雅图一家Local店的汉堡很好吃,不知道跟inout比如呢,下次你要是跟你
老婆来访西雅图的话,俺就请你们吃~~ |
|
z**d 发帖数: 25 | 16 【 以下文字转载自 Military 讨论区 】
发信人: zgdd (inout), 信区: Military
标 题: 江城子,送文兄一程
发信站: BBS 未名空间站 (Wed Apr 14 11:32:32 2010, 美东)
潮汐袭来死何诉,
老将喜,小将悦,
网上波澜,贴贴振臂呼。
就博草民强一笑,
纵做鬼,也幸福。
汪洋大海难救赎,
望励君,要知足,
多难兴帮,亲历死也足。
只盼坟前有屏幕,
看世博,同欢呼。 |
|
he 发帖数: 2025 | 17 SIP:
CUBE#debug voip ccapi inout
CUBE#debug ccsip message
H.323:
GW#debug isdn q931
打两个电话一看便知,时间充裕的加上CUCM trace,刨根问底的上wireshark,哈哈 |
|
c***c 发帖数: 6234 | 18 I was using EJB web services. Now I found that RPC web services is much
simpler. It also has OUT, INOUT parameter. RPC web serivces can be used by
.NET
I have to modify EJB web services to RPC web services.
What is advantage of EJB web services? Thanks |
|
p***o 发帖数: 1252 | 19 比如java/python里没有的: deinit, mutating, inout, ARC, weak, unowned。
还别提C++11里没来得及加上的Concepts。 |
|
O******e 发帖数: 734 | 20 I agree it is not good practice.
Out of curiosity I tried using functions with side effects in those two
examples given by M&R, and even declared explicit function interfaces
to tell the compiler about the intent(inout) arguments. The Intel compiler
does not detect the problem, and gives different values if I reverse the
two function calls in the max() example. |
|
z*******n 发帖数: 1034 | 21 https://stackoverflow.com/questions/24101718/swift-performance-sorting-
arrays#comment37183103_24102237
tl;dr Swift without aggressive compiler optimizations at this stage is very
slow; with them it is very fast. Keep it in mind.
Here is an in-place quicksort in Swift:
func quicksort_swift(inout a:CInt[], start:Int, end:Int) {
if (end - start < 2){
return
}
var p = a[start + (end - start)/2]
var l = start
var r = end - 1
while (l <= r){
if (a[l] < p){
... 阅读全帖 |
|