1.让每次启动程序运行都能产生不同的随机数:#include int main(){ srand(time(0));// set a new seed for random function}2.产生随机数在srand statement 之后:(1)产生0到a的随机数:rand%(a+1); .....
分类:
其他好文 时间:
2014-07-03 09:36:33
阅读次数:
171
package Gui;/** * check box must be in a same ButtonGroup can`t be selected * at the same time * * */import javax.swing.*;import java.awt.*;public c.....
分类:
其他好文 时间:
2014-07-03 07:18:15
阅读次数:
142
相遇周期Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2286 Accepted Su...
分类:
其他好文 时间:
2014-07-03 06:31:09
阅读次数:
166
吞吐率ab -n1000 -c 100 http://new.dangdang.com/测试结果重点关注:1个Requests per second,2个Time per request影响吞吐率的因素:并发策略、I/O模型、I/O性能、CPU核数、程序本身逻辑复杂度1、CPU并发计算系统负载:ca...
分类:
Web程序 时间:
2014-07-02 22:56:26
阅读次数:
208
Time Limit: 5000MS Memory limit: 65536K题目描写叙述Haveyou ever played a popular game named "Fruit Ninja"?Fruit Ninja (known as Fruit Ninja HD on the iPad a...
分类:
其他好文 时间:
2014-07-02 22:36:05
阅读次数:
309
Sort a linked list in O(n log n)
time using constant space complexity.
看到O(n log n)的排序算法,适合单链表的首先想到的就是归并排序
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* Lis...
分类:
其他好文 时间:
2014-07-02 08:47:34
阅读次数:
239
Idiomatic Phrases Game
Time Limit: 2 Seconds Memory Limit: 65536 KB
Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain me...
分类:
其他好文 时间:
2014-07-02 08:11:52
阅读次数:
167
新特性HTML5 中的一些有趣的新特性:用于绘画的 canvas 元素用于媒介回放的 video 和 audio 元素对本地离线存储的更好的支持新的特殊内容元素,比如 article、footer、header、nav、section新的表单控件,比如 calendar、date、time、emai...
分类:
Web程序 时间:
2014-07-01 19:07:37
阅读次数:
318
MAX Average Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5855 Accepted Submission(s): 1456
Problem Description
Consid...
分类:
其他好文 时间:
2014-07-01 15:51:15
阅读次数:
300
Ø 读取文件的时间
#!/bin/bash
for file in `ls /root`
do
stat $file>1.txt
sed -n "7p" 1.txt>2.txt
usetime= awk -F ":" '{print $2}' 2.txt
echo "time="$file $usetime
done
Ø 读取文件的每行while...
分类:
其他好文 时间:
2014-07-01 06:49:51
阅读次数:
204