考研复试上机题
汇聚所有知名高校计算机硕士研究生上机复试真题。。。
hackbuteer1
这个作者很懒,什么都没留下…
展开
-
2005年上海交通大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1090 路径打印#include#include#include#includeusing namespace std;set iset;string str,front_str;int main(void){ int i,j,k,n; while(scanf("%d",&n)!=EOF)原创 2012-04-01 16:28:36 · 5152 阅读 · 1 评论 -
2008--2009年北京航空航天大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1165 字符串匹配#include#include#includeusing namespace std;char str[1005][500],temp[1005][500],pattern[1005];inline bool pre_match(int j,int start,int end){ i原创 2012-03-08 11:28:36 · 5012 阅读 · 4 评论 -
2011年上海交通大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1103 二次方程计算器#include#include#includeusing namespace std;int main(void){ int i,index,a,b,c,m,sign,ra,rb,rc; char str[200]; double rt,first,second; whil原创 2012-03-01 21:22:54 · 4370 阅读 · 0 评论 -
2011年北京大学计算机研究生机试真题(dijkstra+优先队列)
http://ac.jobdu.com/problem.php?pid=1162 I Wanna Go Home方法一:普通的dijkstra/*很明显的最短路,但关键是如何建图。可以看到,一共只有两种走法,一种是从city1出发,一直走属于group1的city直到city2,或者一直走属于group2的city直到city1。我昨天建了两个图来表示两种情况,分别求最短路,然后取原创 2012-02-29 15:38:06 · 3847 阅读 · 2 评论 -
2006年上海交通大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1095 2的幂次方//手动模拟#include#include#includeusing namespace std;int main(void){ int j,n,flag,m; int binary[15]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8原创 2012-02-29 11:30:49 · 3184 阅读 · 1 评论 -
2010年清华大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1085 求root(N, k) /*N =a0+a1*k+a2*k^2+......ar*k^r;N'=a0+a1 +a2 +......ar;N-N' = a1(k-1)+a2(k^-1)+......+ar(k^r-1)右边提取k-1,可以得出结论:(N-N')%(k-1)=0这样递原创 2012-02-27 22:01:02 · 3416 阅读 · 0 评论 -
2007年浙江大学计算机及软件工程研究生机试真题
http://ac.jobdu.com/problem.php?pid=1025 最大报销额//将题目中数字都扩大100倍变成整数,就可看作经典的01背包问题//设报销额度为背包上限,可报销支票金额为价格,可报销支票金额为重量//a[]存的既是价格,又是重量#include#includeusing namespace std;int a[32]; //存的既是价格,又是原创 2012-02-26 20:53:32 · 2750 阅读 · 0 评论 -
2006年清华大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1078二叉树遍历#include#include//二叉树结点的描述 typedef struct BinaryTreeNode { char data; struct BinaryTreeNode *lchild, *rchild; //左右孩子 }BinaryTreeNode,原创 2012-02-26 20:07:30 · 2607 阅读 · 0 评论 -
2010年北京大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1149 子串计算#include#include#include#includeusing namespace std;int main(void){ string t,str; map mymap; map::iterator iter,p; int i,j; while(cin>>t)原创 2012-02-24 17:03:52 · 2596 阅读 · 0 评论 -
2010年浙江大学计算机及软件工程研究生机试真题
http://ac.jobdu.com/problem.php?pid=1006 ZOJ问题/*若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空;这里azbojac和azbjc相比 z和j中间+了一个o j后面就+了一个a 而z前面也有一个a以此类推如果再执行一次这个规定那么z和j中间就+了2个o 后面也+了2个前面的a ...所以z前面原创 2012-02-24 16:59:49 · 3042 阅读 · 0 评论 -
2008年浙江大学计算机及软件工程研究生机试真题
http://ac.jobdu.com/problem.php?pid=1029魔咒词典题目当中每个魔咒用一对括号[ ] 来包含,测试数据在一对括号当中会有空格,这个小问题导致一直是WA,应该首先把一行字符串都读进来,然后在分别提取出魔咒和对应的功能。方法一://使用双map来实现#include#include#include#includeusing namespace原创 2012-02-23 19:46:09 · 2491 阅读 · 0 评论 -
2009年浙江大学计算机及软件工程研究生机试真题
http://ac.jobdu.com/problem.php?pid=1035 找出直系亲属//floyd#include#include#includeint map[27][27];void floyd_warshall(int n){ int i,j,k; for(k=0;k<=n;k++) { for(i=0;i<=n;i++) { for(原创 2012-02-22 22:27:57 · 2425 阅读 · 0 评论 -
2008年清华大学计算机研究生机试真题
http://ac.jobdu.com/problem.php?pid=1080 进制转换当然这个题目如果使用大数模板来做的话,也是可以AC的,话说我第一次就是用大数模板AC的,然后又改用了下面这个手动模拟相除的代码AC的。//这个题目有大数数据,需要进行模拟#include#includevoid m2nbinary(int m,int n,char *str,int len原创 2012-02-22 21:29:15 · 2711 阅读 · 0 评论 -
2011年上海交通大学计算机研究生机试真题
整除问题http://ac.jobdu.com/problem.php?pid=1104#include#include#includeusing namespace std;#includeint prime[170],num;void findPrime(int n) { int i,j,k,flag; prime[0]=2; num=1; for(i=3原创 2012-02-15 22:32:42 · 3200 阅读 · 0 评论