摘要: #include<iostream>#include<stdio.h>#include<vector>#include<algorithm>using namespace std;int main(){ vector<int> v(3,5);//创建长度为3 初值为5的向量 //v[0]=0;数组下标给向量元素赋值 无法动态增加向量长度 v[0]=1;//有下标方式改变向量内元素值 v.push_back(2);//用push_back方法向向量尾部添加元素 动态增加向量长度 v.push_back(3); v.push_back(4 阅读全文
posted @ 2011-05-24 20:45 Crazy_yiner 阅读(177) 评论(0) 推荐(0)
摘要: #include <iostream>#include<cstdio>#include<map>#include<algorithm>#include<string>using namespace std;int par[5000],n,m;struct In{ int from,to,len;}s[100000];bool cmp(In a,In b){ return a.len<b.len;}void init(){ int i; for(i=1;i<=n;i++)par[i]=i;}int getr(int x){ 阅读全文
posted @ 2011-05-24 11:26 Crazy_yiner 阅读(152) 评论(0) 推荐(0)