• Codeforces Round #364 (Div. 2) C. They Are Everywhere 尺取法

    时间:2024-04-23 18:20:50

    C. They Are Everywheretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSergei B., the young coach...

  • CodeForces 125E MST Company

    时间:2024-04-22 11:00:35

    E. MST Companytime limit per test 8 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputThe MST (Meaningless State Tea...

  • CODEFORCES #272 DIV2[为填完]

    时间:2024-04-21 07:50:43

    #272是自己打的第一场cf,感觉这一套质量挺棒的,不像后两场略水//先附上A,B,C的题解,因为离noip只剩下一点时间了,所以之后不一定还刷cf,暂且就先放上前三题好了A题目大意忘了。懒得看,反正很水。B组合数学:题目大意:给你两个字符串;s1,s2其中s2字符串可能含有未知的字符,对于未知的字...

  • CodeForces - 1249E 楼梯和电梯

    时间:2024-04-20 15:33:52

    题意:第一行输入n和c,表示有n层楼,电梯来到需要时间c输入两行数,每行n-1个,表示从一楼到二楼,二楼到三楼.....n-1楼到n楼,a[ ] 走楼梯和 b[ ] 乘电梯花费的时间思路:动态规划,考虑几种状态,假设当前在i-1层,想要去i层,有两种方法,乘电梯,走楼梯。i-1层要考虑由什么状态到i...

  • Codeforces1102F Elongated Matrix 【状压DP】

    时间:2024-04-20 15:11:56

    题目分析:这题瞎搞一个哈密尔顿路,对于起点不同的分开跑就可以过了。$O(n^3*2^n)$ #include<bits/stdc++.h> using namespace std; const int maxn = ; const int maxm = ; int n,m; int a[...

  • Codeforces Round 924 (Div. 2) ---- F. Digital Patterns ---- 题解

    时间:2024-04-19 07:05:16

    F. Digital Patterns: 题目描述:   思路解析: 要求在一个方块中,任意相邻的方块中他的透明度系数不能相同,这样的方块称为趣味性方块,问这样的方块有多少种。 那么我们可以相当,假设 a1 == a2, 那么每一列的第一行元素都等于第二行元素。  假设b1==b2,那么每一行的第...

  • codeforces 192a

    时间:2024-04-17 20:40:14

    link: http://codeforces.com/contest/330/problem/Abrute force. /* ID: zypz4571 LANG: C++ TASK: 191a.cpp */ #include <cstdio> #include <cstdli...

  • Codeforces Round 931 (Div. 2)

    时间:2024-04-17 16:59:53

    Codeforces Round 931 (Div. 2) Codeforces Round 931 (Div. 2) A. Too Min Too Max 题意: 从n个元素中选取四个元素进行按任意顺序排列,进行以下计算,求出可能的最大值 ...

  • Codeforces Round #250 (Div. 1) D. The Child and Sequence 线段树 区间取摸

    时间:2024-04-16 22:12:22

    D. The Child and SequenceTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/contest/438/problem/DDescriptionAt the children's day, the ch...

  • Codeforces Round #200 (Div. 1) C. Read Time 二分

    时间:2024-04-16 11:42:53

    C. Read TimeTime Limit: 1 SecMemory Limit: 256 MB题目连接http://codeforces.com/contest/343/problem/CDescriptionMad scientist Mike does not use slow hard d...

  • Codeforces Round #360 (Div. 2) C D E

    时间:2024-04-16 10:51:14

    每次AB秒出 到了C难度陡然上升...翻译都弄不懂...C 给出一张图 找出两个点的覆盖集(覆盖集是指这图中每条边都有至少一个点在这个点集里面) 并且两个点集没有交集 英文很难看懂...就是二分图的判定 看看这张图是不是二分图 输出两边的点 不是二分图输出-1坑点是这是special judge 但...

  • Codeforces 844F Anti-Palindromize 最小费用流

    时间:2024-04-16 08:32:08

    Anti-Palindromize想到网络流就差不多了, 拆拆点, 建建边。#include<bits/stdc++.h>#define LL long long#define fi first#define se second#define mk make_pair#define PL...

  • Codeforces 293B

    时间:2024-04-14 20:48:38

    Codeforces 293B原题题目描述:给出一个\(n \times m\)的网格, 给定一个整数\(k\),网格上的每个数都不超过\(k\),其中有的格子是\(0\),要求把这些格子变成\(1~k\)的其中一个数, 使得任一条从左上角到右下角的路径中的数字都不一样, 求方案数。solution...

  • codeforces csp复赛训练利器---初识

    时间:2024-04-12 16:51:30

    codeforces csp复赛训练利器---初识1.解决codeforces访问慢的问题网站https://www.codeforces.com打开极慢,换句话说,根本就打不开。摘自https://www.cnblogs.com/flashhu/p/9786085.html摘自https://bl...

  • 【Codeforces Round #446 (Div. 2) C】Pride

    时间:2024-04-11 14:37:20

    【链接】 我是链接,点我呀:) 【题意】在这里输入题意【题解】想一下,感觉最后的结果肯定是从某一段开始,这一段的gcd为1,然后向左和向右扩散的。则枚举那一段在哪个地方。我们设这一段中所有的数字都做了一次gcd.假设在i..j这一段。则求gcd的顺序是(i,i+1),(i+1,i+2)...(j...

  • Codeforces 892 C.Pride

    时间:2024-04-11 14:02:39

    C. Pridetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an array a with length n, you c...

  • Codeforces Round #308 (Div. 2)

    时间:2024-04-09 13:01:52

    A. Vanya and TableVanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom t...

  • Educational Codeforces Round 44 (Rated for Div. 2)

    时间:2024-04-08 19:41:40

    题目链接:https://codeforces.com/contest/985’A.Chess Placing题意:给了一维的一个棋盘,共有n(n必为偶数)个格子。棋盘上是黑白相间的。现在棋盘上有n/2个棋子,让你全部移动到黑色格子或者白色格子,要求步数最少,并输出步数。题解:由于黑色或者白色都是固...

  • 【codeforces 768F】Barrels and boxes

    时间:2024-04-08 18:50:52

    【题目链接】:http://codeforces.com/problemset/problem/768/F【题意】 让你把f个food和w个wine装在若干个栈里面; 每个栈只能装food或者是wine; 且装wine和food的栈交替出现; 然后是随机等可能地分配方案; 问你wine的栈里面,wi...

  • 【codeforces 768F】 Barrels and boxes

    时间:2024-04-08 18:32:36

    http://codeforces.com/problemset/problem/768/F (题目链接)题意A,B两种物品可以装到栈中,每个栈只能存放一种物品,容量没有限制。现在讲所有栈排成一列,AB相间,问存B的栈长大于H的概率。Solution震惊!F竟是个大水题。。。枚举长度隔板法搞一搞就好...