2019-ACM-CCPC-Online-Contest】的更多相关文章

The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Now it's 20000 A.D., and the androids also participate in the ACM Inter-national Collegiate Programming Contest (ACM/ICPC). In order to sele…
链接: https://codeforces.com/gym/102394/problem/F 题意: Harbin, whose name was originally a Manchu word meaning "a place for drying fishing nets", grew from a small rural settlement on the Songhua River to become one of the largest cities in Northea…
Contest Problem Description In the ACM International Collegiate Programming Contest, each team consist of three students. And the teams are given 5 hours to solve between 8 and 12 programming problems. On Mars, there is programming contest, too. Each…
题目大意:给出一个n个元素的数组A,A中所有元素都是不重复的[1,n].有两种操作:1.将pos位置的元素+1e72.查询不属于[1,r]中的最小的>=k的值.强制在线. 题解因为数组中的值唯一,且在1到n的范围内,而询问的r和k也在1到n的范围内. 所以对于任意一个被操 作1修改过的值都不会成为询问的答案,而询问的结果也必然在k到n+1的范围内. 因为没有被修改过 值是唯一的,所以可以建立权值线段树,维护权值区间内的值所在下标的最大值.而询问则转化为不小 于k的值里面,下标超过r的最小权值是多…
以前一直想参加ICPC或CCPC的,所以即使得知比赛会打星号,我还是想去. 感觉自己对什么都没有兴趣了,比较渴望找点快乐.. 这场比赛非常强,吉老师和杜老师都来啦,还有岛娘! 有幸要到了签名 滚榜的时候好热血呀不小心拍到了jls 总结一下吧 D题,…
#include <stdio.h> #include <stdlib.h> typedef struct Node { int data; struct Node *next; }LNode,*LinkList; void construt(int temp,struct Node *head) { struct Node *cycle; cycle = head; while(temp--) { cycle->next = (struct Node*)malloc(siz…
 B Stealing Harry Potter's Precious 题目大意:给定一个n*m的地图,某些点可以走,某些点可以走某些点不可以走,给定一个起点,又给出了k个点k<=4,要求从起点经过K个点最短的长度是多少 思路:给每个点标定状态为[x][y][state],state是压缩状态的已经走过需要走过点的集合,然后bfs一下即可 #include<cstdio> #include<queue> #include<cstring> #define maxn…
