![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 86
Wayne_Mai
小小竹排江中游,巍巍青山两岸走.
展开
-
Debug:error:default argument given for parameter
今天在尝试使用默认参数时,在linux的g++编译下却出现了如下报错:test.cpp: In function ‘int mores(int, int)’:test.cpp:16:24: error: default argument given for parameter 2 of ‘int mores(int, int)’ [-fpermissive] int mores(int m,i原创 2017-02-26 10:57:23 · 751 阅读 · 0 评论 -
Little Pony and Summer Sun Celebration CodeForces #453C 题解[C++]
题目来源http://codeforces.com/contest/453/problem/C题意理解Twilight Sparkle wanted to track the path of Nightmare Moon. Unfortunately, she didn’t know the exact path. What she knew is the parity of ...原创 2018-07-08 15:51:49 · 379 阅读 · 0 评论 -
Jamie and Interesting Graph CodeForces #916C[题解]
题目来源http://codeforces.com/contest/916/problem/C题意理解Jamie has recently found undirected weighted graphs with the following properties very interesting:The graph is connected and contains ex...原创 2018-06-01 19:24:57 · 365 阅读 · 0 评论 -
Liebig's Barrels CodeForces #985C 题解[C++]
题目来源http://codeforces.com/contest/985/problem/C题意分析You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k...原创 2018-06-01 13:33:55 · 534 阅读 · 0 评论 -
Shortest Path of the King CodeForces #3A 题解[C++]
题目来源http://codeforces.com/contest/3/problem/A题意解析The king is left alone on the chessboard. In spite of this loneliness, he doesn’t lose heart, because he has business of national importance....原创 2018-05-30 10:47:27 · 412 阅读 · 0 评论 -
Two Buttons CodeForces #520B 题解[C++]
题目来源http://codeforces.com/contest/520/problem/B题目描述Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive...原创 2018-05-30 00:28:03 · 456 阅读 · 0 评论 -
Triangle Leetcode #120 题解[C++]
题目来源https://leetcode.com/problems/triangle/题目描述Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, give...原创 2018-04-30 02:25:22 · 343 阅读 · 0 评论 -
House Robber Ⅱ Leetcode #213 题解[C++]
题目来源https://leetcode.com/problems/house-robber-ii/description/题目理解After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not ge...原创 2018-04-29 13:36:52 · 343 阅读 · 0 评论 -
Number of Atoms Leetcode #726 题解[C++]
题目来源https://leetcode.com/problems/number-of-atoms/description/题意分析Given a chemical formula (given as a string), return the count of each atom.An atomic element always starts with an upperc...原创 2018-05-12 14:11:18 · 670 阅读 · 0 评论 -
Sort Colors Leetcode #75 题解[C++]
题目来源https://leetcode.com/problems/sort-colors/description/题目描述Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, wit...原创 2018-05-12 12:57:17 · 367 阅读 · 0 评论 -
Median of Two Sorted Arrays Leetcode #4 题解[C++]
题目来源https://leetcode.com/problems/median-of-two-sorted-arrays/description/题意解析There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arr...原创 2018-05-01 01:46:01 · 199 阅读 · 0 评论 -
Merge K Sorted List Leetcode #23 题解[C++]
题目来源https://leetcode.com/problems/merge-k-sorted-lists/description/题目描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example: Input:...原创 2018-05-01 00:22:42 · 269 阅读 · 0 评论 -
Sort List Leetcode #148 题解[C++]
题目来源https://leetcode.com/problems/sort-list/description/题目描述Sort a linked list in O(n log n) time using constant space complexity.Example 1: Input: 4->2->1->3 Output: 1-&...原创 2018-04-30 18:07:01 · 277 阅读 · 0 评论 -
Gas Station Leetcode #134 题解[C++]
题目来源https://leetcode.com/problems/gas-station/description/题目理解There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimit...原创 2018-04-30 14:39:50 · 337 阅读 · 0 评论 -
Jump Game Leetcode #55 题解[C++]
题目来源https://leetcode.com/problems/jump-game/description/题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array ...原创 2018-04-30 10:36:37 · 249 阅读 · 1 评论 -
为什么我们不建议使用函数模板具体化
你有过使用了函数具体化模板却没有得到预期结果的经历吗?本文部分译自[Why Not Specialize Function Templates?]。具有一定英语阅读能力的读者强烈和强烈建议跳过此博客直接阅读原文。(http://www.gotw.ca/publications/mill17.htm#1)翻译 2017-05-26 18:47:48 · 1660 阅读 · 2 评论 -
const与非const参数调用重载函数
在重载函数时,我们有时可能会用到const参数与非const参数.原创 2017-05-26 21:24:54 · 654 阅读 · 0 评论 -
Preparing Olympiad CodeForces #550B 题解[C++]
题目来源http://codeforces.com/problemset/problem/550/B题意理解You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest...原创 2018-07-07 17:48:03 · 389 阅读 · 0 评论