Elmagnifico's Blog

云深不知归处

C++中坑人的fstream(一)

c/c++,fstream

编译环境 Visual Studio 2013 标准C++控制台程序 起因 我只是想写一个简单,可以往已有文本文件中添加一行内容而已. 比如: 往所有的markdown文件中添加”catalog: true”使老的文章中也能自动出现侧面目录栏 --- layout: post title: "C++中坑人的fstream" subtitle: "c/...

LeetCode Solution(Easy.97-100)

c/c++,python,for work

97.Construct the Rectangle For a web developer, it is very important to know how to design a web page’s size. So, given a specific rectangular web page’s area, your job by now is to design a recta...

LeetCode Solution(Easy.93-96)

c/c++,python,for work

93.Number Complement Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fi...

LeetCode Solution(Easy.89-92)

c/c++,python,for work

89.Power of Three Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 89.Power of Three-Analysis 不用循环和递归判断是...

LeetCode Solution(Easy.85-88)

c/c++,python,for work

85.Number of Boomerangs Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equals the distance between ...

LeetCode Solution(Easy.81-84)

c/c++,python,for work

81.First Unique Character in a String Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. Examples: s = "leetcode" return 0. s = ...

LeetCode Solution(Easy.77-80)

c/c++,python,for work

77.Ransom Note Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from...

LeetCode Solution(Easy.73-76)

c/c++,python,for work

73.Island Perimeter You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally)....

LeetCode Solution(Easy.69-72)

c/c++,python,for work

69.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....

LeetCode Solution(Medium.17-20)

c/c++,python,for work

17.Unique Paths A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is tr...