• CodeForces 706B Interesting drink (二分查找)

    时间:2024-06-11 16:21:09

    题意:给定 n 个数,然后有 m 个询问,每个询问一个数,问你小于等于这个数的数有多少个。析:其实很简单么,先排序,然后十分查找,so easy。代码如下:#pragma comment(linker, "/STACK:1024000000,1024000000")#include <cstd...

  • 计算机简单了解 - so_interesting

    时间:2024-03-03 18:00:48

    计算机简单了解 1、计算机五大部分1、控制器:计算机控制系统2、运算器:分为逻辑运算和数学运算逻辑运算:判断事物的对错及其可执行性数学运算:数字的计算3、存储器内存:需要供电优点:读取速度快缺点:断电数据丢...

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

    时间:2024-01-20 14:23:26

    http://codeforces.com/contest/703/problem/D题意:给出一行数,有m次查询,每次查询输出区间内出现次数为偶数次的数字的异或和。思路:这儿利用一下异或和的性质,在一个区间中,我们如果把所有数字都异或的话,可以发现最后偶数次的数字异或后都变成了0,只剩下了奇数次的...

  • Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum (离线树状数组+前缀xor)

    时间:2023-12-06 14:19:26

    题目链接:http://codeforces.com/contest/703/problem/D给你n个数,m次查询,每次查询问你l到r之间出现偶数次的数字xor和是多少。我们可以先预处理前缀和Xor[i],表示1~i的xor和。因为num^num=0,所以Xor[r] ^ Xor[l - 1]求的...

  • 【CF387D】George and Interesting Graph(二分图最大匹配)

    时间:2023-12-01 14:24:31

    题意:给定一张n点m边没有重边的有向图,定义一个有趣图为:存在一个中心点满足以下性质:1、除了这个中心点之外其他的点都要满足存在两个出度和两个入度。2、中心 u 需要对任意顶点 v(包括自己)有一条(u,v)的边和(v,u)的边,即他们都要互通。现在可以删除和添加边,使得给出的原图满足以上情况。询问...

  • INTERESTING AND OBSCURE INHERITANCE ISSUES WITH CPP

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

    1. using 关键字使用 using 关键字,可以将父类中被隐藏的函数暴露在子类中,但是需要注意的是,在相同情况下,子类函数的优先级更高。2.  继承构造函数(C++11)在c++11之前,构造函数、析构函数、赋值操作符,这些都不能被继承。但是,C++11允许我们使用 using 关键字来继承基...

  • 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题意求区间内数字出现次数为偶数的数的异或和思路区间内直接异或的话得到的是出现次数为奇数的异或和,要得到偶数的需要把区间内出现过的数字不重复的再异或一遍。离线按右端点排序,每次处理一个区间时,如果该数字出现过,则在...

  • 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) ,问在每个区间里所有出现偶数次的数异或的值。思路:容易想到,把区间内的所有的数都异或得到的是出现奇数次的数的值,然后再异或...

  • Calculations are rather interesting

    时间:2023-03-13 09:36:10

    Calculations are rather interesting, especially when some thoughts are involved therein.

  • 多校1005 HDU5785 Interesting (manacher)

    时间:2023-02-15 12:22:12

    // 多校1005 HDU5785 Interesting // 题意:给你一个串,求相邻两个回文串左边端点*右边端点的和 // 思路:马拉车算出最长回文半径,求一个前缀和,既得到每个点对答案的贡献。 // ans=L[i]*R[i-1] // L[i] 以i开始的所有回文串结尾坐标的和 // R...

  • Codeforces Round #350 (Div. 2) B. Game of Robots __ interesting

    时间:2023-02-02 19:23:59

    B. Game of Robots time limit per test 1 second ...

  • Codeforces Beta Round #9 (Div. 2 Only) E. Interesting Graph and Apples 构造题

    时间:2023-02-01 23:58:04

    E. Interesting Graph and Apples 题目连接: http://www.codeforces.com/contest/9/problem/E Description Hexadecimal likes drawing. She has drawn many g...

  • cf519D . A and B and Interesting Substrings 数据结构map

    时间:2022-12-19 22:08:32

    题意:已知26个小写字母有各自的权值(正,负,或0)现在给出一个字符串,长度<=1e5问这个字符串有多少个子串满足:开头的字母和结尾的字母一样字符串除了开头和结尾的字母外,其余的字母的权值和为0本来是一道水题,一看就知道大体的思路了,结果硬是搞了一个多小时先是用set,发现超时了,改为用map...

  • 多校赛3- Solve this interesting problem 分类: 比赛 2015-07-29 21:01 8人阅读 评论(0) 收藏

    时间:2022-11-27 15:42:31

    H - Solve this interesting problemTime Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 5323Appoi...