ImageVerifierCode 换一换
格式:DOC , 页数:91 ,大小:167.54KB ,
资源ID:4574299      下载积分:5 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/4574299.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(2023年华东师范大学计算机机试真题.doc)为本站上传会员【二***】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

2023年华东师范大学计算机机试真题.doc

1、2023机试 2 计算和的数位 2 大写改小写 3 素数对 4 求最大公约数和最小公倍数 6 排序后求位置处的数 7 *路由器连接 8 *编译原理 10 *分开连接 13 2023机试 17 ECNU的含义 17 空瓶换啤酒 18 记录字符 20 2023机试热身 21 粽子买三送一,买五送二 21 工程流水线问题 22 2023机试 24 hello world 24 Special judge 26 查询成绩 28 2023机试热身 30 贪吃蛇 30 仰望星空 34 *编辑距离 36 2023机试 38 字母排序 38 幸运数 39

2、十六进制的加法 42 电话号码簿合并排序 42 *五子棋 43 *正则表达式匹配 45 2023机试 46 斐波那契数列的素数个数 46 *将a字符变成b字符最少修改次数 47 2023机试热身 49 去重排序 49 蛇形图案 51 数学手稿 54 2023机试 计算和的数位 Sum of digit Description Write a program which computes the digit number of sum of two integers a and b. Input The first line of input gi

3、ves the number of cases, N(1 ≤ N ≤ 100). N test cases follow. Each test case consists of two integers a and b which are separeted by a space in a line. (0<=a,b<=). Output For each test case, print the number of digits of a + b. Sample Input 3 5 7 1 99 1000 999 Sample Output 2

4、3 4 #include int main() { int n; int a,b; int sum; while(scanf("%d",&n)!=EOF) { while(n--) { int an=0; scanf("%d%d",&a,&b); sum=a+b; while(sum) { an++; sum/=10; } printf("%d\n",an++); } } return 0; } 大写改小写 Capitalize Description Write a program which

5、 replace all the lower-case letters of a given text with the corresponding captital letters. Input A text including lower-case letters, periods, and space. Output Output The converted text. Sample Input welcome to east china normal university. Sample Output WELCOME TO EAST CHI

6、NA NORMAL UNIVERSITY. #include #include char str[1000]; int main() { int l; while(gets(str)) { l=strlen(str); int i; for(i=0;i='a'&&str[i]<='z') printf("%c",str[i]-32); else printf("%c",str[i]); } printf("\n"); } return 0; } 素数对 Pr

7、imes Pair Description We arrange the numbers between 1 and N (1 <= N <= 10000) in increasing order and decreasing order like this: 1 2 3 4 5 6 7 8 9 . . . N N . . . 9 8 7 6 5 4 3 2 1 Two numbers faced each other form a pair. Your task is to compute the number of pairs P such that both n

8、umbers in the pairs are prime. Input The first line of input gives the number of cases, C (1 ≤ C ≤ 100). C test cases follow. Each test case consists of an integer N in one line. Output For each test case, output P . Sample Input 4 1 4 7 51 Sample Output 0 2 2 6 #

9、include #include bool prime[10005]; void init() { int i; int j; prime[0]=prime[1]=false;//不是素数 prime[2]=true;//是素数 for(i=3;i<=10005;i+=2) { prime[i]=true;//是素数 prime[i+1]=false;//不是素数 除0和2之外的偶数都不是素数 } for(i=3;i<=10005;i+=2) { if(prime[i]==true)//是素数 { j=i+i; whi

10、le(j<=10005) { prime[j]=false;//不是素数 j+=i; } } } } int main() { int c; int n; init();//初始化 while(scanf("%d",&c)!=EOF) { while(c--) { scanf("%d",&n); int sum=0; int i; for(i=2;i<=n/2;i++) { if(prime[i]==true&&prime[n+1-i]==true) sum++; } sum*=2; if(n%2==1)//n为奇数 { if(prime

11、[n/2+1]==true) sum+=1; } printf("%d\n",sum); } } return 0; } 求最大公约数和最小公倍数 GCD and LCM Description Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b (0 < a, b ≤ 44000). Input The first line of input gives the num

12、ber of cases, N(1 ≤ N ≤ 100). N test cases follow. Each test case contains two interger a and b separated by a single space in a line. Output For each test case, print GCD and LCM separated by a single space in a line. Sample Input 2 8 6 5000 3000 Sample Output 2 24 1000 1500

13、0 #include int getgcd(int a,int b) { int gcd; int t1,t2; t1=a; t2=b; gcd=t1%t2; while(gcd!=0) { t1=t2; t2=gcd; gcd=t1%t2; } return t2; } int main() { int n; int a,b; while(scanf("%d",&n)!=EOF) { while(n--) { scanf("%d%d",&a,&b); printf("%d %d\n",getgcd(a,b),a*b/

