随笔分类 - Codeforces 题解
摘要:E. Dead Ends 这种状态压缩题目见得比较少。考前来一道。 容易观察到,这道题$n$过于小,这让我们联想到——状态压缩。 不妨定义$dp(S)$代表生成树点集为$S$的方案数。那么,容易观察到,这个状态难以转移。 具体来说,当我们枚举$S$的子集时,我们不知道应该怎么做才能避免不重复地计算。
阅读全文
摘要:F. Cutlet 第一次接触这样的动规设计。有收获 首先,我们先简化一下问题: \(k\)(\(k\leq100\))个给定区间,给这$2n$个区间染色($0$或$1$),规定相邻颜色断点必须在给定区间内,问是否有合法的方案使两种颜色格子数均为$n$,以及最少的断点。 考虑可行性: 不妨设计DP:
阅读全文
摘要:Codeforces Round #706 (Div. 2) 题解 题目链接 A. Split it! 大模拟,耐下心看懂题意。 B. Max and Mex 不难观察到:当$mex(S)<max(S)$的时候最多只可能只增加一个“新数”。 这是因为:\(⌈\dfrac{a+b}{2}⌉\geq \
阅读全文
摘要:Codeforces Round #676 (Div. 2) A 考虑贪心:两个1显然填,两个0显然不用,一1一0随便。 #include<iostream> #include<cstdio> using namespace std; int a, b; int main() { int x, T;
阅读全文
摘要:比赛网址:https://codeforces.com/contest/1391 A. Suborrays 网址:https://codeforces.com/contest/1391/problem/A A permutation of length \(n\) is an array consi
阅读全文
摘要:比赛网址:https://codeforces.com/contest/1395 A. Boboniu Likes to Color Balls 网址:https://codeforces.com/contest/1395/problem/A Boboniu gives you r red ball
阅读全文
摘要:比赛网址:https://codeforces.com/contest/1393 A. Rainbow Dash, Fluttershy and Chess Coloring 网址:https://codeforces.com/contest/1393/problem/A One evening R
阅读全文
摘要:比赛:https://codeforces.com/contest/1382 A. Common Subsequence 网址:https://codeforces.com/contest/1382/problem/A You are given two arrays of integers \(a
阅读全文
摘要:A. Magical Sticks 网址:https://codeforces.com/contest/1371/problem/A A penguin Rocher has \(n\) sticks. He has exactly one stick with length \(i\) for a
阅读全文
摘要:A. FashionabLEE 网址:https://codeforces.com/problemset/problem/1369/A Lee is going to fashionably decorate his house for a party, using some regular con
阅读全文
摘要:A. Odd Selection 网址:https://codeforces.com/contest/1363/problem/A Shubham has an array a of size n, and wants to select exactly x elements from it, su
阅读全文
摘要:A. Nastya and Rice 网址:https://codeforces.com/contest/1341/problem/A Nastya just made a huge mistake and dropped a whole package of rice on the floor.
阅读全文
摘要:渭城朝雨浥轻尘,客舍青青柳色新。 劝君更尽一杯酒,西出阳关无故人。——王维 A. Ichihime and Triangle 网址:https://codeforces.com/contest/1337/problem/A Ichihime is the current priestess of t
阅读全文
摘要:空山新雨后,天气晚来秋。 明月松间照,清泉石上流。 竹喧归浣女,莲动下渔舟。 随意春芳歇,王孙自可留。——王维 A. Little Artem 网址:https://codeforces.com/contest/1333/problem/A Young boy Artem tries to pain
阅读全文
posted @ 2020-04-15 11:23
大秦帝国
摘要:人闲桂花落,夜静春山空。 月出惊山鸟,时鸣春涧中。——王维 A. EhAb AnD gCd You are given a positive integer x. Find any such 2 positive integers a and b such that GCD(a,b)+LCM(a,b
阅读全文

浙公网安备 33010602011771号