• 《MIT 6.828 Homework 2: Shell》解题报告

    时间:2023-12-12 13:48:06

    Homework 2的网站链接:MIT 6.828 Homework 2: shell题目下载sh.c文件,在文件中添加相应代码,以支持以下关于shell的功能:实现简单shell命令,比如cat/echo/grep/ls/sort/uniq/wc等实现I/O重定向实现管道Optional chal...

  • 【剑指Offer】从上往下打印二叉树 解题报告(Python)

    时间:2023-12-11 18:58:35

    【剑指Offer】从上往下打印二叉树 解题报告(Python)标签(空格分隔): 剑指Offer题目地址:https://www.nowcoder.com/ta/coding-interviews题目描述:从上往下打印出二叉树的每个节点,同层节点从左至右打印。解题方法使用队列保存,每次把队列里的原先...

  • LeetCode 888 Fair Candy Swap 解题报告

    时间:2023-11-29 09:02:55

    题目要求Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar o...

  • 解题报告-1012. Numbers With Repeated Digits

    时间:2023-11-25 15:39:05

    Given a positive integer N, return the number of positive integers less than or equal to N that have at least 1 repeated digit. Example 1:Input: 20Out...

  • 二模14day1解题报告

    时间:2023-11-24 23:38:25

    注:Index数☞由4,7组成的十进制数。T1.全排列(permutation)求n个数的第k个排列中,有多少个Index位置上是Index数。由于k的范围比较小,n的范围比较大(都是109),所以从k入手,发现只要对后13位进行考虑即可(12!<109<13!)。由于数字可能很大,所以...

  • BestCoder19 1001.Alexandra and Prime Numbers(hdu 5108) 解题报告

    时间:2023-11-24 13:58:19

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5108题目意思:给出一个数正整数 N,N <= 1e9,现在需要找出一个最少的正整数 M,使得 N/M 是素数。如果找不到就输出0.一开始有想过将所有 <= 1e9 的素数求出来的,不过绝对超...

  • ACM 杭电HDU 2084 数塔 [解题报告]

    时间:2023-11-20 18:40:12

    数塔Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 36261    Accepted Submission(s): 21659Proble...

  • 【LeetCode】Permutations 解题报告

    时间:2023-11-19 18:59:00

    全排列问题。经常使用的排列生成算法有序数法、字典序法、换位法(Johnson(Johnson-Trotter)、轮转法以及Shift cursor cursor* (Gao & Wang)法。【题目】Given a collection of numbers, return all poss...

  • 【LeetCode】56. Merge Intervals 解题报告(Python & C++ & Java)

    时间:2023-11-19 18:42:48

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/目录题目描述题目大意解题方法日期题目地址:https://leetcode.com/problems/merge-intervals/#/description题目描述Given a col...

  • LeetCode: Sort Colors 解题报告

    时间:2023-11-19 18:42:03

    Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the ...

  • 【LeetCode】435. Non-overlapping Intervals 解题报告(Python)

    时间:2023-11-19 18:22:07

    【LeetCode】435. Non-overlapping Intervals 解题报告(Python)作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/题目地址:https://leetcode.com/problems/non-o...

  • 【LeetCode】915. Partition Array into Disjoint Intervals 解题报告(Python)

    时间:2023-11-19 18:20:49

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/题目地址: https://leetcode.com/problems/partition-array-into-disjoint-intervals/description/题目描述:Gi...

  • LeetCode 762 Prime Number of Set Bits in Binary Representation 解题报告

    时间:2023-11-18 20:40:49

    题目要求Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representa...

  • poj 2389.Bull Math 解题报告

    时间:2023-11-17 18:47:57

    题目链接:http://poj.org/problem?id=2389题目意思:就是大整数乘法。题目中说每个整数不超过 40 位,是错的!!!要开大点,这里我开到100.其实大整数乘法还是第一次写 = =.......大整数加法写得比较多。百练也有一条是大整数乘法,链接如下:http://baili...

  • 洛谷 P3373 【模板】线段树 2 解题报告

    时间:2023-11-17 16:52:37

    P3373 【模板】线段树 2题目描述如题,已知一个数列,你需要进行下面三种操作:1.将某区间每一个数乘上\(x\)2.将某区间每一个数加上\(x\)3.求出某区间每一个数的和输入输出格式输入格式:第一行包含三个整数\(N\)、\(M\)、\(P\),分别表示该数列数字的个数、操作的总个数和模数。第...

  • 洛谷 P2261 [CQOI2007]余数求和 解题报告

    时间:2023-11-17 16:22:10

    P2261 [CQOI2007]余数求和题意:求\(G(n,k)=\sum_{i=1}^n k \ mod \ i\)数据范围:\(1 \le n,k \le 10^9\)\(G(n,k)\)\(=\sum_{i=1}^n k-i*\lfloor \frac{k}{i} \rfloor\)\(=n*...

  • codeforces 557B. Pasha and Tea 解题报告

    时间:2023-11-16 15:41:29

    题目链接:http://codeforces.com/problemset/problem/557/B题目意思:有 2n 个茶杯,规定第 i 个茶杯最多只能装 ai 毫升的水。现在给出 w 毫升的水,需要把这 w 毫升(可以不用光)的水倒入到这 2n 个茶杯中,使得分给 n 个男的每个水杯的水恰好是...

  • LeetCode: Permutations 解题报告

    时间:2023-11-13 10:39:31

    PermutationsGiven a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1...

  • [BZOJ2946] [Poi2000]公共串解题报告|后缀数组

    时间:2023-11-11 19:40:51

    给出几个由小写字母构成的单词,求它们最长的公共子串的长度。单词个数<=5,每个单词长度<=2000尽管最近在学的是SAM...但是看到这个题还是忍不住想写SA...(其实是不知道应该怎么用SAM做...对于后缀数组而言,多个字符串的公共子串与两个处理起来并没有什么区别只要在中间加一些没有...

  • 【LeetCode】814. Binary Tree Pruning 解题报告(Python & C++)

    时间:2023-11-11 08:05:06

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/目录题目描述题目大意解题方法后序遍历日期题目地址:https://leetcode.com/problems/binary-tree-pruning/description/题目描述We a...