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

凡科做数据查询网站荣耀商城app

凡科做数据查询网站,荣耀商城app,wordpress安装博客,枣庄建设局网站C. Ball in Berland 传送门#xff1a;Problem - C - Codeforces 题意#xff1a; 思路#xff1a;容斥原理 考虑 第 i 对情侣组合 #xff0c;男生为 a #xff0c;女生为 b #xff0c;那么考虑与之匹配的情侣 必须没有 a | b #xff0c;一共有 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代码 #includebits/stdc.h using namespace std; #define int long long void solve() {int n , m , k; cin n m k;vectorint 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代码 #includebits/stdc.h using namespace std; #define int long long void solve() {int n; cin n;vectorint 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时的情况 #includebits/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;vectorint 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.hkea.cn/news/14403765/

相关文章:

  • 做视频必须知道的一些网站游戏制作需要哪些人员
  • 千户微建站平台中国最近军事新闻视频
  • 建设网站销售广州网站设计皆赞乐云践新
  • 广州商砼建站规范外包加工平台
  • 嘉兴手机网站制作博客建站模板
  • 户型图在线设计网站wordpress用lanmp
  • 城乡建设招投标网站微软 开源 wordpress
  • 海口网站建设公司湖南智能网站建设平台
  • 柳市外贸网站建设北京知名网站建设公司排名
  • 贵阳做网站设计域名注册服务机构注销域名的情形
  • 移动互联网开发的几种方式兰州seo安安网站建设
  • 韶山市建设局网站wordpress 获取指定文章
  • 建设银行手机登录网站安徽省建设信息网
  • 谁给个网站呀免费动图制作app
  • 广州专业网站优化公司民和网站建设公司
  • 个人域名备案做企业网站旅游网站规划建设方案
  • 海尔网站建设情况容县网站开发
  • 高端效果图制作公司东莞优化网站关键词优化
  • 论述电子商务网站的建设益阳网站建设网站
  • 用手机建网站WordPress恶意扫描
  • 深圳市建设行业门户网站展示型商城订单网站建设
  • 上海工程信息网佛山百度seo排名
  • asp网站制作成品作业wordpress评论内网ip
  • 网站建设 聊城wordpress 前端会员中心
  • 江阴做网站公司门户网站平台建设方案
  • wordpress添加点赞aso优化运营
  • 做网站横幅 的网站推荐几个如何建设网站内容
  • 网站页面下沉的特效代码求做网站
  • 泰州网站制作报价好的网站建设网站
  • 中铁集团网站建设有哪些网站做国外生意的