Codeforces 1091D New Year and the Permutation Concatenation https://codeforces.com/contest/1091/problem/D 题目: Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence p. For…
Good Bye 2018! 题目链接:https://codeforces.com/contest/1091 A. New Year and the Christmas Ornament 题意: 给出三堆数量分别为y,b,r的东西,现在要你从三堆中各选一堆,满足y'+1=b'且b'+1=r' (y',r',b'分别是指从中选取的个数). 现在问最多能拿出的个数为多少. 题解: 我是直接模拟的= =但是有更简单的方法. 让y+=2,b+=1,那么现在的最优解为min(y,b,r)*3-3.这个还…
咕bye 2018,因为我这场又咕咕咕了 无谓地感慨一句:时间过得真快啊(有毒 A.New Year and the Christmas Ornament 分类讨论后等差数列求和 又在凑字数了 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int a,b,c; int main() { scanf("%d%d%d",&a,&b,&…
目录 Codeforces 1091 A.New Year and the Christmas Ornament B.New Year and the Treasure Geolocation C.New Year and the Sphere Transmission(思路) D.New Year and the Permutation Concatenation(思路 计数) E.New Year and the Acquaintance Estimation(Erdos–Gallai定理…
Good Bye 2018题解 题解 CF1091A [New Year and the Christmas Ornament] 打完cf都忘记写题解了qwq 题意就是:给你一些黄,蓝,红的球,满足蓝的数量恰比黄的多一,红的数量恰比蓝的多一 容易发现黄的数量恰是\(\min{y,b-1,r-2}\) 输出这个值\(*3+3\)即可 # include <bits/stdc++.h> int main() { int y, b, r; scanf("%d%d%d", &…
占个坑先,希望不要掉的太惨了吧,不要掉到上一次之前的rating upt:flag竟然没到,开心. A - New Year and the Christmas Ornament 好像没什么可说的. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<vector&g…