10 2020 档案

摘要:如果你电脑装了visual studio,或者wsl(windows下Linux子系统),vscode会优先用前两者的编译器,如果前两个都没检测到,vscode才会使用mingw,下图官方文档说的很清楚 而<bits/stdc++.h>万能头文件是mingw里才有的,所以为了include万能头文件 阅读全文
posted @ 2020-10-24 17:29 tao10203 阅读(12510) 评论(1) 推荐(0)
摘要:1107 Social Clusters (30分) When register on a social network, you are always asked to specify your hobbies in order to find some potential friends wit 阅读全文
posted @ 2020-10-21 22:49 tao10203 阅读(168) 评论(0) 推荐(0)
摘要:并查集 并查集是一种维护集合的数据结构,它的名字中并、查、集三个字分别取自合并(Union),查找(Find),集合(Set).也就是说,并查集支持下面两个操作: 合并 查找 那么并查集是用什么实现的呢?其实就是一个数组; int father[MAXN]; 其中father[i]表示i的父亲节点 阅读全文
posted @ 2020-10-21 21:58 tao10203 阅读(83) 评论(0) 推荐(0)
摘要:1064 Complete Binary Search Tree (30分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left 阅读全文
posted @ 2020-10-21 15:25 tao10203 阅读(121) 评论(0) 推荐(0)
摘要:1007 Maximum Subsequence Sum (25分) Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i 阅读全文
posted @ 2020-10-12 20:30 tao10203 阅读(233) 评论(0) 推荐(0)
摘要:1006 Sign In and Sign Out (25分) At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one 阅读全文
posted @ 2020-10-12 19:26 tao10203 阅读(88) 评论(0) 推荐(0)
摘要:1002 A+B for Polynomials (25分) This time, you are supposed to find A+B where A and B are two polynomials. Input Specification: Each input file contain 阅读全文
posted @ 2020-10-12 19:10 tao10203 阅读(133) 评论(0) 推荐(0)
摘要:题目 给你一棵所有节点为非负值的二叉搜索树,请你计算树中任意两节点的差的绝对值的最小值。 示例: 输入: 1 \ 3 / 2 输出:1 解释:最小绝对差为 1,其中 2 和 1 的差的绝对值为 1(或者 2 和 3)。 思路 本题要求二叉搜索树任意两节点差的绝对值的最小值,而我们知道二叉搜索树有个性 阅读全文
posted @ 2020-10-12 11:41 tao10203 阅读(198) 评论(0) 推荐(0)
摘要:1019 General Palindromic Number (20分) A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For ex 阅读全文
posted @ 2020-10-05 23:27 tao10203 阅读(130) 评论(0) 推荐(0)
摘要:1015 Reversible Primes (20分) A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in 阅读全文
posted @ 2020-10-05 20:40 tao10203 阅读(154) 评论(0) 推荐(0)
摘要:Problem: With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams 阅读全文
posted @ 2020-10-05 19:11 tao10203 阅读(136) 评论(0) 推荐(0)
摘要:Problem: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors 阅读全文
posted @ 2020-10-05 18:43 tao10203 阅读(135) 评论(2) 推荐(1)
摘要:settings.json里面加入 "C_Cpp.clang_format_style": { BasedOnStyle: Google, IndentWidth: 4} 添加之后的效果 阅读全文
posted @ 2020-10-05 15:44 tao10203 阅读(1536) 评论(0) 推荐(0)
摘要:Problem: Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are 阅读全文
posted @ 2020-10-04 18:20 tao10203 阅读(203) 评论(0) 推荐(0)
摘要:题目 请实现一个函数,把字符串 s 中的每个空格替换成"%20"。要求:空间复杂度 O(1) 示例 1: 输入:s = "We are happy."输出:"We%20are%20happy." 限制: 0 <= s 的长度 <= 10000 思路 题目要求空间复杂度为O(1),所以不能通过新建字符 阅读全文
posted @ 2020-10-04 15:58 tao10203 阅读(133) 评论(0) 推荐(0)