摘要: 背景 给定一个正整数序列a(1),a(2),...,a(n),(1<=n<=20)不改变序列中每个元素在序列中的位置,把它们相加,并用括号记每次加法所得的和,称为中间和。 例如:给出序列是4,1,2,3。 第一种添括号方法:((4+1)+(2+3))=((5)+(5))=(10)有三个中间和是5,5 阅读全文
posted @ 2017-11-02 21:43 JayWang 阅读(264) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; template inline void read(T &_a){ bool f=0;int _ch=getchar();_a=0; while(_ch'9'){if(_ch=='-')f=1;_ch=getchar();} while(_ch>='0' &&... 阅读全文
posted @ 2017-11-02 19:41 JayWang 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; template inline void read(T &_a){ bool f=0;int _ch=getchar();_a=0; while(_ch'9'){if(_ch=='-')f=1;_ch=getchar();} while(_ch>='0' && _ch<='9'... 阅读全文
posted @ 2017-11-02 19:41 JayWang 阅读(178) 评论(0) 推荐(0) 编辑