2018 CCPC 湘潭邀请赛 & 2018 JSCPC

Problem A

Problem B

Problem C

Problem D

Problem E

Problem F

Problem G

Problem H

Problem I

Problem J

Problem K

原文地址:https://www.cnblogs.com/cxhscst2/p/9062107.html

时间: 2024-08-01 00:01:32

2018 CCPC 湘潭邀请赛 & 2018 JSCPC的相关文章

2018年湘潭邀请赛

题目链接: http://acm.hdu.edu.cn/listproblem.php?vol=53 A题: 题意: 总共有sum(a[i])篇文章,文章含有i条引用的文章数是ai,求最大的h使得最少有h篇文章含有至少h条引用. 思路: 二分,不过一开始把i和ai的含义读反wa了几发. 代码实现如下: 1 #include <set> 2 #include <map> 3 #include <deque> 4 #include <queue> 5 #incl

2017 CCPC 湘潭邀请赛

Problem A Problem B Problem C Problem D 直接输出即可. #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i(a); i <= (b); ++i) #define dec(i, a, b) for (int i(a); i >= (b); --i) const int N = 1e2 + 10; int c[N][N], f[N][N]; i

2018 CCPC Girl Contest

Time:2018.6.3 Link A 题意 给一个长度为n的序列,有m个询问,每个询问三个数 l,r,d,问a[l] ×a[l+1]×.....×a[r],是否为d的倍数  (n<=1e5,1<=l<=r<=n,a[i]<=1e5 ,d<=1e5 ) 分析 对每个数分解质因数,维护一个前缀质因数和,对于每次询问,查询区间[l,r]的质因数是否全部含有d的质因数即可 时间复杂度O(T*nlogn) 2018 CCPC Girl Contest 原文地址:https:/

2018 CCPC网络赛

2018 CCPC网络赛 Buy and Resell 题目描述:有一种物品,在\(n\)个地点的价格为\(a_i\),现在一次经过这\(n\)个地点,在每个地点可以买一个这样的物品,也可以卖出一个物品,问最终赚的钱的最大值. solution 用两个堆来维护,一个堆维护已经找到卖家的,一个堆维护还没找到卖家的. 对于第\(i\)个地点,在已经找到卖家的堆里找出卖的钱的最小值,如果最小值小于\(a_i\),则将卖家换成\(i\),然后将原来的卖家放到没找到卖家的那里:如果最小值对于\(a_i\)

2018 CCPC 吉林站 H Lovers

2018 CCPC 吉林站 H Lovers 传送门:https://www.spoj.com/problems/LIS2/en/ 题意: q次操作 1.将第l~r个数的左边和和右边都加上一个数d, 使得这个数变成 \(ds_id\)的形式 2.询问区间和 题解: 线段树题 这个update操作不好维护,我们来冷静分析一下 对于一个数x,他的长度为len,我们在他后面加上一个数d,那么他的长度就变成了len+1,这个数x就变成了\(x*10+d\) 同理,在前面加上一个数,这个数x就变成了\(d

[题解]2018湘潭邀请赛

A.Easy h-index 题目描述 The h-index of an author is the largest h where he has at least h papers with citations not less than h.Bobo has published many papers. Given a0, a1, a2 ,..., an which means Bobo has published a i papers with citations exactly i ,

Just h-index 2018湘潭邀请赛

题目描述 The h-index of an author is the largest h where he has at least h papers with citations not less than h . Bobo has published n papers with citations \(a_1 , a_2 ,..., a_n\) respectively. One day, he raises q questions. The $i_{th} $question is d

2018 ACM-ICPC 宁夏邀请赛

A 小甜甜 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cmath> 5 #include <vector> 6 #include <queue> 7 #include <set> 8 #include <map> 9 #include <string> 10 #include <st

2018 CCPC 女生专场

Problem A (小)模拟. Problem B 观察到$d$大于$316$的质因子最多只有一个,那么先判掉$<= 316$的所有质因子,搞个前缀和就可以了. 然后特判大于$316$的质因子即可,方法有很多. Problem C Problem D Problem E Problem F 勇敢地直接上树上莫队,对$01$数组分块,同时维护每个块内$0$的个数,然后注意一些细节,就可以AC了. 在HDOJ上大概要跑$10s$. 二分答案+主席树方法待补. Problem G 全场题. Prob