zju真题
zz91
浙大cs硕士在读
展开
-
zju2007畅通工程(判断连通否)
http://acm.hdu.edu.cn/showproblem.php?pid=1863浙大计算机研究生复试上机考试-2007年#include #include using namespace std;struct Edge{ int a,b; int cost;}edge[5000];int Tree[100];bool cm原创 2013-02-17 16:12:10 · 207 阅读 · 0 评论 -
热身赛zju2008:找旅馆_hdu1871
http://acm.hdu.edu.cn/showproblem.php?pid=18712008浙大研究生复试热身赛(2)——全真模拟#include #include #include using namespace std;struct E { int no; int num; int price;}buf[1000];bool cmp(E A,原创 2013-03-04 15:48:14 · 456 阅读 · 0 评论 -
zju2008又一版 A+B
http://acm.hdu.edu.cn/showproblem.php?pid=1877浙大计算机研究生复试上机考试-2008年#include int a[100];int k;void change(int x,int m){ if (x==0) //不要忽略为0的情况 { //注意return 否原创 2013-02-17 06:59:37 · 218 阅读 · 0 评论 -
zju2012:Hello World for U
http://ac.jobdu.com/problem.php?pid=14642012年浙江大学计算机及软件工程研究生机试真题#include #include char str[100];char a[100][100];int main(){ int i,j,n1,n2,n3,k; while (scanf("%s",str)!=EOF) { in原创 2013-03-05 19:18:01 · 690 阅读 · 0 评论 -
热身赛zju2008:稳定排序
http://acm.hdu.edu.cn/showproblem.php?pid=18722008浙大研究生复试热身赛(2)——全真模拟#include #include #include using namespace std;struct STU { char no[100]; int score;};STU buf[305],tmp[305];b原创 2013-03-04 16:29:51 · 338 阅读 · 0 评论 -
zju2009:ZOJ
http://acm.hdu.edu.cn/showproblem.php?pid=3783浙大计算机研究生复试上机考试-2009年字符只有zoj,所以将字符串输出,转为统计多少个字符,按相应顺序输出相应字符即可#include #include int main(){ char str[120]; while (scanf("%s",str)!=EOF&&str原创 2013-03-03 17:28:41 · 347 阅读 · 0 评论 -
热身赛ZJU2008:看病要排队
http://acm.hdu.edu.cn/showproblem.php?pid=18732008浙大研究生复试热身赛(2)——全真模拟注意:1、in 与 out 之后输入个数不同,所以先分辨再输入%d%d或%d 2、优先级相同的,按时间先后确定,所以用stable_sort;#include #include #include #in原创 2013-03-04 17:28:35 · 430 阅读 · 0 评论 -
zju2009_继续xxx定律
http://acm.hdu.edu.cn/showproblem.php?pid=3784浙大计算机研究生复试上机考试-2009年#include #include bool visit[1000001]; //中间可能有很大的数int b[501];int main(){ int n,i; while (scanf(原创 2013-03-03 19:05:32 · 329 阅读 · 0 评论 -
zju2009:xxx定律
http://acm.hdu.edu.cn/showproblem.php?pid=3782浙大计算机研究生复试上机考试-2009年#include int main(){ int n,t; while (scanf("%d",&n)&&n!=0) { int ans=0; while (n!=1) { if (n%2==0) { n原创 2013-03-03 17:13:03 · 257 阅读 · 0 评论 -
zju2011:grade
http://ac.jobdu.com/problem.php?pid=10022011年浙江大学计算机及软件工程研究生机试真题1、fabs------求浮点数的绝对值2、求几个值得最大值的小技巧,max函数嵌套#include #include double max1(double a,double b){ return a>b?a:b;}double原创 2013-03-05 14:39:06 · 520 阅读 · 0 评论 -
zju2011保研:Twin Prime Conjecture
http://acm.hdu.edu.cn/showproblem.php?pid=3792浙大计算机研究生保研复试上机考试-2011年1、素数筛法2、一次得到所有n以下的孪生素数数目保存在数组里,否则,每次输入n,在判断会超时#include #include int prime[100000];bool mark[100000];int p[100000];in原创 2013-03-06 13:35:11 · 607 阅读 · 0 评论 -
zju2011 Median
http://ac.jobdu.com/problem.php?pid=1004#include int a[1100005],b[1100005];int main(){ int n,m,i,j,num,mid,ans; while (scanf("%d",&n)!=EOF) { for (i=0;i<n;i++) { scanf("%d",&a[i]);原创 2013-03-10 16:06:13 · 450 阅读 · 0 评论 -
A + B
http://acm.hdu.edu.cn/showproblem.php?pid=1228#include #include char map[][10]={"zero","one","two","three","four","five","six","seven","eight","nine"};int change(char s[]){ for (int i=0;i<1原创 2013-02-16 14:21:03 · 310 阅读 · 0 评论 -
zju2005畅通工程_九度66
http://acm.hdu.edu.cn/showproblem.php?pid=1232浙大计算机研究生复试上机考试-2005年熟练掌握并查集解决图连通问题#include int Tree[1000]; //Tree[i]保存i的双亲结点编号int findRoot(int x){ if (Tree[x]==-1)原创 2013-02-17 15:30:06 · 292 阅读 · 0 评论 -
zju2008欧拉回路
欧拉回路:①不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路 ②无向图欧拉判定的充要条件是:1)每个点的度数为偶数,2)图是连通的 http://acm.hdu.edu.cn/showproblem.php?pid=1878浙大计算机研究生复试上机考试-2008年#include #include bool graph[100原创 2013-02-17 17:27:01 · 289 阅读 · 0 评论 -
zju2007游船出租
http://acm.hdu.edu.cn/showproblem.php?pid=1861浙大计算机研究生复试上机考试-2007年#include #include struct Node{ int no; int h,m; int tag;}a[105]; //保存第i号船的时间信息int原创 2013-02-17 14:38:02 · 297 阅读 · 0 评论 -
zju2006简单计算器
利用数组模拟栈,从左至右遍历算数表达式,遇到乘除则计算结果遇到加减则进栈,最后再按顺序计算加减,得到最终结果浙大计算机研究生复试上机考试-2006年http://acm.hdu.edu.cn/showproblem.php?pid=1237#include typedef struct //运算符和数字轮流保存在数组{原创 2013-02-17 10:57:34 · 289 阅读 · 0 评论 -
zju2006火星A+B
http://acm.hdu.edu.cn/showproblem.php?pid=1230浙大计算机研究生复试上机考试-2006年//http://acm.hdu.edu.cn/showproblem.php?pid=1230#include #include //使用了memset函数int a[30],b[30]; //保存两个输入原创 2013-02-16 17:32:30 · 236 阅读 · 0 评论 -
zju2006统计同成绩学生人数
http://acm.hdu.edu.cn/showproblem.php?pid=1235浙大计算机研究生复试上机考试-2006年#include int main(){ int n,score[1001],x,i; while (scanf("%d",&n)!=EOF && n!=0) { for (i=0;i<n;i++) { scanf(原创 2013-02-16 15:26:28 · 185 阅读 · 0 评论 -
zju2007最小长方形
http://acm.hdu.edu.cn/showproblem.php?pid=1859浙大计算机研究生复试上机考试-2007年#include int main(){ int x,y,lx,ly,rx,ry; //定义左下点与右上点 while (scanf("%d%d",&x,&y) && (x||y) ) //注意x,y均原创 2013-02-16 15:18:20 · 209 阅读 · 0 评论 -
zju2006还是a+b
http://acm.hdu.edu.cn/showproblem.php?pid=1229浙大2006年机试真题 #include int main(){ int a,b,k,p,q,n,m; while (scanf("%d%d%d",&a,&b,&k) && a+b!=0 && k<=8) { char flag=true; n=原创 2013-02-16 14:57:43 · 216 阅读 · 0 评论 -
zju2007EXCEL排序
http://acm.hdu.edu.cn/showproblem.php?pid=1862浙大计算机研究生复试上机考试-2007年 sort函数,O(n*logn) 最大复杂度100000*log100000 也不会超过时间(1s)#include #include //sort()函数#include //strcmp()函数using n原创 2013-02-18 09:29:56 · 255 阅读 · 0 评论 -
zju2005排名_结构体
http://acm.hdu.edu.cn/showproblem.php?pid=1236浙大计算机研究生复试上机考试-2005年不要使用标记数组,while(x--)写的很巧妙#include #include #include using namespace std;struct E{ char no[30]; //准考证号原创 2013-02-17 19:30:05 · 241 阅读 · 0 评论 -
zju2008继续畅通工程(村庄已建成)
http://acm.hdu.edu.cn/showproblem.php?pid=1879浙大计算机研究生复试上机考试-2008年#include #include using namespace std;struct Edge{ int a,b; int cost; int tag; //标志是否已建成,ta原创 2013-02-17 16:49:36 · 283 阅读 · 0 评论 -
zju2007统计字符串
浙大计算机研究生复试上机考试-2007年http://acm.hdu.edu.cn/showproblem.php?pid=1860 #include #include int main(){ char s1[10]; char s2[100]; int i,j; while (gets(s1)&& strcmp(s1,"#")!=0) //gets(原创 2013-02-16 14:58:46 · 206 阅读 · 0 评论 -
zju2005开门人和关门人
http://acm.hdu.edu.cn/showproblem.php?pid=1234浙大计算机研究生复试上机考试-2005年#include #include #include //用到sortusing namespace std; //std必须 struct E //用字符串保存格式原创 2013-02-17 18:23:00 · 259 阅读 · 0 评论 -
zju2010:ZOJ问题
http://ac.jobdu.com/problem.php?pid=10062010年浙江大学计算机及软件工程研究生机试真题#include char str[1005];int main(){ int a,b,c,z,j,i; //a:z前面o的个数,b:zj间o的个数,c:j后面o的个数 while (scanf("%s",s原创 2013-03-11 09:47:36 · 453 阅读 · 0 评论