码迷,mamicode.com
首页 >  
搜索关键字:maximizing xor    ( 1476个结果
Codeforces Round #563 (Div. 2) D、Ehab and the Expected XOR Problem
D. Ehab and the Expected XOR Problem Given two integers n and x, construct an array that satisfies the following conditions: for any element ai in the ...
分类:其他好文   时间:2019-06-11 00:52:20    阅读次数:124
B. Dima and a Bad XOR(异或+思维)
题目链接: https://codeforces.com/problemset/problem/1151/B 题目大意: 给你一个n*m的矩阵,每一行你可以选一个数,在每一行都选数的前提下,问你能不能能使每一行选的这些数的异或值不是0,如果存在的话,输出这些下标。 具体思路: 首先我们把第一列异或起 ...
分类:其他好文   时间:2019-06-05 23:50:36    阅读次数:121
Codeforces Round #553 B. Dima and a Bad XOR
题面: 传送门 题目描述: 题意很简单:在一个N*M的矩阵中(N行M列),问是否可以:每行选一个整数,使他们的异或和大于0。如果不可以,输出"NIE";如果可以,输出"TAK",并输出选择的整数。 题目分析: 这道题刚开始想直接暴力,但看到复杂度竟然是O(500^500),就怂了😭。到后面仔细观察 ...
分类:其他好文   时间:2019-06-04 22:31:00    阅读次数:146
十六进制字符串异或实现
/// <summary> /// 十六进制字符串异或操作 /// </summary> /// <param name="hex"></param> /// <param name="xor"></param> /// <returns></returns> public static strin ...
分类:其他好文   时间:2019-05-31 19:38:32    阅读次数:121
树形dp——cf1010D
一个点的改变如果对根节点的值不会造成任何影响,那么这个点的所有子节点的改变也不会对根节点造成影响 因为每次只改一个叶子节点,也就是一条到根的路径,可以先预处理出初始情况下的每个结点的值 分别讨论根节点是and,or,xor,not时,1|2 个结点取值 的 各种情况(也就那么几种) 比如x是and, ...
分类:其他好文   时间:2019-05-31 16:50:27    阅读次数:102
CodeForces - 617E XOR and Favorite Number (莫队+前缀和)
Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks you to count the ...
分类:其他好文   时间:2019-05-14 18:59:20    阅读次数:144
【Atcoder diverta2019 E】XOR Partitioning
题意:给一个序列,然后问有多少种方法能够把这个序列分成多块使得每一块的亦或和都相同。 思路:首先这种亦或和相同的题肯定要做前缀亦或和辣~ 然后我们可以看如果我们选了一些分界点,会发生什么。 首先每一个分界点肯定要么是$0$要么是$x$,即每一段的亦或和。 并且$0$和$x$总是间隔出现的。 所以我们 ...
分类:其他好文   时间:2019-05-12 22:34:21    阅读次数:183
【Codeforces Gym 100739 A】Queries
题意:给$n$个数$a_{1..n}$,以及$m$个询问,每个询问如下: 表示把第$p$位上的数改成$x$。 表示找出$\sum_{a\le l\le r\le b}a_l\ xor\ \ldots\ xor\ a_r$。 思路:线段树。 首先肯定把位拆开来考虑,那么我们建$10$棵线段树。 每棵线 ...
分类:其他好文   时间:2019-05-11 23:05:22    阅读次数:176
2017 ICPC西安区域赛 A - XOR (线段树并线性基)
链接:https://nanti.jisuanke.com/t/A1607 题面: Consider an array AA with n elements . Each of its element is A[i]A[i] (1 \le i \le n)(1≤i≤n) . Then gives t ...
分类:其他好文   时间:2019-05-11 21:21:29    阅读次数:126
Xor Sum 2 AtCoder - 4142 (异或前缀和性质+ 双指针)
Problem Statement There is an integer sequence A of length N. Find the number of the pairs of integers l and r (1≤l≤r≤N) that satisfy the following co ...
分类:其他好文   时间:2019-05-10 13:15:41    阅读次数:121
1476条   上一页 1 ... 30 31 32 33 34 ... 148 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!