14、getgcd(a,b))); } } return 0; } 排序后求位置处的数 Sort it… Description There is a database,partychen want you to sort the database’s data in the order from the least up to the greatest element,then do the query: "Which element is i-th by its value?"- with i being a natural number in a range from

15、1 to N. It should be able to process quickly queries like this. Input The standard input of the problem consists of two parts. At first, a database is written, and then there's a sequence of queries. The format of database is very simple: in the first line there's a number N (1<=N<=100000),

16、 in the next N lines there are numbers of the database one in each line in an arbitrary order. A sequence of queries is written simply as well: in the first line of the sequence a number of queries K (1 <= K <= 100) is written, and in the next K lines there are queries one in each line. The query "W

17、hich element is i-th by its value?" is coded by the number i. Output The output should consist of K lines. In each line there should be an answer to the corresponding query. The answer to the query "i" is an element from the database, which is i-th by its value (in the order from the least up

18、to the greatest element). Sample Input 5 7 121 123 7 121 3 3 2 5 Sample Output 121 7 123 #include #include using namespace std; int num[100010]; int pos[105]; int main() { int n; int i; int k; while(scanf("%d",&n)!=EOF) { for(i=1;i<=n;i++) sca

19、nf("%d",&num[i]); scanf("%d",&k); for(i=1;i<=k;i++) scanf("%d",&pos[i]); sort(num+1,num+1+n); for(i=1;i<=k;i++) printf("%d\n",num[pos[i]]); } return 0; } *路由器连接 Hub Connection plan Description Partychen is working as system administrator and is planning to establish a new network in

20、his company. There will be N hubs in the company, they can be connected to each other using cables. Since each worker of the company must have access to the whole network, each hub must be accessible by cables from any other hub (with possibly some intermediate hubs). Since cables of different typ

21、es are available and shorter ones are cheaper, it is necessary to make such a plan of hub connection, that the cost is minimal. partychen will provide you all necessary information about possible hub connections. You are to help partychen to find the way to connect hubs so that all above conditions

22、are satisfied. Input The first line of the input contains two integer numbers: N - the number of hubs in the network (2 <= N <= 1000) and M - the number of possible hub connections (1 <= M <= 15000). All hubs are numbered from 1 to N. The following M lines contain information about possible co

23、nnections - the numbers of two hubs, which can be connected and the cable cost required to connect them. cost is a positive integer number that does not exceed 106. There will always be at least one way to connect all hubs. Output Output the minimize cost of your hub connection plan. Sampl

24、e Input 4 6 1 2 1 1 3 1 1 4 2 2 3 1 3 4 1 2 4 1 Sample Output 3 #include #include using namespace std; struct Edge{ int a,b; int cost; }E[15010]; int Tree[1010]; int findRoot(int x) { if(Tree[x]==-1) return x; else { int tmp=findRoot(Tree[x]);

25、 Tree[x]=tmp; return tmp; } } bool Cmp(Edge a,Edge b) { return a.cost

26、t ans=0; for(i=1;i<=m;i++) { int a=findRoot(E[i].a); int b=findRoot(E[i].b); if(a!=b) { Tree[a]=b; ans+=E[i].cost; } } printf("%d\n",ans); } return 0; } *编译原理 Principles of Compiler Description After learnt the Principles of Compiler,partychen thought that he can solve a simple

27、 expression problem.So he give you strings of less than 100 characters which strictly adhere to the following grammar (given in EBNF): A:= '(' B')'|'x'. B:=AC. C:={'+'A}. Can you solve them too? Input The first line of input gives the number of cases, N(1 ≤ N ≤ 100). N test cas

28、es follow. The next N lines will each contain a string as described above. Output For each test case,if the expression is adapt to the EBNF above output “Good”,else output “Bad”. Sample Input 3 (x) (x+(x+x)) ()(x) Sample Output Good Good Bad #include #include

29、 #include #include #include #include #include #include #include #include #include using namespace std; char ex[110]; int index; bool A(); bool B(); bool C(); bool A() { if(ex[inde