传送门 D - Decimal 题意: 询问\(\frac{1}{n}\)是否为有限小数. 思路: 拆质因子,看是不是只包含2和5即可,否则除不尽. Code #include <bits/stdc++.h> #define MP make_pair #define fi first #define se second #define sz(x) (int)(x).size() using namespace std; typedef long long ll; typedef pair<…
题解: https://files.cnblogs.com/files/clrs97/HarbinEditorialV2.zip Code: A. Artful Paintings /* let x=f[n] f[i-1]-f[i]<=0 i -> i-1 0 f[i]-f[i-1]<=1 i-1 -> i 1 f[l-1]-f[r]<=-k r -> l-1 -k f[r]-f[l-1]<=-k+x l-1 -> r -k+x f[n]-f[0]<=…
目录 题目链接 思路 代码 题目链接 传送门 思路 看到这题还比较懵逼,然后机房大佬板子里面刚好有这个公式\(gcd(a^n-b^n,a^m-b^m)=a^{gcd(n,m)}-b^{gcd(n,m)}\),然后自己随手推了一下就过了. 在知道上面那个公式后化简如下: \[ \begin{aligned} &\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{i}(i-j)[gcd(i,j)=1]&\\ =&\sum\limits_{i=1}^{n}(i…
线段树分治. 把size看成时间,相当于时间 $l$ 加入这条边,时间 $r+1$ 删除这条边. 注意把左右端点的关系. #include <bits/stdc++.h> ; int X[N], Y[N], top; struct DSU { int fa[N], sz[N]; int find(int x) { while (x != fa[x]) x = fa[x]; return x; } void merge(int x, int y) { x = find(x), y = find(…
由于每个元素贡献是线性的,那么等价于求每个元素出现在多少个异或和为$0$的子集内.因为是任意元素可以去异或,那么自然想到线性基.先对整个集合A求一遍线性基,设为$R$,假设$R$中元素个数为$r$,那么任取一个不在$R$内的元素,$R$中肯定存在一种取法能和这个元素异或和为$0$.同理,取定一个不在$R$内的元素,再随便取另外任意个不在$R$内的元素,$R$内仍然存在一种取法使得这个异或和为$0$.那么每个不在$R$内的元素包含在$2^{n - r - 1}$个集合内(其他不在$R$内的元素可以…
链接: https://codeforces.com/gym/102394/problem/K 题意: DreamGrid is the keeper of n rabbits. Initially, the i-th (1≤i≤n) rabbit has a weight of wi. Every morning, DreamGrid gives the rabbits a carrot of weight 1 and the rabbits fight for the only carrot…
链接: https://codeforces.com/gym/102394/problem/J 题意: The great mathematician DreamGrid proposes a conjecture, which states that: Every positive integer can be expressed as the sum of a prime number and a composite number. DreamGrid can't justify his c…
链接: https://codeforces.com/gym/102394/problem/I 题意: DreamGrid has an interesting permutation of 1,2,-,n denoted by a1,a2,-,an. He generates three sequences f, g and h, all of length n, according to the permutation a in the way described below: For ea…
比赛链接:传送门 上半场5题,下半场疯狂挂机,然后又是差一题金,万年银首也太难受了. (每次银首都会想起前队友的灵魂拷问:你们队练习的时候进金区的次数多不多啊?) Problem J. Justifying the Conjecture 00:09 (+) Solved by Dancepted 签到.好像见过很多次了,经典水题.然后英语太差了,理解题意用了不少时间. 代码: #include <bits/stdc++.h> #define endl '\n' using namespace…
Then n - 1n−1 lines follow. ii-th line contains two integers f_{a_i}(1 \le f_{a_i} < i)fai​​(1≤fai​​<i), w_i(0 \le w_i \le 10^{18})wi​(0≤wi​≤1018) —The parent of the ii-th node and the edge weight between the ii-th node and f_{a_i} (ifai​​(istart fr…
Miku is matchless in the world!” As everyone knows, Nakano Miku is interested in Japanese generals, so Fuutaro always plays a kind of card game about generals with her. In this game, the players pick up cards with generals, but some generals have con…
https://open.kattis.com/problems/researchproductivityindex 这道题是考场上没写出来的一道题,今年看看感觉简单到不像话,当时自己对于dp没有什么概念,所以导致考场只能空流泪 首先问期望,肯定就要确定概率.看到这个 就知道肯定一块求是不太好写的,先求上面,上面求发表的期望,那么对于期望我们有e(x) = Σxipi 这里p知道了但是xi不知道,那么我们根据题目描述我们有一个分子一个分母,分子是发表的次数,分母是论文数,首先对于任何j篇论文发表…
题目链接:https://codeforces.com/gym/102361/problem/F 题意 有 \(n\) 个点和 \(m\) 条边,每条边属于 \(0\) 或 \(1\) 个环,问去掉一些边使得图变为森林的方案个数. 题解 找出所有环的长度 \(c_i\),每个环可以去掉 \(1,2,\dots,c_i\) 条边,方案各为 \(C_{c_i}^1,C_{c_i}^2, \dots C_{c_i}^{c_i}\),即 \(2^{c_i} - 1\) . 所有环的去边方案共有 \(\p…
The Best Seat in ACM Contest Time Limit: 1000MS Memory limit: 65536K 题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous…
题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there. Cainiao attended Asia Regional Contest Fuzhou Site on N…
F. Fixing Banners time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output Harbin, whose name was originally a Manchu word meaning "a place for drying fishing nets", grew from a small rural set…
A:DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an. Every time, he can choose a contiguous subsequence of length kk and increase every integer in the contiguous subsequence by 11. He wants the minimum value of the array is at least…
我能说我比较傻么!就只能做一道签到题,没办法,我就先写下A题的题解&源码吧,日后补上剩余题的题解&源码吧!                                     A -- Niro plays Galaxy Note 7                    Time Limit:1s Memory Limit:128MByte DESCRIPTION Niro, a lovely girl, has bought a Galaxy Note 7 and wants to…
http://www.ifrog.cc/acm/problem/1050?contest=1006&no=4 DP[val]表示以val这个值结尾的等差数列有多少个 DP[val] += DP[val / 2]; 数值很大,用map<int, int>DP即可. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <alg…
题目链接:http://www.ifrog.cc/acm/problem/1146?contest=1020&no=2 题解:显然知道这是一道dp而且 dp[i]=min(dp[j]+2^(x[j]-x[i])+a,dp[i])但是这题很显然2的次幂显然很容易比a大于是只要for一遍最多30次就行具体看一下代码,炒鸡简单的. #include <iostream> #include <cstring> #include <algorithm> #include…
题目链接:http://www.ifrog.cc/acm/problem/1143?contest=1020&no=0 题解:就是瞎暴力具体多暴力看一下代码就知道了. #include <iostream> #include <cstring> #include <queue> #include <cstdio> #include <cmath> using namespace std; typedef long long ll; ][]…
http://www.ifrog.cc/acm/problem/1097?contest=1013&no=1 //LIS的高端写法 #include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <algorithm> using namespace std; ]; ]; int n, x; int main() { while (s…
题目来源:2019 ACM ICPC Xi'an University of Posts & Telecommunications School Contest 链接:https://www.jisuanke.com/contest/2382?view=challenges Description 众所周知,由于木星引力的影响,世界各地的推进发动机都需要进行重启.现在你接到紧急任务,要去收集火石碎片,重启西邮发动机. 现在火石碎片已成为了稀缺资源,获得火石碎片需要钱或者需要一定的积分.火石碎片有…