大意: 求构造n个pair, 每个pair满足 对于每k组, 让$b_i$为$[1,k]$, $g_i$循环右移就好了 int n, k, cnt; int main() { scanf("%d%d", &n, &k); if (n>(ll)k*(k-1)) return puts("NO"),0; puts("YES"); int cnt = 0; REP(i,1,n) { int cur = i+1; REP(j,1,k…
Graph constructive problems are back! This time the graph you are asked to build should match the following properties. The graph is connected if and only if there exists a path between every pair of vertices. The diameter (aka "longest shortest path…
链接:https://ac.nowcoder.com/acm/contest/560/D来源:牛客网 题目描述 Give you a rectangular gird which is h cells high and w cells wide. Each grid is black initially. You can turn some grids into white. A grid A(x,y) is connected with grid B if the coordinate of…