ARC062 C - AtCoDeerくんと選挙速報 / AtCoDeer and Election Report 每次看看比率至少变成多少倍能大于当前的数 然后就把两个人的票都改成那个数 #include <bits/stdc++.h> #define fi first #define se second #define pii pair<int,int> #define mp make_pair #define pb push_back #define space putcha…
Choosing Points 数学 Integers on a Tree 构造 Leftmost Ball 计数dp+组合数学 Painting Graphs with AtCoDeer tarjan+polya Building Cubes with AtCoDeer 枚举 AtCoDeer and Election Report 贪心 Snuke's Coloring 思维题 Snuke's Coloring 2 线段树+单调栈 Make Them Even 贪心 1D Reversi 模…
Time limit : 2sec / Memory limit : 256MB Score : 700 points Problem Statement Squid loves painting vertices in graphs. There is a simple undirected graph consisting of N vertices numbered 1 through N, and M edges. Initially, all the vertices are pain…
Problem Statement AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but…
Problem Statement We have a grid with H rows and W columns. At first, all cells were painted white. Snuke painted N of these cells. The i-th ( 1≤i≤N ) cell he painted is the cell at the ai-th row and bi-th column. Compute the following: For each inte…
Problem CODE-FESTIVAL 2017 qual A 洛谷账户的提交通道 题意:有一个\(n\)行\(m\)列的方格,在边界外有可能有机器人(坐标为\((0,x),(n+1,x),(x,0),(x,m+1)\),机器人方向朝内(也就是左边界外的机器人朝右,上边界外的机器人朝内--),机器人有自己独特的颜色(没有两个机器人颜色相同). 给机器人安排一个出发顺序,机器人将依次出发,对于每个机器人,走过的路上会留下自己的颜色,它将继续前进除非出了另一方的边界或遇到了其他机器人留下的颜色.…
传送门 有个十分显然的结论,只用枚举前后两个面就可以知道所有的面的颜色. 于是可以O(n2)O(n^2)O(n2)枚举前后两个面然后用map乱搞求贡献. 发现这样算出来会多算两倍(打表证明)于是答案除以3. 代码: #include<bits/stdc++.h> #define ll long long #define N 405 using namespace std; inline int read(){ int ans=0; char ch=getchar(); while(!isdig…
题意: 给一个包含N个顶点,M条边,无自环和重边的简单无向图,初始每个点颜色都为0,每条边的长度为1,连接着ai,bi两个节点.经过若干个操作, 每次将与某个点vi距离不超过di的所有点染成某种颜色ci,求最终每个点的颜色. 1 <= N, M, Q <= 1e5, 1 <= ai, bi, vi <= N, ai != bi. 0 <= di <= 10, 1 <= ci <= 1e5. 分析: 考虑对操作逆向,f[k][d]表示以k点为中心,dist=d…