ITeye博客

Midnight

Midnight0101 · 共 20 篇文章

linux解压命令

.tar 解包:tar xvf FileName.tar 打包:tar cvf FileName.tar DirName (注:tar是打包,不是压缩!) .gz 解压1:gunzip FileName.gz 解压2:gzip -d FileName.gz 压缩:gzip FileName .tar.gz 和 .tgz 解压:tar zxvf FileName.tar.gz 压缩:tar zcvf FileName.tar.gz DirName .bz2 解压1:bzip2 -d FileName.bz2 解压2:bunzip2 FileName.bz2 压缩: bzip2 -z FileN…

2012-02-17 22:20 · linux · 评论(0)

转自王道论坛

2009年参加硕士生入学考试已经结束了,初试计算机专业基础141,总成绩403分。我被清华大学计算机系网络研究所录取。在王道一直潜水的,出来发一贴,感谢王道。 一.准备工作(3月到5月) 选择报考的学校: 人人对于考研的看法都不一样,恐怕每一个要考研的人最想问的一个问题就是考研难吗?我的感觉是考研比高考要简单。我举几个计算机比较牛的学校,想分三个层次说明一下到底是个什么难度。单论难度的话,第一个层次以清华的计算机为例吧,清华计算机的录取线大概是360—370分这个区间。第二个层次我觉得浙大吧,不是说浙大是二等,不过浙大招收的人数比较多,所分数线相比较较低。浙大录取线大概在340分左右。最后再…

2011-08-09 15:12 · 考研 · 评论(0)

2011清华考研机试题2

http://ac.jobdu.com/problem.php?id=1087 水~ #include <iostream> #include <stdio.h> #include <cmath> using namespace std; long long solved(long long key) { long long ans=0; if(key==1) return 1; for(long long i=1;i<=sqrt(key);i++) { if(key % i==0) if(i==sqrt(key)) { ans++; } else { ans+=2; } } return …

2011-08-09 14:56 · 算法 · 评论(0)

2011清华考研机试题1

题目描述 http://ac.jobdu.com/problem.php?id=1088 水~ #include <iostream> using namespace std; int main() { int l,m; int trees[10008]; while(cin>>l>>m) { int i,j,ans=0; for(i=0;i<=l;i++) trees[i]=0; for(i=0;i<m;i++) { int a,b; cin>>a>>b; for(j=a;j<=b;j++) trees[j]=1; } for(i=0;i<=l;i++) if(trees[i]==0) a…

2011-08-09 14:40 · 算法 · 评论(0)

考研清华2011复试机考第三题

题目描述 在某条线路上有N个火车站,有三种距离的路程,L1,L2,L3,对应的价格为C1,C2,C3.其对应关系如下: 距离s 票价 0<S<=L1 C1 L1<S<=L2 C2 L2<S<=L3 C3 输入保证0<L1<L2<L3<10^9,0<C1<C2<C3<10^9。 每两个站之间的距离不超过L3。 当乘客要移动的两个站的距离大于L3的时候,可以选择从中间一个站下车,然后买票再上车,所以乘客整个过程中至少会买两张票。 现在给你一个 L1,L2,L3,C1,C2,C3。然后是A B的值,其分别为乘客旅程的起始站和终点站。 然后输入N,N为该线路上的总的火车站数目,然后输入N-1个整数,…

2011-08-09 13:51 · 算法 · 评论(0)

poj3259 spfa解法

同上题,不过改的spfa算法,注意每个节点进入队列的次数至多为n-1次(一共n个节点),若进入大于等于n次了,则说明图中存在负权回路,此时正好满足题目中时光倒流的要求,另外注意,vector每次用的时候清空。 下面是spfa算法的简单说明: 我们用数组d记录每个结点的最短路径估计值,而且用邻接表来存储图G。我们采取的方法是松弛:设立一个先进先出的队列用来保存待优化的结点,优化时每次取出队首结点u,并且用u点当前的最短路径估计值对离开u点所指向的结点v进行松弛操作,如果v点的最短路径估计值有所调整,且v点不在当前的队列中,就将v点放入队尾。这样不断从队列中取出结点来进行松弛操作,直至队列空为止…

