Codeforces Round #835 (Div. 4) A-G】的更多相关文章

目录 Codeforces 1009 A.Game Shopping B.Minimum Ternary String C.Annoying Present D.Relatively Prime Graph E.Intercity Travelling(递推) \(Description\) \(Solution\) F.Dominant Indices(启发式合并) G.Allowed Letters(Hall定理 位运算) \(Description\) \(Solution\) Codef…
目录 Codeforces 1000 A.Codehorses T-shirts B.Light It Up C.Covered Points Count(差分) D.Yet Another Problem On a Subsequence(DP) E.We Need More Bosses(圆方树) \(Description\) \(Solution\) F.One Occurrence(线段树) \(Description\) \(Solution\) G.Two-Paths(树形DP)…
目录 Codeforces 990 A.Commentary Boxes B.Micro-World C.Bracket Sequences Concatenation Problem D.Graph And Its Complement(思路 构造) E.Post Lamps(贪心) F.Flow Control(思路) G.GCD Counting(思路) Codeforces 990 比赛链接 真特么菜啊 后一个多小时无所事事.. 要多做CF的题啊,也许没有那么难但是就是容易想不到,代码也…
Codeforces Round #582 (Div. 3)-G. Path Queries-并查集 [Problem Description] 给你一棵树,求有多少条简单路径\((u,v)\),满足\(u\)到\(v\)这条路径上的最大值不超过\(k\).\(q\)次查询. [Solution] 并查集 将所有边按权值从小到大排序,查询值\(k_i\)也从小到大排序.对于每次查询的值\(k_i\),将边权小于等于\(k_i\)的边通过并查集合并在一起.对于合并后的联通块,每个联通块对答案的贡献…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…
题目传送门 /* 贪心 + 模拟:首先,如果蜡烛的燃烧时间小于最少需要点燃的蜡烛数一定是-1(蜡烛是1秒点一支), num[g[i]]记录每个鬼访问时已点燃的蜡烛数,若不够,tmp为还需要的蜡烛数, 然后接下来的t秒需要的蜡烛都燃烧着,超过t秒,每减少一秒灭一支蜡烛,好!!! 详细解释:http://blog.csdn.net/kalilili/article/details/43412385 */ #include <cstdio> #include <algorithm> #i…
Codeforces Round #383 (Div. 2) A. Arpa's hard exam and Mehrdad's naive cheat 题意 求1378^n mod 10 题解 直接快速幂 代码 #include<bits/stdc++.h> using namespace std; long long quickpow(long long m,long long n,long long k) { long long b = 1; while (n > 0) { if…
题目地址:http://codeforces.com/contest/435/problem/C /* 题意:给一组公式,一组数据,计算得到一系列的坐标点,画出折线图:) 模拟题:蛮恶心的,不过也简单,依据公式得知折线一定是一上一下的,只要把两个相邻的坐标之间的折线填充就好 注意:坐标有可能为负数,所以移动值y初始化为1000,最后要倒过来输出 详细解释:http://blog.csdn.net/zhb1997/article/details/27877783 */ #include <cstd…
Bakery 题目链接: http://codeforces.com/contest/707/problem/B Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities. To bake…