链接: https://codeforces.com/contest/1215/problem/D 题意: Monocarp and Bicarp live in Berland, where every bus ticket consists of n digits (n is an even number). During the evening walk Monocarp and Bicarp found a ticket where some of the digits have bee…
https://www.cnblogs.com/31415926535x/p/11553164.html 感觉很硬核啊这场,,越往后越做不动,,,emmmm,,,(这场是奔着最后一题 2sat 来的,,,上次学这玩意是在今年的3.4月份把,,,早忘得差不多了,,, A. Yellow Cards A题较简单,,贪心就行了,, #include <bits/stdc++.h> #define aaa cout<<233<<endl; #define endl '\n' u…
链接: https://codeforces.com/contest/1215/problem/C 题意: Monocarp has got two strings s and t having equal length. Both strings consist of lowercase Latin letters "a" and "b". Monocarp wants to make these two strings s and t equal to each…
链接: https://codeforces.com/contest/1215/problem/B 题意: You are given a sequence a1,a2,-,an consisting of n non-zero integers (i.e. ai≠0). You have to calculate two following values: the number of pairs of indices (l,r) (l≤r) such that al⋅al+1-ar−1⋅ar…
链接: https://codeforces.com/contest/1215/problem/A 题意: The final match of the Berland Football Cup has been held recently. The referee has shown n yellow cards throughout the match. At the beginning of the match there were a1 players in the first team…
前言 2019.9.16 昨天下午就看了看D题,没有写对,因为要补作业,快点下机了,这周争取把题补完. 2019.9.17 这篇文章或者其他文章难免有错别字不被察觉,请读者还是要根据意思来读,不要纠结qwq. 2019.9.18 \(n<=2*10^5\) 是 \(O(n)\) 或 \(O(nlogn)\) 的算法,知道这招以后就不会乱想方法了. A Yellow Cards 洛谷CF1215A 开始我还没有想到什么好办法,太丢人了. Sooke大佬给出了一个这样的方法: 对于\(Min\),我…
本题地址: https://codeforces.com/contest/1215/problem/B 本场比赛A题题解:https://www.cnblogs.com/liyexin/p/11535519.html B. The Number of Products time limit per test 2 seconds memory limit per test 256 megabytes input standard input output   standard output You…
---恢复内容开始--- output standard output The final match of the Berland Football Cup has been held recently. The referee has shown n yellow cards throughout the match. At the beginning of the match there were a_1 players in the first team and a_2 players…
题目:https://codeforc.es/contest/1215/problem/E 题意:给你一个序列,你可以交换相邻的两个数,要达到一个要求,所有相同的数都相邻,问你交换次数最少是多少 思路:我们可以看到数的个数是1e5,数的范围只有20,很明显这个范围要干些什么,我们可以尝试去想一下状压,我们把数都弄到一起,然后一起状压,因为最后要变成是   xxxxyyyyyzzzkkka  的形态,所以我们可以把问题转化成 "一次放一个数", 这个思想很关键,经常在dp里面用到,这样的…
#define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h>using namespace std;long long n,x;long long num[21],f[1<<20],g[21][21];int main(){ cin>>n; for(;n--;){ cin>>x; ++num[--x];//计数--x出现的次数 for(int i=0;i<20;++i)//将x全部放置在相对位置i前面 g[x…