09 2011 档案

摘要:纪念一下这道题,写了一下午+一晚上,结果WA后才发现输出的不是拓扑排序。Exhausting....还是先做作业以后再补了…… 过了两天,不管怎么说参考着一些别人的程序总算是写完了,大循环以位置为顺序一个个试人试下去,SCDP小循环以状态为顺序并考虑拓扑排序(这时候是以人的顺序来排位置的)实现状态转移。很长的一句话其实就是对于每个位置去试人并且每试一个人做一次全部的状态转移。贴个代码(YM zYc学长,看了他那个简洁完美的递推程序之后自己的程序写着写着就发现越来越接近他的程序了= =),虽然很想写解题报告但是还有作业要赶。。#include <iostream>#include & 阅读全文
posted @ 2011-09-26 21:00 zxfx100 阅读(217) 评论(0) 推荐(0)
摘要:// unique algorithm example#include <iostream>#include <algorithm>#include <vector>using namespace std;bool myfunction (int i, int j) { return (i==j);}int main () { int myints[] = {10,20,20,20,30,30,20,20,10}; // 10 20 20 20 30 30 20 20 10 vector<int> myvector (myints,myints+ 阅读全文
posted @ 2011-09-01 21:26 zxfx100 阅读(218) 评论(0) 推荐(0)