


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
回家后就要过年了和想为朋友们表演一下自己的厨艺——做corn*.innn-1uvuv输出文件corn*.outn1,2,3...nx,y
yxi1i412232401001011假设参考解的边长为Best,你的边长为Ans,则你的得分为10AnsBest91Ans>Best,其中[]你可以使用checkerchecker其中TestNo为测试点。例如你已经得到了数据5的输出corn5.out,可checker来测试你的输出是否合法。执行此命令时corn5.in和corn5.out请妥善保存输入文件*.in和你的输出*.out90它的横向“压缩”得太厉害了。来看一下用这种方法对于test10FPgraph,“仍然枚举所有的树根。在处理第一层的时候给每棵预,“ 通过Graph所画出的对于test10的大致图像:用R[i,j]表示将以i为树根的放在宽度为j的空间里,且根放在最顶层时所(R1WH当然也可以在设一个数组D[i,j]表示将以i为树根的放在高度为j的空间R[i,j]的时候就不需要二分了。同时usesgraph,crt;d:array[1..2000,1..2]oflongint;assign(fin,infile);reset(fin);assign(fout,outfile);reset(fout);initgraph(gd,gm,'');forc1:=1tondobeginCircle(d[c1,1]*big+10,d[c1,2]*big+10,bigdiv2); forc1:=1ton-1dobegin主程序{$APPTYPEprogramcorn;b:array[1..maxn]ofinteger;r:array[1..maxn,1..maxr]ofinteger;ansd,d:array[1..maxn]ofarr;height:array[1..maxn]ofinteger;used:array[1..maxn]ofboolean;procedurereaddata;forc1:=1ton-1dobegininc(d[e2].sonnum);d[e2].b[d[e2].sonnum]:=e1;proceduredfs(o:integer);forc1:=1tod[o].sonnumifnotused[d[o].b[c1]]thenbeginfunctionmax(o1,o2:integer):integer;ifo1>o2thenmax:=o1elsemax:=o2;proceduresub1;height:array[1..maxr]ofinteger;q:array[1..maxn]ofinteger;forroot:=1tondobegindfs(root);d[root].father:=0;q[1]:=root;d[root].x:=1;d[root].y:=1;open:=0;closed:=1;w:=1;h:=1;forc1:=1tod[q[open]].sonnumifd[q[open]].b[c1]<>d[q[open]].fatherthenbeginifopen=1thenbeginendelsebeginifopen>1thenbeginendelsebeginforc2:=1tod[d[q[open]].b[c1]].xdobeginifd[d[q[open]].b[c1]].x>wthenw:=d[d[q[open]].b[c1]].x;untilifmax(w,h)<ansthenbeginfunctionsolve(o,range:integer):integer;functionworkwidth(o,range:integer):integer;i:=1;j:=range;k:=1;whilei<jdobegink:=(i+j)divifsolve(o,k)<=rangethenJ:=kelsei:=k+1;ifrange=0thenworkwidth:=infelseifsolve(o,i)<=rangethenworkwidth:=ielseworkwidth:=inf;procedureswap(varo1,o2:integer);k:=o1;o1:=o2;o2:=k;functionsolve(o,range:integer):integer;ifr[o,range]>0thenbeginforc1:=0torange-1dobeginleft:=1;right:=1;forc2:=1tod[o].sonnumifd[o].b[c2]<>d[o].fatherthenbeginifleft+e1<right+e2thenbeginendelsebeginifmax(left,right)<r[o,range]thenbeginifk>0thenbeginleft:=0;forc2:=1tod[o].sonnumifd[o].b[c2]<>d[o].fatherthenbeginifleft+e1<right+e2thenbeginendelsebeginifmax(left,right)<r[o,range]thenbeginendelsesolve:=inf;proceduresub2;forroot:=1tondobeginwrin('ANS=',ans);dfs(root);d[root].father:=0;forc1:=1tomaxrdobeginifr
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 光纤新型结构设计考核试卷
- 建筑材批发商市场渠道营销策略考核试卷
- 毛皮制品的数字化供应链考核试卷
- 味精企业的品牌形象塑造与传播考核试卷
- 娱乐市场营销策略与实施考核试卷
- 小麦加工中的谷物营养成分保持技术考核试卷
- 会展旅游与目的地营销考核试卷
- 橡胶制品在工业机器人的灵活性考核试卷
- 宠物寄托中心宠物寄养服务法律援助平台搭建考核试卷
- 智能车载语音交互技术考核试卷
- 高中学生物理学情分析【3篇】
- 培训课件 -低成本自动化的开展与案例(上)
- 急救车药品一览表
- 项目部成立文件示例1
- 强直性脊柱炎患者功能锻炼组图
- 新课程标准2022版综合实践
- 40篇英语短文搞定高考3500个单词
- 【企业会计信息化存在的问题及解决对策开题报告】
- 痘痘肌肤的各种类型
- 卫生事业管理 第十八章 卫生应急管理
- 8.6《林黛玉进贾府》课本剧剧本
评论
0/150
提交评论