We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
汉诺塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C
标签: the animation Simulate movement
上传时间: 2017-02-11
上传用户:waizhang
将魔王的语言抽象为人类的语言:魔王语言由以下两种规则由人的语言逐步抽象上去的:α-〉β1β2β3…βm ;θδ1δ2…-〉θδnθδn-1…θδ1 设大写字母表示魔王的语言,小写字母表示人的语言B-〉tAdA,A-〉sae,eg:B(ehnxgz)B解释为tsaedsaeezegexenehetsaedsae对应的话是:“天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅”。(t-天d-地s-上a-一只e-鹅z-追g-赶x-下n-蛋h-恨)
上传时间: 2013-12-19
上传用户:aix008
本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。
上传时间: 2017-07-03
上传用户:gaojiao1999
【问题描述】 在一个N*N的点阵中,如N=4,你现在站在(1,1),出口在(4,4)。你可以通过上、下、左、右四种移动方法,在迷宫内行走,但是同一个位置不可以访问两次,亦不可以越界。表格最上面的一行加黑数字A[1..4]分别表示迷宫第I列中需要访问并仅可以访问的格子数。右边一行加下划线数字B[1..4]则表示迷宫第I行需要访问并仅可以访问的格子数。如图中带括号红色数字就是一条符合条件的路线。 给定N,A[1..N] B[1..N]。输出一条符合条件的路线,若无解,输出NO ANSWER。(使用U,D,L,R分别表示上、下、左、右。) 2 2 1 2 (4,4) 1 (2,3) (3,3) (4,3) 3 (1,2) (2,2) 2 (1,1) 1 【输入格式】 第一行是数m (n < 6 )。第二行有n个数,表示a[1]..a[n]。第三行有n个数,表示b[1]..b[n]。 【输出格式】 仅有一行。若有解则输出一条可行路线,否则输出“NO ANSWER”。
标签: 点阵
上传时间: 2014-06-21
上传用户:llandlu
实验源代码 //Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("请输入矩阵第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可传递闭包关系矩阵是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元关系的可传递闭包\n"); void warshall(int,int); int k , n; printf("请输入矩阵的行数 i: "); scanf("%d",&k); 四川大学实验报告 printf("请输入矩阵的列数 j: "); scanf("%d",&n); warshall(k,n); }
上传时间: 2016-06-27
上传用户:梁雪文以
#include "iostream" using namespace std; class Matrix { private: double** A; //矩阵A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //为向量b分配空间并初始化为0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //为向量A分配空间并初始化为0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析构中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"请输入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"请输入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"个:"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分别求得U,L的第一行与第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分别求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"计算U得:"<<endl; U.Disp(); cout<<"计算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; }
标签: 道理特分解法
上传时间: 2018-05-20
上传用户:Aa123456789
智能空调节能控制器智能空调节能控制器 安科瑞 王长幸 ADDC 是一个面向楼宇和大型中央空调系统集中监控的直接数字控制器。可以对楼宇中 的冷冻站、热交换设备、空调系统、通风系统、给排水系统、等等设备进行监测和控制。可 以十分方便的组网,实现分散控制,集中管理。ADDC 有 6DI、8AI、8DO、4AO 共 26 个物理 点,带扩展功能,支持标准 Modbus 协议,带联网功能。与同类产品相比具有以下特点: 既可以通过外部编程来开发应用,也可以依靠本机按键设置组态。 支持在线调试和编程,极大的方便了自动工程师二次开发。 利用 ADDC 的按键组态功能,就可以实现顺序控制,空调设备的恒温恒湿控制,连 锁控制及报警等常规楼宇应用。极大了方便用户,缩短工厂周期,降低了成本。 15.1 型号说明 ADDC M : 主控制器 E : 扩展模块 安科瑞智能空调节能控制器 15.2 技术参数 主要技术参数 主控制器模块(ADDC-M) 扩展模块(ADDC-E) 工作电压 AC/DC24V±10% 频率 50/60Hz 功耗 5VA 通用输入温度 传感器 PT1000/NTC 通道数:4 Pt1000 输入范围:0..150℃,精度:5‰ NTC(标称值可为 1kΩ、10kΩ)输入范围:0-100℃,精度±3℃,采用三线制接法,最大连线 距离(¢≥0.6mm)300m 模拟量输入 通道数:4 测量范围:DC 0-10V,0-20mA 精度 5‰,电压输入时内阻 R:≥100K,最大连线距离(¢≥ 0.6mm)300m 开关量输入 通道数:6 信号类型:无源触点,最大连线距离(¢≥0.6
上传时间: 2022-03-06
上传用户:
eeworm.com VIP专区 单片机源码系列 25资源包含以下内容:1. 单片机课件.ppt2. PICC编译器资料.pdf3. stm32初级例程.rar4. 单片机开服各种辅助小工具.zip5. LED旋转灯设计.doc6. 基于51单片机的超温报警器.Zip7. [手把手教你学51单片机与Proteus从入门到精通].59.pdf8. 旋转时钟程序下载.pdf9. 三小时精通protel 99se【单片机毕业设计秘籍】.rar10. MCS51单片机典型子程序.docx11. 51单片机原理与应用课件PPT.ppt12. STC-ISP-V4.88免安装+win7下使用方法.rar13. PIC单片机实用教程-基础篇.pdf14. 单片机复习资料.rar15. stc-isp软件的使用方法.doc16. 基于单片机的指纹识别电子密码锁设计.rar17. 51开发板及USB转换原理图.pdf18. 单片机试题库.zip19. 智能台灯设计原理.rar20. 《匠人手记》网络版《程序规划方法漫谈》.pdf21. 编写高质量的单片机C程序.doc22. Nokia+5110多功能时钟(带温度等级).zip23. PIC单片机编程教程.zip24. 单片机控制led灯点亮.zip25. ZLG7290+I2C接口键盘及LED驱动器数据手册.pdf26. 单片机简单实验仿真_二极管顺序点亮.zip27. PIC单片机18f4680资料.pdf28. 去掉震动开关的摇摇棒.zip29. 采用89C51和LCD1602的多功能电子钟.pdf30. 51单片机汇编程序.zip31. 诺基亚LCD5110最详细的中文说明测试程序字模软件.doc32. STM8单片机快速入门_V2[1].pdf33. 篮球24秒倒计时器.ppt34. 单片机基础.zip35. STC51单片机必备软件使用.pdf36. 单片机高级语言C51 Windows环境编程与应用.pdf37. keil和proteus安装破解汉化联调方法.doc38. STM8例程演示一个LED闪烁.zip39. D卡改GBALINK烧录卡.doc40. 实时时钟设计.zip41. 智能小车设计指导.pdf42. PSD3系列可编程单片机通用外围接口芯片原理编程及应用.zip43. 51最小系统版实验程序.zip44. PIC系列单片机原理和程序设计.zip45. PIC系列单片机应用设计与实例.zip46. ML4428数据资料.pdf47. PIC系列单片机的开发应用技术.zip48. MCS-51单片机结构.zip49. PC机及单片机数据通信技术.zip50. MCS-96单片机的应用系统设计基础.zip51. LED立方体原理图加程序.wps52. NEC 75X 75XL系列单片机应用大全.zip53. C51单片机学习教程.rar54. STC-ISP下载编程烧录软件.zip55. Motorola单片机实用技巧集萃.zip56. 89C51在变压器温度自动检测与控制中的应用.pdf57. MCS-51系列单片机实用接口技术.zip58. M68HC11单片机原理、应用及技术手册.zip59. 51单片机c语言深入学习教程.pdf60. MCS-51单片机原理及接口技术.zip61. 霍尔火焰光检配套资料.zip62. 简单的8乘8led点阵仿真.zip63. MCS-51单片机应用设计.zip64. MOTOROLA单片机汇编程序设计.zip65. 8.8LED点阵字库.zip66. 20个单片机c实验程序例子(包含c程序和hex文件).zip67. MOTOROLA单片机M68HC05原理与应用大全.zip68. M68HC11单片机大学优秀应用设计汇编.zip69. 单片机计算器_崔祥通毕业设计.doc70. MOTOROLA 8位增强型单片机M68HC11原理与应用.zip71. 16x16x4点阵仿真演示范例.rar72. MCS-51单片机开发系统与监控分析.zip73. Atmel公司8051架构单片机Protel元件库.rar74. JL51单片机开发板原理图.pdf75. PCIe体系结构导读.pdf76. 基于单片机的红外遥控led电子钟程序代码.rar77. 基于AT89C51单片机的计算器.pdf78. 按键识别方法之一.doc79. 单片机35个实例4.doc80. IO并行口直接驱动LED显示.doc81. 单片机35个实例3.doc82. 99秒表设计.doc83. 单片机35个实例2.doc84. 8X8 LED点阵显示技术.doc85. 单片机35个实例1.doc86. 4×4矩阵式键盘识别技术.doc87. 基于单片机的闪烁灯制作.doc88. 4×4键盘及8位数码管显示构成的电子密码锁.doc89. 模拟计算器数字输入设计.doc90. 00-99计数器.doc91. 可预置可逆4位计数器.doc92. 00-59秒计时器(利用软件延时).doc93. “叮咚”门铃.doc94. “嘀、嘀、……”报警声.doc95. M68HC08系列单片机原理与应用嵌入式系统初步.zip96. 汇编循环流水灯设计.zip97. 基于单片机的简单计算器设计与仿真.doc98. EPSON8位单片机原理与应用.zip99. 交通灯课程设计.doc100. 8L系列8位单片机技术应用手册.zip
标签: 显示技术
上传时间: 2013-07-27
上传用户:eeworm