• hdu 5586 sum

    时间:2023-11-21 10:23:23

    Problem DescriptionThere is a number sequence A1,A2....An,you can select a interval [l,r] or not,all the numbers Ai(l≤i≤r) will become f(Ai).f(x)=(189...

  • LeetCode:Minimum Path Sum(网格最大路径和)

    时间:2023-11-20 23:32:34

    题目链接Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its pa...

  • 【一天一道LeetCode】#112. Path Sum

    时间:2023-11-15 20:23:20

    一天一道LeetCode本系列文章已全部上传至我的github,地址:ZeeCoder‘s Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处(一)题目Given a binary tree and a sum, determine if the tree has...

  • 【LeetCode OJ】Path Sum

    时间:2023-11-15 15:39:57

    Problem Link:http://oj.leetcode.com/problems/path-sum/One solution is to BFS the tree from the root, and for each leaf we check if the path sum equals...

  • 【leetcode】Combination Sum (middle)

    时间:2023-11-15 14:17:41

    Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate...

  • 用golang写的生成文件md5sum,检验文件md5sum

    时间:2023-11-15 11:58:44

    源代码地址: https://github.com/sndnvaps/md5sum-golang

  • bzoj 3944: Sum【莫比乌斯函数+欧拉函数+杜教筛】

    时间:2023-11-14 20:54:39

    一道杜教筛的板子题。两个都是积性函数,所以做法是一样的。以mu为例,设\( f(n)=\sum_{d|n}\mu(d) g(n)=\sum_{i=1}^{n}f(i) s(n)=\sum_{i=1}^{n}\mu(i) \),然后很显然对于mu\( g(n)=1\),对于phi\( g(n)=n*(...

  • [原创]leet code - path sum

    时间:2023-11-14 11:59:07

    ;            ;                ;                            }        }        ;            }};

  • 599. Minimum Index Sum of Two Lists(easy)

    时间:2023-11-13 16:12:53

    Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.You need to he...

  • 4Sum

    时间:2023-11-12 13:26:49

    Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic...

  • codeforces 703D D. Mishka and Interesting sum(树状数组)

    时间:2023-11-12 10:02:22

    题目链接:D. Mishka and Interesting sumtime limit per test3.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Mishk...

  • codeforces 703D Mishka and Interesting sum 偶数亦或 离线+前缀树状数组

    时间:2023-11-12 09:58:04

    题目传送门题目大意:给出n个数字,m次区间询问,每一次区间询问都是询问 l 到 r 之间出现次数为偶数的数 的亦或和。思路:偶数个相同数字亦或得到0,奇数个亦或得到本身,那么如果把一段区间暴力亦或,得到的其实就是出现次数为奇数的数字的亦或和,所以我们希望这段区间内的所有数字出现次数都+1,使奇偶性互...

  • Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum 离线+线段树

    时间:2023-11-12 09:56:09

    题目链接:http://codeforces.com/contest/703/problem/DD. Mishka and Interesting sumtime limit per test 3.5 secondsmemory limit per test 256 megabytes#### 问题...

  • Codeforces 703D Mishka and Interesting sum(离线 + 树状数组)

    时间:2023-11-12 09:50:07

    题目链接  Mishka and Interesting sum题意  给定一个数列和$q$个询问,每次询问区间$[l, r]$中出现次数为偶数的所有数的异或和。设区间$[l, r]$的异或和为$s(l, r)$, 区间$[l, r]$中所有出现过的数的异或和为$c(l, r)$那么每个询问的答案为...

  • CF #365 703D. Mishka and Interesting sum

    时间:2023-11-12 09:45:08

    题目描述D. Mishka and Interesting sum的意思就是给出一个数组,以及若干询问,每次询问某个区间[L, R]之间所有出现过偶数次的数字的异或和。这个东西乍看很像是经典问题,一列数字中所有数字出现偶数次,除了一个数字只出现一次,找出那个只出现过一次的数字。然而这个问题并不是要找...

  • Codeforces 703D Mishka and Interesting sum 离线+树状数组

    时间:2023-11-12 09:42:21

    链接Codeforces 703D Mishka and Interesting sum题意求区间内数字出现次数为偶数的数的异或和思路区间内直接异或的话得到的是出现次数为奇数的异或和,要得到偶数的需要把区间内出现过的数字不重复的再异或一遍。离线按右端点排序,每次处理一个区间时,如果该数字出现过,则在...

  • [leetcode]170. Two Sum III - Data structure design两数之和III - 数据结构设计

    时间:2023-11-11 16:23:53

    Design and implement a TwoSum class. It should support the following operations: add and find.add - Add the number to an internal data structure.find ...

  • subarray sum

    时间:2023-11-11 15:23:15

    public class Solution { /* * @param nums: A list of integers * @return: A list of integers includes the index of the first number and the i...

  • CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组(转)

    时间:2023-11-10 12:38:43

    转载自:http://www.cnblogs.com/icode-girl/p/5744409.html题目链接:CF #365 (Div. 2) D - Mishka and Interesting sum题意:给出n个数和m个询问,(1 ≤ n, m ≤ 1 000 000) ,问在每个区间里所...

  • CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组

    时间:2023-11-10 12:14:24

    题目链接:CF #365 (Div. 2) D - Mishka and Interesting sum题意:给出n个数和m个询问,(1 ≤ n, m ≤ 1 000 000) ,问在每个区间里所有出现偶数次的数异或的值。思路:容易想到,把区间内的所有的数都异或得到的是出现奇数次的数的值,然后再异或...