当前位置: 首页 > news >正文

手机网站如何做如何提高网站的转化率

手机网站如何做,如何提高网站的转化率,网络搭建是什么工作,模板做网站影响seo题意#xff1a; 有n个人#xff0c;其中有m组#xff0c;两两互斥#xff0c;现在要分成两个班#xff0c;但最终求的确是最多有多少对不互斥的。 题目#xff1a; 链接#xff1a;https://ac.nowcoder.com/acm/contest/16741/F 来源#xff1a;牛客网 The big day…题意 有n个人其中有m组两两互斥现在要分成两个班但最终求的确是最多有多少对不互斥的。 题目 链接https://ac.nowcoder.com/acm/contest/16741/F 来源牛客网 The big day has fifinally arrived: today you are going to form groups of two in which you will do the end-of-the-year project. When you arrive at school, you learn that the teacher of the other class is sick, and that your teacher, Mr. B.A.P. Cee, will also have to make groups for the other class. Mr. B.A.P. Cee is a smart guy and realizes that he can use these unfortunate circumstances to his advantage. Ending up with groups of one should be avoided at all cost, so mixing the students of the two classes may avoid this situation. However, while it is easy to pair up two students from the same class, it is more diffiffifficult to match up students from difffferen classes. Throughout the years there has been a lot of rivalry between the two groups, and many students dislike students in the other class. Mr. B.A.P. Cee knows which pairs of students will result in a fifight and a failed project. You are given a list of pairs of students who cannot work together. How many disjoint groups of two can Mr. B.A.P. Cee make that will not result in a failed project? 输入描述: The input consists of: • A line with two integers n (1 ≤ n ≤ 105), the number of students, and m (0 ≤ m ≤ 2 · 105), the number of pairs of students who cannot work together. • m lines, each with two distinct integers i and j (1 ≤ i, j ≤ n, i j), giving a pair of students who cannot work together. Students are identifified by the numbers 1 through n. It is guaranteed that it is possible to split the students into two classes in such a way that all students from the same class get along. 输出描述: Output the number of pairs of students Mr. B.A.P. Cee can make without making any pair of students who cannot work together. 示例1 输入 3 2 1 2 3 1 输出 1 示例2 输入 5 6 1 4 2 4 3 4 1 5 2 5 3 5 输出 2 示例3 输入 6 6 1 4 2 5 3 6 1 5 3 5 2 6 输出 3 分析 1.因为这道题求的是两个不互斥的对数最大能有多少对不互斥的。所以我们只需要保证区分后两个班里面不存在不互斥的就可以了。 2.这里我直接用vector数组处理两两互斥的状况建图即相邻互斥隔代在同一个班即可 3. 分完班之后按理来说直接每个班成对即可即su/2sm/2但当两个并不是都互斥时两个班里只要存在一对不互斥时此时这两个就可以成为一对不互斥此时的对数就是n/2判断条件即为su*smm 4. 前面说了题意并不需要可以用唯一方法分出两个班还有一种是用并查集扩展域用并查集及扩展域存储同类关系和异类关系也贴在下面 AC代码 #includestdio.h #includestring.h #includemath.h #includealgorithm #includevector #includeiostream using namespace std; typedef long long ll; const int M2e510; int n,m,a,b; vectorintve[M]; int vis[M]; void dfs(int u,int pre,int color){vis[pre]color;for(int i0;ive[pre].size();i){int kve[pre][i];if(uk||vis[k]!-1) continue;dfs(pre,k,color^1);} } int main(){cinnm;for(int i1;in;i)vis[i]-1;for(int i0;im;i){cinab;ve[a].push_back(b);ve[b].push_back(a);}int su0,sm0;for(int i1;in;i){if(vis[i]-1){dfs(0,i,0);}if(vis[i]0) su;else sm;}if(su*smm) printf(%d\n,su/2sm/2);else printf(%d\n,n/2);return 0; } /**有一种情况需要特判 如果两班均是奇数个人且有一班中某人的敌人数小于另一班人数则说明此人可以与另一班某同学组组*/ #include bits/stdc.h using namespace std; typedef long long ll; vectorint vec,tn[100005];//vec存一班的同学编号tn[i]存储i号同学的敌人 int fa[200005];//扩展域并查集 int find(int x)//此题中find(x)的返回值为1或0 {if(fa[x]!x)return fa[x]find(fa[x]);return x; } int main() {int n,m;int a,b;cinnm;for(int i1;in;i)fa[i]1;for(int i1;im;i){scanf(%d%d,a,b);if(ab)swap(a,b);tn[a].push_back(b);tn[b].push_back(a);fa[b]an;fa[bn]a;}int s,l;sl0;//l与s存储两班人数for(int i1;in;i){if(find(i))l;else s,vec.push_back(i);}if(s1l1){for(int i0;ivec.size();i)if(tn[vec[i]].size()!l){s--,l;break;}}printf(%d,s/2l/2);return 0; }
http://www.yutouwan.com/news/378621/

相关文章:

  • 网站推广哪个好如何做一个网站赚钱
  • 哪些网站被墙wordpress图片属性添加
  • 南开做网站wordpress news theme
  • 青岛网站开发公司电话购买软件平台
  • seo专业培训网络班重庆好的seo平台
  • 网站建设回龙观wap手机建站平台
  • 山西省消防总队建设工程备案网站公司网站开发费用
  • 佛山建站专公司网站域名及空间
  • 西安网站开发公司电话杭州网站开发建设
  • 网站建设与维修网络营销跟网站推广有啥区别
  • 廊坊网站建设优化网站建设前端学什么语言
  • 如何做网站横幅如何重装电脑的wordpress
  • 郑州哪家建设网站带音乐网站模板
  • wordpress图片站主题织梦网站文章发布模板下载
  • 岳阳网站建设 熊掌号网页设计摘要内容
  • 网站 微信 appcnzz统计代码如何添加到网站上去
  • 给网站做seo的价格青岛做网站哪里好
  • 塘沽建设网站注册证查询网站
  • 网站后台管理员做链接太和县建设银行网站
  • 网站将要准备建设的内容娄底做网站
  • 唐山高端网站建设上海注销公司需要什么资料和流程
  • 免费网站推广ymdir导航网站怎么做
  • 国外开源 企业网站学做家常菜的网站有哪些
  • 怎么更改网站备案信息品牌官网方案
  • 长沙哪家网络公司做网站好域名注册服务器
  • 一个好的营销型网站模板平台里的钱提现不了怎么追回
  • 销售型网站怎么做的网页制作与设计类课程
  • 网站运营策划ppt个人备案域名可以做企业网站吗
  • 衡阳做网站工程公司资质怎么申请
  • 网站建设的收入来源wordpress 优化数据库