- 博客(34)
- 问答 (1)
- 收藏
- 关注
原创 C++ Interview Question test-3 question-5
#include class A{public: A(int n = 0) : m_n(n) { } A(const A &a) : m_n(a.m_n) { ++m_copy_ctor_calls; } ~A() { ++m_dtor_calls; }private: int m_n;public: static int m_copy_ct
2014-09-24 11:07:48
482
原创 C++ Interview Question test-3 question-4
#include class A{public: explicit A(int n = 0) : m_n(n) { }public: A& operator=(const A& a) { this->m_n = a.m_n; ++m_assignment_calls; return *this; }pu
2014-09-24 10:54:03
866
原创 C++ Interview Question test-3 question-3
#include class A{public: A(int i) : m_i(i) { }public: int operator()(int i = 0) const { return m_i + i; } operator int () const { return m_i; }private: int m_i; friend in
2014-09-24 10:32:38
409
原创 C++ Interview Question test-3 question-2
#include #include class A{public: A(int n) : m_n(n) { std::cout << m_n; } ~A() { std::cout << m_n; }private: int m_n;};int f(int n){ if (1 == n) { throw std::logic_
2014-09-24 10:29:19
527
原创 C++ Interview Question test-3 question-1
#include #include #include struct P{ bool operator()(const int &n) const { return n % 3 == 0; }};int main(){ std::list l({ 5, 2, 6, 1, 13, 9, 19 }); std::cout << l
2014-09-24 10:24:21
387
原创 Leetcode_Zig Zag Conversion
string convert(string s, int nRows) { if(nRows == 1)return s; string ans = s; int k = 2*(nRows-1); int index = 0; for(int i = 0; i < nRows; ++i){ int increment = k - 2*i; int currentindex =
2014-07-24 05:17:16
446
原创 Leetcode_String To Integer
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2014-07-24 05:07:57
307
原创 Leetcode_LongestSubstringWithoutRepeatingCharacters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2014-07-23 10:16:15
316
原创 Leetcode_AddTwoNumbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2014-07-23 10:13:53
296
原创 Leetcode_Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
2014-07-23 10:03:01
303
原创 PAT_1072
1072. Gas Station (30)时间限制200 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such a locati
2014-07-17 07:29:31
416
原创 PAT_1034
1034. Head of a Gang (30)时间限制100 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueOne way that the police finds the head of a
2014-07-17 07:26:20
384
原创 PAT_1067
1067. Sort with Swap(0,*) (25)时间限制100 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven any permutation of the numbers {
2014-07-17 07:25:45
332
原创 PAT_1054
1054. The Dominant Color (20)时间限制100 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueBehind the scenes in the computer's mem
2014-07-17 07:24:37
393
原创 PAT_1030
1030. Travel Plan (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA traveler's map gives the distances between c
2014-07-17 07:24:31
324
原创 PAT_1018
1018. Public Bike Management (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThere is a public bike service in H
2014-07-17 07:21:23
349
原创 PAT_1021
1021. Deepest Root (25)时间限制1500 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA graph which is connected and acyclic can b
2014-07-17 07:20:28
353
原创 1013. Battle Over Cities (25)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we nee
2014-07-17 07:18:12
327
原创 PAT_1012
1012. The Best Rank (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueTo evaluate the performance of our first yea
2014-07-17 07:15:03
434
原创 PAT_1009
1009. Product of Polynomials (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThis time, you are supposed to find
2014-07-12 09:00:03
310
原创 PAT_1008
1008. Elevator (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe highest building in our city has only one ele
2014-07-11 10:42:34
301
原创 PAT_1007
1007. Maximum Subsequence Sum (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a sequence of K integers { N
2014-07-11 10:41:50
376
原创 PAT_1016
1016. Phone Bills (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA long-distance telephone company charges its
2014-07-11 10:40:56
367
原创 PAT_1006
1006. Sign In and Sign Out (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAt the beginning of every day, the fi
2014-07-10 12:00:10
389
原创 PAT_1005
1005. Spell It Right (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a non-negative integer N, your task i
2014-07-10 11:57:58
340
原创 PAT_1003
1003. Emergency (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAs an emergency rescue team leader of a city, yo
2014-07-10 11:52:02
363
原创 PAT_1001
1001. A+B Format (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueCalculate a + b and output the sum in standard
2014-07-10 11:48:32
316
原创 PAT_1002
1002. A+B for Polynomials (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThis time, you are supposed to find A+
2014-07-10 11:47:49
490
原创 <<C++ design patterns and Derivatives Pricing>> 学习系列 CH1-对蒙特卡洛基本理解
前面的推导省略,该公式为期权定价公式 参数解释:r:riskless 利率 ==rT:期限 ==ExpireS0:起始spot price ==Spot:Vol ==VolK:strike price即成交价 ==Strike算法核心在于求期望,解决方法为多次计算f(S)并求其平均值来得到期望。 用变量x来表示每一次实验N(0,1)的取值,这
2013-08-19 04:05:32
1028
转载 股指期货(Stock Index Future)
全称为“股票价格指数期货”,也可称为股价指数期货或期指,是以股价指数为标的的标准化期货合约。 双方约定在未来的某个特定日期,可以按照事先确定的股价指数的大小,进行标的指数的买卖。 作为期货交易的一种,股指期货交易与普通商品期货交易具有基本相同的特征和流程。 一般的商品期货和国债期货、外汇期货等采用的是实物交割,而股指期货和短期利率期货等采用的是
2013-07-25 17:27:24
1856
原创 MFE常用数据结构之Lattice
今天看了DUFFY的C++ For FE中关于介绍Lattice的相关内容,为了表示对原作者的尊敬,首先我还是引用一下作者关于Lattice Structures的介绍的原话。"Lattice structures are well known in quantitative finance.“对,没错,原话就这么短。也许是太出名了吧,不需要过多赘述。不过我发现一个奇怪的现象就是在实现这个
2013-05-24 23:54:06
2355
转载 MFC_CListCtrl的用法详解
以下未经说明,listctrl默认view 风格为report相关类及处理函数MFC:CListCtrl类SDK:以 “ListView_”开头的一些宏。如 ListView_InsertColumn1. CListCtrl 风格LVS_ICON: 为每个item显示大图标LVS_SMALLICON: 为每个item显示小图标LVS_LIST: 显示一列带有
2013-05-15 21:15:39
652
转载 技术成长历程,从MFC开始
从大一开始接触MFC,一直对这其中的奥秘很是模糊,这次毕设,我故意绕开JAVA 选择使用MFC作为开发平台,也算是完结大学一大遗憾吧!另外还有一个原因就是,去美国之后搞金融工程编程用得最多的还是C++,java很少会用到,所以也算为以后做准备!废话少说,正文开始,转载一篇简单的开始。MFC用到较多的是CString,这篇文章关于CString和其他各种类型的转换。C++中doulbe/
2013-05-15 11:49:50
629
空空如也
c++ 使用函数对象时出错
2014-07-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人