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

wordpress安装上传失败搜索引擎推广seo

wordpress安装上传失败,搜索引擎推广seo,泰国做企业网站,上海优化公司C. Ball in Berland 传送门:Problem - C - Codeforces 题意: 思路:容斥原理 考虑 第 i 对情侣组合 ,男生为 a ,女生为 b ,那么考虑与之匹配的情侣 必须没有 a | b ,一共有 k 对情侣&#x…

C. Ball in Berland

传送门:Problem - C - Codeforces

题意:

 思路:容斥原理

考虑 第 i 对情侣组合  ,男生为 a ,女生为 b ,那么考虑与之匹配的情侣 必须没有 a | b

,一共有 k 对情侣, a | b 可以表示为 k - cnt[a] - cnt[b] + 1 ( cnt[a] 表示为有男生 a 的方案数 )

AC代码:

#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{int n , m , k; cin >> n >> m >> k;vector<int> cnta( n + 1 ) , cntb( m + 1 ) , a( k + 1 ) , b( k + 1 );for( int i = 1 ; i <= k ; i++ ) cin >> a[i] , cnta[a[i]]++;for( int i = 1 ; i <= k ; i++ ) cin >> b[i] , cntb[b[i]]++;int ans = 0;for( int i = 1 ; i <= k ; i++ ){ans += k - cnta[a[i]] - cntb[b[i]] + 1;}cout << ans / 2 << endl;
}
signed main()
{int tt; cin >> tt;while(tt--)solve();return 0;
}

B. Sifid and Strange Subsequences

传送门:Problem - B - Codeforces

题意:

 思路:

我们要保证 | a[i] - a[j] | 的最小值 要 >= MAX ( MAX为 a[i] 中的某一个值 )

AC代码:

#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{int n; cin >> n;vector<int> a(n + 1);for( int i = 1 ; i <= n ; i++ ) cin >> a[i];int cnt = 0; sort( a.begin() + 1 , a.end() );for( int i = 1 ; i <= n ; i++ )if( a[i] <= 0 )cnt++; // 此时的 cnt 表示 a[i] <= 0 的个数int mn = 2e18;for( int i = 1 ; i < cnt ; i++ )mn = min( mn , a[i + 1] - a[i] );for( int i = cnt + 1 ; i <= n ; i++ ){// 考虑 a[i] > 0 的情况mn = min( mn , a[i] - a[i-1] );if( mn >= a[i] )cnt++;else break;}cout << cnt << endl;
}
signed main()
{int tt; cin >> tt;while(tt--)solve();return 0;
}

传送门:Problem - A - Codeforces

A. Bestie

题意:

 思路:

首先有一个结论 gcd( n , n - 1 ) == 1

所以这个题的答案一定 <= 3 

分情况讨论即可 答案为 1 2 3时的情况

#include<bits/stdc++.h>
using namespace std;
#define int long long
int gcd( int a , int b )
{return b ? gcd( b , a % b ) : a;
}
void solve()
{int n; cin >> n;vector<int> a( n + 1 );for( int i = 1 ; i <= n ; i++ ) cin >> a[i];int g = 0;for( int i = 1 ; i <= n ; i++ )g = gcd( g , a[i] );int temp1 = 0 ;for( int i = 1 ; i <= n; i++ )temp1 = gcd( temp1 , a[i] );int temp2 = 0;for( int i = 1 ; i <= n ; i++ ){if( i == n - 1 )continue;temp2 = gcd( temp2 , a[i] );}if( g == 1 ){cout << 0 << endl;}else if( gcd( temp1 , gcd( n , a[n] ) ) == 1 ){cout << 1 << endl;}else if( gcd( temp2 , gcd( n - 1 , a[n - 1] ) ) == 1 ){cout << 2 << endl;}else cout << 3 << endl;
}
signed main()
{int tt; cin >> tt;while(tt--)solve();return 0;
}

http://www.shuangfujiaoyu.com/news/35224.html

相关文章:

  • 济南市住房建设网站怎样设计一个网页
  • 简述网站建设的五类成员seo外包多少钱
  • 建设厅网站给领导留言如何查看自己怎么创建一个网站
  • 百度网站优化软件seo服务运用什么技术
  • 制作网站需要注意的细节免费网站服务器安全软件下载
  • 做平面还有什么素材网站站长工具收录
  • 国内知名b2b网站seo接单平台
  • 客户管理系统功能描述seo检查工具
  • 在线观看免费网站网址百度竞价推广代理
  • 外贸网站怎么做推广最好看免费观看高清视频了
  • 做网站需要了解的东西seo网站诊断报告
  • 建设政府网站目的商丘seo公司
  • 宜昌本地网站网站建设百度推广
  • 做物流网站注意什么百度竞价推广联系方式
  • 做网站建设的企业还有那些semi认证
  • 做银行设计有好的网站参考吗网站设计软件
  • 网站vr用什么做企业获客方式
  • 怎么做跳转网站首页爱站关键词搜索
  • 揭阳住房和城乡建设厅网站软文网站推广
  • wordpress懒加载插件安卓系统优化大师
  • 企业做宣传网站多少钱无锡百姓网推广
  • 渠道网络建设怎么写英文seo是什么意思
  • 淘宝网站建设方案毕业设计优化营商环境心得体会1000字
  • 做网站迅雷下载链接设置b2b和b2c是什么意思
  • 淘宝客网站源码加各类插件网络营销分析报告
  • jsp动态网站开发书籍抖音自动推广引流app
  • 动漫网站设计东莞网络推广营销
  • 图书管理系统网站开发设计过程百度seo培训
  • wordpress 代码生成器短视频seo排名
  • 新手做网站视频教程seo排名技巧