ICode9

精准搜索请尝试: 精确搜索
  • 20210819 Emotional Flutter,Medium Counting,Huge Counting,字符消除22021-08-20 06:32:44

    考场 T1 一下想到了这题,将白块缩短 \(s\) 后维护类似的区间即可。 T2 T3 俩计数,直接跳了。 T4 的可行 \(t\) 集合相同相当与从 \(n\) 往前跳 kmp 数组,途径点相同,从前往后构造即可。 问题是可能会出现一个区间分裂成好几个(开个队列),\(k\) 很小而 \(a_i\) 很大(每次跳到块尾),然后一直调

  • HDU7059 Counting Stars2021-08-12 21:31:31

    传送门 这题贼简单,结果线段树竟然写错了,奇耻大辱。 由题意得,每一个数的'1'的个数只减不增,那么最多只会改31次,因此对于删除lowbit的操作,可以暴力修改,时间复杂度\(O(nlog^2n)\)。 而对于第二种操作,只是相当于把最高位的'1'往高挪了一位,那么用线段树维护区间最高位的和,以及向左移动

  • HDU6964:I love counting——题解2021-07-31 22:01:09

    https://acm.hdu.edu.cn/showproblem.php?pid=6964 给定一数列,每次查询$(l,r)$,找到数列中位于该区间内的数$c$满足$a\, xor c\le b$,求这样的数的个数(要求数不能相同)。 SB题但是我不太会套路,来补一下。 显然是建Trie,然后由于求的是不同的数所以很快想到可持久化Trie+每个节点存当

  • PAT——Counting Ones2021-07-31 19:58:59

    Counting Ones 题目AC代码参考 题目 The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1’s in 1, 10, 11, a

  • HDU6964 I love counting (字典树+莫队)2021-07-30 21:58:13

    题意: 给定一个长度为 n n n 的序列 c , q c,q c,q

  • J Counting Triangles(牛客想训练赛3-J题)2021-07-25 20:02:41

    题目:https://ac.nowcoder.com/acm/contest/11254/J 题意:给你一张图,n个点,任何两个点之间都有边,边权要么是0要么是1,问三条边权相等的三角形的数量。 题解:图的大小给的是8000,暴力三重循环肯定不行。假设这个三角形中有一个点是重要点,那么咱枚举每一个点当三角形中的重要点;首先,任

  • 2021“MINIEYE杯”中国大学生算法设计超级联赛(2)1004 - I love counting trie操作好题2021-07-25 14:35:57

    题意: 一个长度为\(n\)的序列,每个位置\(i\)有一个权重\(w_i\),然后有\(Q\)个询问,每次询问包含\(l,r,a,b\)四个参数,其询问含义为区间\([l,r]\)有多少种权值\(w_i\)使得,\(w_i⊕a \le b\)。 思路: 这个题其实一看到的话找出符合特定大小关系的异或值,就会往\(trie\)树上考虑,又看到询问让

  • POJ3046 Ant Counting 题解2021-07-24 23:00:52

    CSDN同步 原题链接 朴素动态规划。 用 \(f_{i,j}\) 表示前 \(i\) 种 蚂蚁选了 \(j\) 种 的方案数。类似背包。 首先不考虑个数限制, \(f_{i,j} = f_{i-1,j} + f_{i,j-1}\). 这样完成了多重背包的效果(就是 \(f_i\) 的那一行在不断滚动),但是若设第 \(i\) 种蚂蚁有 \(a_i\) 个,则不能完

  • Counting Triangles2021-07-24 22:00:42

    题目描述 Goodeat finds an undirected complete graph with n vertices. Each edge of the graph is painted black or white. He wants you to help him find the number of triangles (a, b, c) (a < b < c), such that the edges between (a, b), (b, c), (c, a) have t

  • CF990G GCD Counting2021-06-26 14:00:36

    tag:莫比乌斯反演,并查集 题意:给一棵树带点权,对于每个 \(1\le k\le 2\cdot10^5\),求出有多少条路径的 \(gcd=k\)。 \(n,a_i\leq 2\cdot10^5\) 对于一个 \(k\),要求的是 \[\sum_{x,y}[gcd(x\to y)=k] \]这个看上去很眼熟,试试莫比乌斯反演一下 \[\sum_{g}\mu(g)(\sum_{x,y}[(g\cdot d

  • CF1408 - Clusterization Counting2021-05-08 13:04:18

    CF1408 - Clusterization Counting 题目大意 给定\(n\)个点无向带权完全图,求将这些点分组,使得 组内的边边权 都小于 组内点连到组外点的边权 保证边权不同 分析 考虑如何确定合法的分组 从小到大依次加入每一条边,则一个合法的分组一定在某一个时刻满足 1.这个分组是一个极大的连

  • CF990G-GCD Counting【dfs】2021-04-16 19:30:17

    正题 题目链接:https://www.luogu.com.cn/problem/CF990G 题目大意 给出一棵有点权的树,对于每个 k k k求有多条路径的点权 g

  • P1596 [USACO10OCT]Lake Counting S2021-04-06 23:32:44

        #include<bits/stdc++.h> using namespace std; int dir[8][2]={ {1,1}, {1,-1}, {1,0}, {0,1}, {0,-1}, {-1,-1}, {-1,0}, {-1,1} }; char maps[101][101]; int ans,n,m; bool check(int x,int y) { return x>=0&&

  • C++ | 多线程编程(四) 信号量2021-03-19 16:57:44

    https://zh.cppreference.com/w/cpp/thread/counting_semaphore 成员函数: release:增加内部计数器并除阻获取者 相当于V操作acquire: 减少内部计数器或阻塞到直至能如此 相当于p操作 #include <iostream> #include <thread> #include <semaphore> using namespace std; /*

  • P4778 Counting swaps2021-03-09 23:32:06

    题意描述 Counting swaps 给定一个 \(1∼n\) 的排列,求用最少的交换次数将给定排列变成单调上升的序列 \(1,2,\cdots,n\) 的方案数。 结果对 \(10^9+9\) 取模。 据说很套路的计数题,那么我连套路都不会了。 算法分析 基本性质 假设我们将初始序列 \(p\) 的每一对 \((i,p_i)\) 连边

  • P3605 [USACO17JAN]Promotion Counting P2021-02-09 13:32:03

    题意: 大概是给定一个有\(n\)个节点的树,每个节点都有个权值\(p[i]\),需要求出每个节点的逆序对,逆序对当且仅当该点比其子节点的数大,问每个节点有几对逆序对?(\(n\leq10^5,p[i]\leq10^9\)) 题解: 我们遍历每个节点,先减去已经插入树状数组中的逆序对,因为已经插入的不是他的子节点不记录

  • UVA1225Digit Counting2021-02-06 09:31:05

    Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000). After that, he counts the number of times each digit (0 to 9) appears in the sequenc

  • 「ACM Shenyang Onsite 2016」E.Counting Cliques(dfs暴力+优化)2021-01-20 21:35:10

    描述 传送门:我是传送门 A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques with a specific size S in the graph.  输入 The first l

  • 洛谷-P1596 [USACO10OCT]Lake Counting S2020-12-21 09:34:59

    洛谷-P1596 [USACO10OCT]Lake Counting S 原题链接:https://www.luogu.com.cn/problem/P1596 题目描述 输入格式 输出格式 输入输出样例 说明/提示 C++代码 题目描述 Due to recent rains, water has pooled in various places in Farmer John's field, which is represented

  • codeforces-102501J Counting Trees题解2020-12-06 10:03:05

    题意:给你一个二叉树的中序遍历$(n<=1000000)$,节点值为$1$~$1000000$的整数,可重复。问有多少种树的形态满足每个子树的根节点的权值小于等于该子树所有节点的权值。模$1e9+7$。 比较显然的一点是如果n个数各不相同,那么答案是1。每次我们找出当前区间的最小的数,把他作为根节点,然后将

  • [codechef] Counting D-sets(容斥原理)2020-11-24 08:00:36

    Problem 题目地址 Solution 首先做一步转换,强制所有的点向坐标轴平移,这样对于每一维至少有一个点该维的坐标是 \(0\)(以下简述为:每一维至少一个 \(0\)。) 这样一个点集的直径就是这个点集每一维每个点该维最大坐标的最大值。 对于恰好这个条件,不好求。可以转化为设 \(f(D)\) 为直径

  • CF893E Counting Arrays2020-11-17 17:32:13

    对于每组数据,给出x和y,求一个长度为y的序列,其乘积为x,允许有负数,求这种序列的个数,对1e9+7取模 首先不考虑正负号,那么我们可以把原题看作把\(x\)的质因子分配到序列的若干个位置中,那么设\(x=\prod_ip_i^{k_i}\),则对于每个\(p_i\),都有把\(k_i\)个小球放到\(y\)个有标号盒子中,并且盒子

  • POJ 2386 Lake Counting2020-11-15 21:35:18

    Lake Counting(POJ 2386) 原题目如下: Description Due to recent rains, water has pooled in various places in Farmer John's field, ### which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) ### squares. Each square contain

  • 题解 SP34009 【CTTC - Counting Child】2020-10-04 11:00:33

    题解 SP34009 【CTTC - Counting Child】 蒟蒻来发第二个题解啦! 这道题目提交了三次才过 。我绝对不会告诉你们我是写错了格式 ,把 Case 写成了 case 。 好的,言归正传 : 做这一题你首先要学会什么是树 ,什么是树的遍历。 如果不知道就找一下万能的百度吧 ! 好 , 拿到这一道题目首先想问

  • POJ 2282 The Counting Problem2020-10-02 11:34:23

    Description Given two integers a and b, we write the numbers between a and b, inclusive, in a list. Your task is to calculate the number of occurrences of each digit. For example, if a = 1024 and b = 1032, the list will be 1024 1025 1026 1027 1028 1029 10

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有