2011-08-08 19:59 · 算法 · 评论(0)

poj3259 bellman水题

poj3259 http://poj.org/problem?id=3259 最简单的bellman,判断是否有负环,n-1次松弛后若还能松弛,则有负环 #include <iostream> #include <fstream> #define INF 999999999 using namespace std; struct E { int u; int v; int w; }edges[6000]; int n,m,w; int countEdge; int dist[1000]; void addEdge(int e,int s,int t) { countEdge++; edges…

2011-08-08 17:04 · 算法 · 评论(0)

acm题目常用的预处理

#include<iostream> #include<sstream> #include<fstream> #include<vector> #include<list> #include<deque> #include<queue> #include<stack> #include<map> #include<set> #include<bitset> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cstring> #include<cctype> #include<cmath> #include<ctim…

2011-08-08 15:26 · 算法 · 评论(0)

poj1860

poj1860 http://poj.org/problem?id=1860 #include <iostream> #include <fstream> #define ADJUST 0.00000001 using namespace std; struct E { int start; int end; double r; double c; }e[108*108*2]; double v[108]; int m,n,s; double origin; void solved() { int j; origin=v[s]; bool flag; while(v[s]-origin<=A…

2011-08-08 14:06 · 算法 · 评论(0)

water~9

poj2109 http://poj.org/problem?id=2109 很神奇的居然a了 #include <iostream> #include <cmath> using namespace std; int main() { double a,b; cout.precision(0); cout.setf(ios_base::fixed); while(cin>>a>>b) cout<<exp(log(b)/a)<<endl; return 0; }

2011-08-06 18:01 · 算法 · 评论(0)

water~8

poj2027 http://poj.org/problem?id=2027 just for fun #include <iostream> using namespace std; int main() { int n; cin>>n; for(int i=0;i<n;i++) { int a,b; cin>>a>>b; if(a<b) cout<<"NO BRAINS"<<endl; else cout<<"MMM BRAINS"<<endl; } return 0; }

2011-08-06 17:22 · 算法 · 评论(0)

water~7

poj1328 http://poj.org/problem?id=1328 比较简单的贪心,看代码,不细说了~ #include <iostream> #include <fstream> #include <algorithm> #include <cmath> using namespace std; struct Space { double left; double right; friend bool operator<(Space a,Space b) { return a.left<b.left; } }; Space space[1007]; int n,d; int an…

2011-08-06 17:15 · 算法 · 评论(0)

water~6

poj1088 http://poj.org/problem?id=1088 滑雪,DP,水题 #include <iostream> #include <fstream> using namespace std; int node[105][105]; int dp[105][105]; int r,c; int dpit(int i,int j) { if(dp[i][j]>0) return dp[i][j]; int max=0; if(j>1 && node[i][j]<node[i][j-1]) { dp[i][j]=dpit(i,j-1)+1; if(dp[i][j]>max)…

2011-08-06 14:27 · 算法 · 评论(0)

water~5

poj1003 http://poj.org/problem?id=1003 super water~ #include <iostream> using namespace std; void waterit(double a) { int i=0; double s=0.0; while(s<a) { s=s+1.0/((double)i+2.0); i++; } cout<<i<<" card(s)"<<endl; } int main() { double a; while(1) { cin>>a; if(a<0.0001) break; waterit(a); } return 0…

2011-08-06 14:24 · 算法 · 评论(0)

water~4

poj1004 http://poj.org/problem?id=1004 super water #include <iostream> using namespace std; int main() { double ans=0; for(int i=0;i<12;i++) { double temp; cin>>temp; ans+=temp; } ans/=12; cout.setf(ios_base::fixed); cout.setf(ios_base::showpoint); cout.precision(2); cout<<"$"<<ans<<endl; return 0;…

2011-08-06 14:09 · 算法 · 评论(0)