codeforce
胖亚亚
这个作者很懒,什么都没留下…
展开
-
Educational Codeforces Round 58 (Rated for Div. 2) D.GCD Counting
D. GCD Countingtime limit per test4.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a tree consisting of n vertices. A number is written on each ...原创 2019-01-12 14:53:26 · 336 阅读 · 0 评论 -
Codeforces Round #532 (Div. 2) 解题报告
Codeforces Round #532 (Div. 2)A. Roman and Browsertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis morning, Roman woke up and opened t...原创 2019-01-14 11:12:00 · 809 阅读 · 0 评论 -
Codeforces Round #530 (Div. 2)
A:给你雪球初始的重量和高度,每秒下降一米,每下降一米重量就会增加对应的高度。 然后给你两个x1,h1和x2,h2表示高度h1会让雪球重量减少x1,高度h2会让雪球重量减少x2(当然还是要增加对应高度), 雪球最小重量为0,求到h=0的时候雪球的重量。解:记录h1和h2,再一个for解决。 B:按照题目问最少需要多少根木棒可以(通过补充)摆成n个正方形。...原创 2019-01-09 14:17:06 · 267 阅读 · 2 评论 -
【CodeForces 】- 543B SPFA
B. Destroying Roadstime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputIn some country there are exactly n cities and m bidirectional roads ...原创 2019-01-25 23:04:09 · 266 阅读 · 0 评论 -
【CodeForces】-400D 连通图+最短路
Dima took up the biology of bacteria, as a result of his experiments, he invented k types of bacteria. Overall, there are n bacteria at his laboratory right now, and the number of bacteria of type i ...原创 2019-01-25 23:14:34 · 352 阅读 · 0 评论 -
【CodeForces】 - 628D Magic Numbers (数位dp) 早就想补的一个题
onsider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere else.For example, the numbers 1727...原创 2019-01-25 23:19:45 · 257 阅读 · 0 评论 -
CodeForces 805B 构造
题意:给你一个字符串长度,然后要求不能出现长度为3的回文子串,且c的次数尽可能少思路:用ab两个字母构造字符串就好了 形如aabbaabbaabb就好代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1.5e7+10;int a[maxn];in...原创 2019-05-26 10:18:17 · 320 阅读 · 0 评论 -
CodeForces - 805E - Ice cream coloring dfs+贪心
题意:有一棵具有 n 个节点的树,每个节点代表一个集合,表示集合内两两元素的颜色不同,同时保证集合中拥有某个元素的所有的节点附带着边提取出来,能够形成一个连通图,即不可能出现有三个节点 v1,v2,v3 , v1 与 v2 有树边, v2 和 v3 有树边,而 v1,v3 集合中有元素 x 而 v2 集合中没有。思路: dfs 遍历一遍整棵树,在遍历的过程染色。由于单一元素所处的集合都相邻...原创 2019-05-26 10:54:24 · 357 阅读 · 0 评论