alpc01的blog

两年了,还有两年

alpc01ID:alpc01
10456次访问,排名10370好友0人,关注者0
alpc01的文章
原创 13 篇
翻译 0 篇
转载 10 篇
评论 19 篇
最近评论
sanpin_2007:看不懂,1->2 ,2->3都是怎么推的啊?
Optimistic:+U
I am always by your side to support you.
God bless alpc!
Optimistic:晕。。。
Optimistic:看不到ZZN了。。好郁闷。。。
小刚:孩子是自家的看着乖阿
文章分类
收藏
    相册
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 SRM340收藏

    新一篇: 写给恋爱中的男孩 | 旧一篇: 心情不好

     本来想比赛的~可是睡着了~5555555555555

     CssPropertyConverter

    http://www.topcoder.com/stat?c=problem_statement&pm=7503&rd=10664

    简单的字符串转化问题,没什么意思

    ProblemsToSolve

    http://www.topcoder.com/stat?c=problem_statement&pm=7504&rd=10664

    一道枚举题目,不过据说可以O(n)的dp,没怎么看明白

    CsCourses

    http://www.topcoder.com/stat?c=problem_statement&pm=7505&rd=10664

    dp的题,看了标程,感觉写的太好了,应该背下来

    int dp(int curtheoretical,int curpractical,int curmonth) {
        if(curtheoretical>=skillBound&&curpractical>=skillBound) return 0;
        if(curmonth>=(int)theoreticalValue.size()) return INF;
        if(done[curtheoretical][curpractical][curmonth]) return cache[curtheoretical][curpractical][curmonth];
        else done[curtheoretical][curpractical][curmonth]=true;

        int ret=INF;
        for(int i=0;i<(int)theoreticalValue.size();++i)
            if(curtheoretical>=theoreticalValue[i]-1&&curpractical>=practicalValue[i]-1&&curmonth<expire[i]) {
                int cur=dp(max(curtheoretical,theoreticalValue[i]),max(curpractical,practicalValue[i]),curmonth+1)+1;
                if(cur<ret) {
                    ret=cur;
                    bestcourse[curtheoretical][curpractical][curmonth]=i;
                }
            }
        return cache[curtheoretical][curpractical][curmonth]=ret;
    }

    vector<int> construct() {
        vector<int> ret;
        int curtheoretical=0,curpractical=0,curmonth=0;
        while(curtheoretical<skillBound||curpractical<skillBound) {
            int course=bestcourse[curtheoretical][curpractical][curmonth];
            ret.push_back(course);
            curtheoretical=max(curtheoretical,theoreticalValue[course]);
            curpractical=max(curpractical,practicalValue[course]);
            ++curmonth;
        }
        return ret;
    }

    VegetableGarden

    http://www.topcoder.com/stat?c=problem_statement&pm=7507&rd=10664

        要解决几个问题

            1:怎么判断走的路径不自交

                  根据题中所说,所有自交的路径都可以用不自交的方法表示出来,所以这个问题不用考虑

            2.:怎么判断点是否被围在多边形里

            One way to do this is to draw a line from the point in an arbitrary direction, and test if the number of lines of the polygon it intersects is even (outside the polygon) or odd (inside the polygon).

             3:用状态压缩的方法表示每个关注的点上方的边数(1为奇,0为偶),并且预处理得到一个under[x][y]数组表示在(x,y)到(x,y+1)这条直线对所有关注的点来说是在上方还是在下方。

            4:bfs实现所有结点的遍历51*51*2^10,并且用一个数组记录最优值。

     

    发表于 @ 2007年03月26日 11:54:00|评论(loading...)|编辑

    新一篇: 写给恋爱中的男孩 | 旧一篇: 心情不好

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © alpc01