Codeforces Round #511 (Div. 2)

  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n;
  6.  
  7. int main()
  8. {
  9. cin>>n;
  10. )%) cout<<<<endl;
  11. <<endl;
  12. }

A. Little C Loves 3 I

  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n;
  6.  
  7. int main() {
  8. cin>>n;
  9. ;
  10. int a,b;
  11. ; i<=n; ++i) {
  12. cin>>a>>b;
  13. ans=max(ans,a+b);
  14. }
  15. cout<<ans<<endl;
  16. }

B - Cover Points

  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. ;
  6. ;
  7.  
  8. int n,g;
  9. int a[maxn];
  10. int cnt[N];
  11. int vis[N];
  12.  
  13. int main() {
  14. std::ios::sync_with_stdio(false);
  15. cin.tie(NULL);
  16. while(cin>>n) {
  17. ; i<=n; ++i) {
  18. cin>>a[i];
  19. ) g=a[i];
  20. g=__gcd(g,a[i]);
  21. }
  22. memset(cnt,,sizeof(cnt));
  23. memset(vis,,sizeof(vis));
  24. ; i<=n; ++i) {
  25. ++cnt[a[i]/g];
  26. }
  27. ;
  28. ; i<=N; ++i) {
  29. ) {
  30. ;
  31. for(int j=i; j<N; j+=i) {
  32. res+=cnt[j];
  33. vis[j]=;
  34. }
  35. ans=max(ans,res);
  36. }
  37. }
  38. if(ans)
  39. cout<<n-ans<<endl;
  40. else cout<<"-1"<<endl;
  41. }
  42. }

