#include<bits/stdc++.h>using namespace std;typedef struct{ double k,b;}node;node k[1000007];bool cmp(node&a,node&b){ if(a.k==b.k)  return a.b<b.b; return a.k<b.k;}long long x[1007],y[1007];int main(){ long long n,ans=0,tot=0; scanf(&qu…
#include<bits/stdc++.h>using namespace std;int a[100007];int cnt[100007];int main(){    int n;    scanf("%d",&n);    for(int i=1;i<=n;i++)     scanf("%d",&a[i]); int ans=1; set<int>s,num;//数字出现的次数,数字 map<int,i…
目录 Codeforces Round #558 (Div. 2) 题解 A Eating Soup B Cat Party C Power Transmission D Mysterious Code E Magical Permutation Codeforces Round #558 (Div. 2) 题解 A Eating Soup 分类讨论一下 \(m\) 个断点最多可以将环分成 \(m\) 段,而剩下 \(n-m\) 个点最多可以成为 \(n-m\) 段,取个 \(\min\) 即可…
Interesting drink 题目链接: http://codeforces.com/contest/706/problem/B Description Vasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink "Beecola", which can be bough…
https://codeforces.com/contest/1111/problem/D 多重排列 + 反向01背包 题意: 给你一个字符串(n<=1e5,n为偶数),有q个询问,每次询问两个位置x和y,问将和x,y相同的所有字符移到前半段或者后半段,并且剩下的所有字符都要在同一半段的方案数,字符是大写小写字母 题解: 首先不考虑x和y位置,假设前半段的排列数为\((n/2)!/(cnt[x_1]!*...*cnt[x_n]!)\),后半段的排列为\((n/2)!/(cnt[y_1]!*...…
http://codeforces.com/problemset/problem/1163/B2 题意:有n天,每天有一个颜色,截取前x天,随便抽掉一天,使剩下的各个颜色出现的次数相等. 解题,也可以解决B1: 有三种情况: 1.一种颜色出项一次,其他相等,抽掉出现1次颜色的那一天,例如13天分别是 6 222 333 444 555 2.只有两种颜色次数,次数相差1,并且最大出现次数的颜色只有1次,例如13天分别是 777 333 222 8888 3.所有颜色都只出现过1次,例如 1 2 3…
传说中做cf不补题等于没做 于是第一次补...这次的cf没有做出来DE D题的描述神奇 到现在也没有看懂 于是只补了E 每次div2都是hack前2~3题 终于打出一次hack后的三题了...希望以后能越来越好 早日..至少变成蓝色名字吧:) E题意 有一个蟑螂 人要打死它 给出蟑螂的坐标 速度 人的瞄准时间 再给出一些阴影(圆形且给出坐标与半径) 若蟑螂移动到阴影内会立即停下 人不能打到阴影中的蟑螂 问它不被打死的机率 蟑螂的移动方向是随机的 需要注意的是蟑螂只会朝一个方向走直线 所以我们对于…
这场比赛没有打,后来和同学们一起开了场镜像打…… B是SB题结果WA了5发…… C是SB题结果差5min调出……虽然中间有个老师讲题吃掉了1h D是比较神仙的题(2200),但是做出来了?算是比较超常发挥了.(平常能做出的题中最难的就是2200了) E是2800,F是2900,zblzbl…… 这次发挥还是不错的,写一篇题解吧. A 首先发现在一个圆上删掉 $m$ 个点,段数的上界为 $m$.($0$ 除外,所以要特判 $0$) 然后剩下了 $n-m$ 个点.答案就是 $\min(m,n-m)$…
题目链接: http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test4 secondsmemory limit per test256 megabytes 问题描述 Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that pla…
B. Berland National LibraryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/B Description Berland National Library has recently been built in the capital of Berland. In addition, in the library you can take any o…