2012年7月10日

摘要: 链接:http://poj.org/problem?id=1788 “The posts are only at points where the fence changes the direction”,也就是说每个post都是拐角处。 先按X为第一关键字 Y为第二关键字排序 2n,2n-1两个相邻的y之差就是坚着的栅栏;横栅栏同理。。遍历一下加起来就ok了。 wa两次,第一次在计算... 阅读全文
posted @ 2012-07-10 22:30 lltctt 阅读(185) 评论(0) 推荐(0)

2012年7月9日

摘要: 链接:http://poj.org/problem?id=1003 题目很无语。。直觉告诉我这样叠一定会倒掉。。。 懒得算就用了查表,导致内存占用252K。。。好吧,水水更健康~ Memory: 252K Time: 0MS #include <iostream>using namespace std;double index[276] = {0.500000, 0.8... 阅读全文
posted @ 2012-07-09 23:06 lltctt 阅读(149) 评论(0) 推荐(0)
摘要: 链接:http://poj.org/problem?id=1193用链表模拟内存分配,维护一个等待队列和两个链表,一个链表记录空闲内存,另一个记录待释放的内存块。由于木有用stl,写的灰常繁琐。。。Memory: 628K Time: 688MS#include <stdio.h>#include <stdlib.h>#include <string.h>#define true 1#define false 0typedef int queueType;typedef int listType;//进程控制块typedef struct _proCb{ i 阅读全文
posted @ 2012-07-09 22:54 lltctt 阅读(237) 评论(0) 推荐(0)

导航