C - Enlarge GCD

  1. #include<bits/stdc++.h>
  2. #include<iostream>
  3. #include<cstdio>
  4. #include<cstdlib>
  5. #include<cstring>
  6. #include<cmath>
  7. #include<algorithm>
  8. #include<queue>
  9. #include<vector>
  10. #include<map>
  11. #define lson i<<1
  12. #define rson i<<1|1
  13. #define LS l,mid,lson
  14. #define RS mid+1,r,rson
  15. #define mem(a,x) memset(a,x,sizeof(a))
  16. #define gcd(a,b) __gcd(a,b)
  17. #define ll long long
  18. #define ull unsigned long long
  19. #define lowbit(x) (x&-x)
  20. #define pb(x) push_back(x)
  21. #define enld endl
  22. #define mian main
  23. #define itn int
  24. #define prinft printf
  25. #pragma GCC optimize(2)
  26. //#pragma comment(linker, "/STACK:102400000,102400000")
  27.  
  28. const double PI = acos (-1.0);
  29. const int INF = 0x3f3f3f3f;
  30. ;
  31. ;
  32. ;
  33. ;
  34.  
  35. using namespace std;
  36.  
  37. ll n,m;
  38.  
  39. int main() {
  40. //std::ios::sync_with_stdio(false);
  41. //cin.tie(NULL);
  42.  
  43. while(cin>>n>>m) {
  44. if(n>m) swap(n,m);
  45. ==) {
  46. n=n/;
  47. ) cout<<<<endl;
  48. ) cout<<n*<<endl;
  49. &&m!=) cout<<n**m<<endl;
  50. ) cout<<*n<<endl;
  51. } ) {
  52. n=n/-;
  53. ) cout<<<<endl;
  54. ) cout<<n*+<<endl;
  55. ==) cout<<n**m+*m<<endl;
  56. ) cout<<n**m+*m-<<endl;
  57. *n+<<endl;
  58. } ) {
  59. //if(m%6==0) cout<<m<<endl;
  60. <=) cout<<m/*<<endl;
  61. *+(m%)%*<<endl;
  62. }
  63. }
  64. }

D - Little C Loves 3 II

Codeforces Round #511 (Div. 2)的更多相关文章

  1. Codeforces Round #511 (Div. 2):C. Enlarge GCD(数学)

    C. Enlarge GCD 题目链接:https://codeforces.com/contest/1047/problem/C 题意: 给出n个数,然后你可以移除一些数.现在要求你移除最少的数,让 ...

  2. Codeforces Round #511 (Div. 2)-C - Enlarge GCD (素数筛)

    传送门:http://codeforces.com/contest/1047/problem/C 题意: 给定n个数,问最少要去掉几个数,使得剩下的数gcd 大于原来n个数的gcd值. 思路: 自己一 ...

  3. Codeforces Round #511 (Div. 1) C. Region Separation(dp + 数论)

    题意 一棵 \(n\) 个点的树,每个点有权值 \(a_i\) .你想砍树. 你可以砍任意次,每次你选择一些边断开,需要满足砍完后每个连通块的权值和是相等的.求有多少种砍树方案. \(n \le 10 ...

  4. Codeforces Round #511 Div.1 A Div.2 C

    嗯切一题走人很开心. gzy-50分比我还惨. 题意:有n个数,去掉尽量少的数使得剩下数的gcd变大. 首先把这n个数都除以gcd,就变成了去掉尽量少的数使得gcd不等于1. 可以枚举一个质数,然后统 ...

  5. 2018.9.21 Codeforces Round #511(Div.2)

    只写了AB,甚至还WA了一次A题,暴露了蒟蒻的本质=.= 感觉考的时候有好多正确或和正解有关的思路,但是就想不出具体的解法或者想的不够深(长)(怕不是过于鶸) 话说CF的E题怎么都这么清奇=.= A. ...

  6. C. Enlarge GCD Codeforces Round #511 (Div. 2)【数学】

    题目: Mr. F has nn positive integers, a1,a2,…,an. He thinks the greatest common divisor of these integ ...

  7. B. Cover Points Codeforces Round #511 (Div. 2)【数学】

    题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need t ...

  8. A. Little C Loves 3 I Codeforces Round #511 (Div. 2) 【数学】

    题目: Little C loves number «3» very much. He loves all things about it. Now he has a positive integer ...

  9. Codeforces Round #511 (Div. 2) C. Enlarge GCD

    题目链接 题目就是找每个数的最小素因子,然后递归除,本来没啥问题,结果今天又学习了个新坑点. 我交了题后,疯狂CE,我以为爆内存,结果是,我对全局数组赋值, 如果直接赋值,会直接在exe内产生内存,否 ...

随机推荐

  1. 机器学习算法整理(七)支持向量机以及SMO算法实现

    以下均为自己看视频做的笔记,自用,侵删! 还参考了:http://www.ai-start.com/ml2014/ 在监督学习中,许多学习算法的性能都非常类似,因此,重要的不是你该选择使用学习算法A还 ...

  2. li分两列显示

    只要控制了li的宽度,利用浮动就能实现<style type="text/css"> .my ul { width: 210px; } .my li { width: ...

  3. 【转】XMPP_3920_最靠谱的中文翻译文档

    CHENYILONG Blog XMPP_3920_最靠谱的中文翻译文档 Fullscreen © chenyilong. Powered by Postach.io Blog

  4. 经典设计模式-iOS的实现

    最近看了<HeadFirst 设计模式>这本书,给组内伙伴准备一次分享,把这次分享记录下来,有需要的可以看看. 这本书主要介绍了四人帮23种经典设计模式中的的14种,也是常用的几种.看完这 ...

  5. 浅谈区间DP的解题时常见思路

    一.区间DP解题时常见思路 如果题目中答案满足: 大的区间的答案可以由小的区间答案组合或加减得到 大的范围可以由小的范围代表 数据范围较小 我们这时可以考虑采用区间DP来解决. 那么常见的解法有两种: ...

  6. ocky勒索软件恶意样本分析1

    locky勒索软件恶意样本分析1 1 locky勒索软件构成概述 前些时期爆发的Locky勒索软件病毒这边也拿到了一个样本,简要做如下分析.样本主要包含三个程序: A xx.js文件:Jscript脚 ...

  7. 使用phpstorm+wamp实现php代码实时调试审计

    转载自:https://www.bugbank.cn/q/article/5853afaffc0bf4f010ee6ac3.html php调试有N多好用的工具,最近研究到phpstorm配合wamp ...

  8. 004_加速国内docker源下载速度

    docker下载慢的不行.国内加速器地址 http://355dbe53.m.daocloud.iohttps://docker.mirrors.ustc.edu.cn https://hub-mir ...

  9. python基础--模块使用

      一:模块介绍 模块分为三种: 自定义模块 内置标准模块(又称标准库) 开源模块 自定义模块使用 # -*- coding:utf-8 -*- __author__ = 'shisanjun' &q ...

  10. Vue2.0 开发移动端音乐webApp 笔记

    项目预览地址:http://ustbhuangyi.com/music/#/recommend 获取歌曲 url 地址方法升级:https://github.com/ustbhuangyi/vue-m ...