大意: 求构造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…
Yet Another Ball Problem time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output The king of Berland organizes a ball! nn pair are invited to the ball, they are numbered from 11 to nn . Each pair…
Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description Andrew is having a hard time preparing his 239-th contest for Petrozavodsk. This time the solution to the problem is based on Di…
题目链接:https://codeforces.com/contest/1368/problem/B 题意 构造最短的至少含有 $k$ 个 $codeforces$ 子序列的字符串. 题解 如下表: c o d e f o r c e s 子序列个数 个数 1 1 1 1 1 1 1 1 1 1 $1^{10}$ 2 2 2 2 2 2 2 2 2 2 $2^{10}$ 3 3 3 3 3 3 3 3 3 3 $3^{10}$ 依次构造每个字符的个数即可. 证明 c o d e…