Codeforces Round #588 (Div. 2)-E. Kamil and Making a Stream-求树上同一直径上两两节点之间gcd的和 [Problem Description] 给你一棵树,树上每个节点都有一个权值.定义\(1\sim v\)的最短路径所经过的所有节点\(u\)称为\(v\)节点的祖先.定义函数\(f(u,v)=gcd(u,t1,t2,\dots,v)\),其中\(u,t1,t2,\dots\)都是\(v\)的祖先.求\(\sum f(u,v)\). […
这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:https://codeforces.com/contest/1080. A.Petya and Origami 题意:Petya要发出n张邀请函,每张请函需要2张红纸,5张绿纸,8张蓝纸.现在商店里有一些不同颜色的笔记本,每本中有k张颜色相同的纸,求最少要买几本笔记本. 这题就是一道模拟题,算出每种…
最近比赛有点多,可是好像每场比赛都是被虐,单纯磨砺心态的作用.最近讲的内容也有点多,即便是点到为止很浅显的版块,刷了专题之后的状态还是~"咦,能做,可是并没有把握能A啊".每场网络赛,我似乎都没用上新学的东西,能用上新学东西的题我A不了...5555555555555555 这场CF,讲真,打的心态爆炸,首先A题无限WA,赛后看下WA的那组数据是输入有一个999999999的样例,死骗子,说好的数据是1e9呢,哪能有数据是1e10-1,于是用long long,一下子Accept接收不…
思路:先找出现次数>=2数.然后在取跑所有数,需要考虑一般情况(当一个人比另一个人的ai小且他们的与运算等于小的那个人的ai那么可以知道大的那个人必定强于ai小的那个人). 则可以用位运算实现判断强弱. #include<bits/stdc++.h> using namespace std; #define int long long #define N 100500 struct str{ int a,b; }st[N]; map<int,int> mp; vector&l…
B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B Description SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The…
A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents in the school. Each day he will fight with all opponents who are present this day. His opponents have some fighting plan that guarantees they will win…
链接: https://codeforces.com/contest/1230/problem/E 题意: Kamil likes streaming the competitive programming videos. His MeTube channel has recently reached 100 million subscribers. In order to celebrate this, he posted a video with an interesting problem…
CF链接  http://codeforces.com/contest/1011/problem/A Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be de…
文章目录 原题链接: A.Cirno's Perfect Bitmasks Classroom 思路 代码 B.Patchouli's Magical Talisman 思路 代码 C.Manipulating History 思路 代码 D.The Enchanted Forest 思路 代码 E.Railway System 题目大意 思路 代码 原题链接: # Name A Cirno's Perfect Bitmasks Classroom standard input/output 1…
http://codeforces.com/contest/426/problem/B B. Sereja and Mirroring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's assume that we are given a matrix b of size x × y, let's determine…