F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
Notice:祝各位Oier新年快乐,Rp++!
大视野在线测评-欢迎您
[ New Thread ]
Problem 2002 >> 本地测AC,在线测TLE
Seter @ 2011-12-20 20:17:23
[ Quote ] [ Edit ] [ Delete ] 1#
RT……测了几千组随机数据加上官方数据,都0.3s内出解,交上来就TLE了……
Seter @ 2011-12-21 09:48:05
[ Quote ] [ Edit ] [ Delete ] 2#
呃……其实我是来求数据的……
root @ 2011-12-21 09:52:14
[ Quote ] [ Edit ] [ Delete ] 3#
数据不是你想要,想要就得到的........
Seter @ 2011-12-21 12:28:46
[ Quote ] [ Edit ] [ Delete ] 4#
@ROOT……555……这个数据和官方数据不一样么……
root @ 2011-12-21 13:36:11
[ Quote ] [ Edit ] [ Delete ] 5#
是一样的啊....
testSeter @ 2011-12-21 17:18:20
[ Quote ] [ Edit ] [ Delete ] 6#
@ROOT A了……有一个缩行在OJ上委掉了,在本地没委……
root @ 2011-12-22 10:01:59
[ Quote ] [ Edit ] [ Delete ] 7#
是哪个数据,我看了都有换行的啊,最后一行....
Seter @ 2011-12-22 12:45:34
[ Quote ] [ Edit ] [ Delete ] 8#
@ROOT……呃,我不是这个意思。我有一个比较长的语句前后执行顺序在本地和OJ上不同,然后就委掉了……可能是GCC版本不同吧……
cxjyxx_me @ 2012-04-19 14:30:01
[ Quote ] [ Edit ] [ Delete ] 9#
求官方数据。。
zhaojianxuan @ 2013-01-20 20:30:56
[ Quote ] [ Edit ] [ Delete ] 10#
/*
inline void rotate(node* x,int t) {
node* y = x->fa, *z = y->fa;
(y->ch[t] = x->ch[t^1])->fa = y;
(x->ch[t^1] = y)->fa = x;
if (y == z->ch[0]) z->ch[0] = x;
if (y == z->ch[1]) z->ch[1] = x;
x->fa = z;
update(y);
}*/
void rotate(node *x, int t)
{
node *y = x -> fa, *z = y -> fa;
x -> ch[t^1] -> fa = y;
y -> ch[t] = x -> ch[t^1];
x -> ch[t^1] = y;
y -> fa = x;
z -> ch[(y == z -> ch[0] ? 0: 1)] = x;
x -> fa = z;
update(y);
}
两段代码执行相同的任务,上面那个AC了,下面那个TLE了。 求解。
SCaffrey @ 2015-11-21 16:10:35
[ Quote ] [ Edit ] [ Delete ] 11#
死于三目运算符?
gtydetree @ 2016-07-24 19:29:03
[ Quote ] [ Edit ] [ Delete ] 12#
ooo
ztzshiwo @ 2017-01-22 20:18:40
[ Quote ] [ Edit ] [ Delete ] 13#
我来考古,好像是因为LCT中y可能既不是z的左节点也不是z的右节点,z直接蹦到另外一个splay去了
GlassesQ @ 2017-03-28 19:10:14
[ Quote ] [ Edit ] [ Delete ] 14#
%%%楼上
Izumihanako @ 2017-11-27 14:21:06
[ Quote ] [ Edit ] [ Delete ] 15#
Reply 13#:
一开始me也一直T,看到了这句话但是不是很理解,直到me查出错=A=
还真的是错在这里了...
看来自己的板子还是不够严谨啊
十分感谢!
[Top] [Previous Page] [Next Page]

HOME Back