30、x]=='x') { index++; while(ex[index]==' ') index++; return true; } if(ex[index]=='(') { index++; while(ex[index]==' ') index++; if(B()&&ex[index]==')') { index++; while(ex[index]==' ') index++

31、 return true; } } return false; } bool B() { return A()&&C(); } bool C() { while(ex[index]=='+') { index++; while(ex[index]==' ') index++; //return A(); if (!A()) return false; } return t

32、rue; } int main() { int N; scanf("%d",&N); getchar(); while(N--) { gets(ex); index=0; printf("%s\n",A()&&ex[index]=='\0'?"Good":"Bad"); } return 0; } *分开连接 Separate Connections Description Partychen are analyzing a communicatio

33、ns network with at most 18 nodes. Character in a matrix i,j (i,j both 0-based,as matrix[i][j]) denotes whether nodes i and j can communicate ('Y' for yes, 'N' for no). Assuming a node cannot communicate with two nodes at once, return the maximum number of nodes that can communicate simultaneously. I

34、f node i is communicating with node j then node j is communicating with node i. Input The first line of input gives the number of cases, N(1 ≤ N ≤ 100). N test cases follow. In each test case,the first line is the number of nodes M(1 ≤ M ≤ 18),then there are a grid by M*M describled the matri

35、x. Output For each test case , output the maximum number of nodes that can communicate simultaneously Sample Input 2 5 NYYYY YNNNN YNNNN YNNNN YNNNN 5 NYYYY YNNNN YNNNY YNNNY YNYYN Sample Output 2 4 Hint The first test case: All communications must occur with node

36、0. Since node 0 can only communicate with 1 node at a time, the output value is 2. The second test case: In this setup, we can let node 0 communicate with node 1, and node 3 communicate with node 4. #include #include #include #include #include

37、 #include #include #include #include #include #include using namespace std; #define MAXN 250 #define MAXE MAXN*MAXN*2 #define SET(a,b) memset(a,b,sizeof(a)) deque Q; bool g[MAXN][MAXN],inque[MAXN],inblossom[MAXN]; int m

38、atch[MAXN],pre[MAXN],base[MAXN]; int findancestor(int u,int v) { bool inpath[MAXN]= {false}; while(1) { u=base[u]; inpath[u]=true; if(match[u]==-1)break; u=pre[match[u]]; } while(1) { v=base[v]; if(inpath[v])return

39、 v; v=pre[match[v]]; } } void reset(int u,int anc) { while(u!=anc) { int v=match[u]; inblossom[base[u]]=1; inblossom[base[v]]=1; v=pre[v]; if(base[v]!=anc)pre[v]=match[u]; u=v; } } void contract(int u,int v,int n

40、) { int anc=findancestor(u,v); SET(inblossom,0); reset(u,anc); reset(v,anc); if(base[u]!=anc)pre[u]=v; if(base[v]!=anc)pre[v]=u; for(int i=1; i<=n; i++) if(inblossom[base[i]]) { base[i]=anc; if(!inque[i]) {

41、 Q.push_back(i); inque[i]=1; } } } bool dfs(int S,int n) { for(int i=0; i<=n; i++)pre[i]=-1,inque[i]=0,base[i]=i; Q.clear(); Q.push_back(S); inque[S]=1; while(!Q.empty()) { int u=Q.front(); Q.po

42、p_front(); for(int v=1; v<=n; v++) { if(g[u][v]&&base[v]!=base[u]&&match[u]!=v) { if(v==S||(match[v]!=-1&&pre[match[v]]!=-1))contract(u,v,n); else if(pre[v]==-1) { pre[v]=u;

43、 if(match[v]!=-1)Q.push_back(match[v]),inque[match[v]]=1; else { u=v; while(u!=-1) { v=pre[u]; int w=match[v];

44、 match[u]=v; match[v]=u; u=w; } return true; } } } } } return false; } int solve(int n) {

45、 SET(match,-1); int ans=0; for(int i=1; i<=n; i++) if(match[i]==-1&&dfs(i,n)) ans++; return ans; } int main() { int ans; int n,m; char tmp[30]; scanf("%d",&n); while(n--) { ans=0; memset(g,0,sizeof(g));

46、 scanf("%d",&m); for(int i=1;i<=m;i++) { scanf("%s",tmp+1); for(int j=1;j<=m;j++) { if(tmp[j]=='Y') { g[i][j]=g[j][i]=1; } } } ans=solve(m)

47、 printf("%d\n",ans*2); } return 0; } 2023机试 ECNU的含义 Welcome to 2023 ACM selective trial Description Welcome to 2023 ACM selective trial. ACM is a long way to go, and it's not just a match. So what you need to do for now is do your best! And as members of ACM lab, we are

48、going to teach you something important. Firstly you should be proud that you are a member of ECNU, because 'E' represents "Excellent", 'C' represents "Cheer", 'N' represents "Nice", 'U' represents "Ultimate". Second you should remember Impossible is nothing, because "Impossible" represents "I'm poss

49、ible". Third for today you should keep ACM, because for you ACM represents "Accept More". Do you remember them clearly? Now we will give you a string either "E" ,"C", "N","U","Impossible" or"ACM", you need to tell me what does it means? Input The first line of input gives the number of cases

50、 N(1 ≤ N ≤ 10). N test cases follow. Each test consists of a string which will be one of "E" ,"C", "N","U","Impossible" or"ACM". Output Tell me what does it means. Sample Input 3 E Impossible ACM Sample Output Excellent I'm possible Accept More #include #inclu

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服