常量对象与常量成员函数来防止修改对象,实现最低权限原则。可以用关键字const来指定对象是不可修改的,任何修改该对象的企图,都会导致编译错误。例如:constTimenoon(12,0,0);声明一个Time类的常量对象noon,并将它初始化为中午12点。C++不允许在常量对象上调用成员函数,除非成...
分类:
其他好文 时间:
2014-05-22 06:39:25
阅读次数:
229
class Solution {public: int maxProfit(vector
&prices) { int len = prices.size(); if (len maxv) { maxv = cur; ...
分类:
其他好文 时间:
2014-05-22 05:09:49
阅读次数:
256
Definitions:?StressTests the server –Peak volume
over a short span of time?LoadTests the database –Largest load the database can
handle at one time?Vo...
分类:
其他好文 时间:
2014-05-22 01:29:01
阅读次数:
338
题目:We all know that Bin-Laden is a notorious
terrorist, and he has disappeared for a long time. But recently, it is reported
that he hides in Hang Zho...
分类:
其他好文 时间:
2014-05-22 01:09:55
阅读次数:
328
Alignment
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 12571
Accepted: 4021
Description
In the army, a platoon is composed by n soldiers. During the m...
分类:
其他好文 时间:
2014-05-21 11:23:16
阅读次数:
227
【原题】
2506: calc
Time Limit: 10 Sec Memory Limit: 256 MB
Submit: 228 Solved: 112
Description
给一个长度为n的非负整数序列A1,A2,…,An。现有m个询问,每次询问给出l,r,p,k,问满足l
Input
第一行两个正整...
分类:
其他好文 时间:
2014-05-21 10:38:18
阅读次数:
267
Tour
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 3470
Accepted: 1545
Description
John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a...
分类:
其他好文 时间:
2014-05-21 08:24:18
阅读次数:
354
Subset
Time Limit: 30000MS
Memory Limit: 65536K
Total Submissions: 1562
Accepted: 261
Description
Given a list of N integers with absolute values no larger than 1015,...
分类:
其他好文 时间:
2014-05-21 07:16:37
阅读次数:
409
对象
计数器
描述
度量值
System
%Total
Processor
Time
系统上所有处理器都忙于执行非空闲线程的时间的平均百分比,体现整体的处理器利用率。例如在多处理器系统上,当所有处理器始终处于忙碌状态,则此值为100%;当所有处理器中的1/4处于100%忙碌状态,则此值为25%
该值若持续高于80%~...
Palindrome
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 50914
Accepted: 17537
Description
A palindrome is a symmetrical string, that is, a string read...
分类:
其他好文 时间:
2014-05-21 06:50:05
阅读次数:
281