摘要: 如果你电脑装了visual studio,或者wsl(windows下Linux子系统),vscode会优先用前两者的编译器,如果前两个都没检测到,vscode才会使用mingw,下图官方文档说的很清楚 而<bits/stdc++.h>万能头文件是mingw里才有的,所以为了include万能头文件 阅读全文
posted @ 2020-10-24 17:29 tao10203 阅读(12466) 评论(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 阅读(166) 评论(0) 推荐(0)
摘要: 并查集 并查集是一种维护集合的数据结构,它的名字中并、查、集三个字分别取自合并(Union),查找(Find),集合(Set).也就是说,并查集支持下面两个操作: 合并 查找 那么并查集是用什么实现的呢?其实就是一个数组; int father[MAXN]; 其中father[i]表示i的父亲节点 阅读全文
posted @ 2020-10-21 21:58 tao10203 阅读(78) 评论(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 阅读(111) 评论(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 阅读(232) 评论(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 阅读(83) 评论(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 阅读(125) 评论(0) 推荐(0)
摘要: 题目 给你一棵所有节点为非负值的二叉搜索树,请你计算树中任意两节点的差的绝对值的最小值。 示例: 输入: 1 \ 3 / 2 输出:1 解释:最小绝对差为 1,其中 2 和 1 的差的绝对值为 1(或者 2 和 3)。 思路 本题要求二叉搜索树任意两节点差的绝对值的最小值,而我们知道二叉搜索树有个性 阅读全文
posted @ 2020-10-12 11:41 tao10203 阅读(189) 评论(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 阅读(129) 评论(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)