![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++重新起航
文章平均质量分 66
说到做到_我的忍道
这个作者很懒,什么都没留下…
展开
-
LeetCode 461. Hamming Distance 知识点复习之位运算
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x,原创 2017-07-12 21:08:57 · 255 阅读 · 0 评论 -
LeetCode 696. Count Binary Substrings 思路解析
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.Substring...原创 2018-07-09 18:40:44 · 200 阅读 · 0 评论 -
LeetCode 693. Binary Number with Alternating Bits 自我反思
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1:Input: 5Output: TrueExplanation:The binary representation o...原创 2018-07-01 15:44:29 · 161 阅读 · 0 评论 -
LeetCode 136. Single Number 自我反思
Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ...原创 2018-07-01 11:41:15 · 154 阅读 · 0 评论 -
LeetCode 496. Next Greater Element I 自我反思
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.Th...原创 2018-06-30 17:44:08 · 157 阅读 · 0 评论 -
LeetCode 669. Trim a Binary Search Tree 自我反思
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the re...原创 2018-06-30 15:16:19 · 134 阅读 · 0 评论 -
TOJ 3271 Deque Sort
题目:A "deque" is a data structure which allows constant time insertion and removal at both the front and back ends.In this problem, you will be given a list of numbers:A0 A1 A2 ... AN-1and aske原创 2017-11-30 22:44:28 · 335 阅读 · 1 评论 -
TOJ Code the Tree AC 代码 以及题解
Code the TreeTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 329 Accepted Runs: 101A tree (i.e. a connected graph without cycles) with vertices numbered by the integers 1,原创 2017-10-26 11:02:44 · 392 阅读 · 0 评论 -
C/C++ 多文件程序结构
声明与定义首先从声明和定义说起。 声明是数据对象的和函数的描述。声明的作用就是让编译器知道实体的名字,以及其数据类型或函数签名。如: external int x; //变量声明 void fun(); //函数声明 class A; //类声明定义则是实体本身,代表着实体在一个作用域的唯一描述。 如: int x; //变量定义 void fun()原创 2017-08-18 13:13:04 · 3503 阅读 · 0 评论 -
C++ 相对 C 的新特性
一、1. 新的数据类型C没有逻辑类型,非0为真,0为假C++ 有逻辑类型,true , false2.新的初始化方法C 初始化只有复制初始化 int x = 100;C++ 初始化不仅有复制初始化,还有直接初始化 ,int x (100);3.随用随定义C语言要把所有的变量定义写在函数体最前面C++ 随用随定义原创 2017-07-07 15:44:19 · 529 阅读 · 0 评论 -
LeetCode 617. Merge Two Binary Trees 自我反思
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. ...原创 2018-06-28 20:26:09 · 125 阅读 · 0 评论