Description
In the two-player game "Two Ends", an even number of cards is laid out in a row. On each card, face up, is written a positive integer. Players take turns removing a card from either end...
分类:
其他好文 时间:
2014-08-13 01:18:05
阅读次数:
209
问题背景[cpp]view plaincopy#includeusingnamespacestd;vectordoubleValues(constvector&v){vectornew_values(v.size());for(autoitr=new_values.begin(),end_itr=n...
分类:
编程语言 时间:
2014-08-13 00:45:54
阅读次数:
266
二维 map map >map.find(x) 查找,如果没有返回值是 map.end()bool(map[x]) 查找,但是一旦访问下标那么就会产生一个节点map.empty() 判空map.size() 大小
分类:
其他好文 时间:
2014-08-13 00:44:54
阅读次数:
206
/*ID: lucien23PROG: sort3LANG: C++*/#include #include #include #include using namespace std;void exchange(int nums[], int begin, int end, int N, int x...
分类:
其他好文 时间:
2014-08-13 00:37:14
阅读次数:
210
对位宽为8的寄存器组rDATA[0:255]进行了初始化。reg [7:0] rDATA;initial begin $readmemh("sin.dat",rDATA); end将rSR[3]写入文件。reg [7:0] rSR[3];integer fid;initia...
分类:
其他好文 时间:
2014-08-13 00:32:55
阅读次数:
194
典型的DP题目,增加一个额外要求,输出子序列的开始和结尾的数值。
增加一个记录方法,nothing special。
记录最终ans的时候,同时记录开始和结尾下标;
更新当前最大值sum的时候,更新开始节点。
const int MAX_N = 10001;
long long arr[MAX_N];
int N, sta, end;
long long getMaxSubs()
{
...
分类:
其他好文 时间:
2014-08-12 22:04:14
阅读次数:
320
[问题描述]列出所有从数字1到数字n的连续自然数的排列,要求所产生的任一数字序列中不允许出现重复的数字。输入:n(1n then begin for i:=1 to n do write(a[i],' '); writeln; end else for i...
分类:
其他好文 时间:
2014-08-12 21:28:34
阅读次数:
341
代码风格变量不需要声明,定义类型,使用del + 变量名可以删除该变量一行一个语句,不用分号,用tab制表符缩进pass表示空方法体注释单行用#文本输出2.7中:print 'text'3.x中:print('text')默认输出行末回车,print(b, end=',')修改多个变量用逗号分隔开,...
分类:
编程语言 时间:
2014-08-12 16:41:24
阅读次数:
218
10,文件委托,以便操作文件。头部看起来像是这样。@interface MyFileManager : NSObject@property(strong)NSFileManager *fileManager;@end.m文件#import "MyFileManager.h"@implementati...
分类:
其他好文 时间:
2014-08-12 16:17:34
阅读次数:
250
脚本之家 '; //方法2 echo $ext1 = substr($imgurl,strrpos($imgurl, '.')); echo ''; //方法3 echo(@end(explode(".",$imgurl))); echo ''; //方法4 echo pathinfo($imgur...
分类:
Web程序 时间:
2014-08-12 16:09:54
阅读次数:
316