摘要:
1 think before codingcode incrementally2sentinel valuesentinel-controlled loop3 输入输出重定向 > = 1;i--){ sum += 1d/i; }System.out.println(sum);//11.3970039... 阅读全文
摘要:
1单向if语句双向if语句dangling elseswitch:char,byte,short,int2javax.swing.JOptionPane.showConfirmDialog(null,text);返回值:JOptionPane.YES_OPTION:0JOptionPane.NO_O... 阅读全文
摘要:
1原始数据类型(primitive data type) == 基本类型 (fundamental type)byte short int long float double char boolean引用类型 reference type2System.in System.outjava.util.... 阅读全文
摘要:
java语言程序设计基础篇笔记1. 几种有名的语言COBOL:商业应用FORTRAN:数学运算BASIC:易学易用Visual Basic,Delphi:图形用户界面C:汇编语言的强大功能和易学性,可移植性C++:系统软件C#:.netjava:互联网应用程序2. java语言规范:java.sun... 阅读全文
摘要:
CowsTime Limit:2000MSMemory Limit:65536KTotal Submissions:7038Accepted:3242DescriptionYour friend to the south is interested in building fences and tu... 阅读全文
摘要:
Nlogonia is fighting a ruthless war against the neighboring country of Cubiconia. The Chief General of Nlogonia's Army decided to attack the enemy wit... 阅读全文
摘要:
F. Treeland Tourtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe "Road Accident" band is plan... 阅读全文
摘要:
Sum of Consecutive Prime NumbersTime Limit:1000MSMemory Limit:65536KTotal Submissions:19697Accepted:10800DescriptionSome positive integers can be repr... 阅读全文
摘要:
Run AwayTime Limit:3000MSMemory Limit:65536KTotal Submissions:6482Accepted:1993DescriptionOne of the traps we will encounter in the Pyramid is located... 阅读全文
摘要:
首先是转载,觉得写得真好一. 爬山算法 ( Hill Climbing ) 介绍模拟退火前,先介绍爬山算法。爬山算法是一种简单的贪心搜索算法,该算法每次从当前解的临近解空间中选择一个最优解作为当前解,直到达到一个局部最优解。 爬山算法实现很简单,其主要缺点是会陷入局部最优解,而不一定能搜索到全局最优... 阅读全文