首页 > TAG信息列表 > 2828
POJ 2828
中间迷途了好久,渐渐走回正轨。 这道题卡的很死,用g++会TLE但是c++就A了。 思路是利用splay tree,不过公认好方法应该是线段树,用splay耗时3000ms左右,线段树仅2000ms #include <iostream> #include <algorithm> #include <queue> #include <string> #include <vector> #include <cstdic: \Users\ATFWUS\AppData\Local(Temp\tomcat-docbase.613353598438846626.8802\articleImage\2828/
springBoot输出类似于c: \Users\ATFWUS\AppData\Local(Temp\tomcat-docbase.613353598438846626.8802\articleImage\2828/B8/28 C:\Users\ATFWUS\AppData\Local(Temp\tomcat-docbase.613353598438846626.8802\articleImage\2828/B8/28 的路径解决办法 第一步 第二部 改变工作【线段树】poj 2828 Buy Tickets
Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 28643 Accepted: 13533 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue… The Lunar Newpoj 2828 buy Tickets 用线段树模拟带插入的队列
Buy Tickets Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2795 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join aPOJ 2828 Buy Tickets (线段树+反向思维)
这是一道很好的题 开始想到链表,但是在第 \(k\) 个位置插入却很烦人,因为链表查询时 \(O(n)\) 的 因为是线段树题,就想到线段树上去 正着好像很难,那么反着可以么? 反着,对于每一个操作,就相当于查找前面空出 \(a\) 个格子的位置是哪个,直接线段树上搞一下就行了 正难则反的思维还是很精妙