CF 253B B. Physics Practical
来源:互联网 发布:关于淘宝店铺转让 编辑:程序博客网 时间:2024/05/21 16:53
简单胡乱搞。。。。。。
给出一系列数字,让求除去最少个数实现最小的数*2>=最大的数!!
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;const int maxn=100005;int a[maxn],n;int main(){ //freopen("//media/学习/ACM/input.txt","r",stdin); freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); scanf("%d",&n); int i,j,ans=0; // memset(a,0,sizeof(a)); for(i=1;i<=n;i++) { scanf("%d",&a[i]); } sort(a+1,a+n+1); int l=1; for(i=1;i<=n;i++) { if(l<=n&&a[l]*2>=a[i]) { ans=max(ans,i-l+1); }else { while(l<=n&&a[l]*2<a[i]) { l++; } } } printf("%d\n",n-ans); return 0;}
- CF 253B B. Physics Practical
- codeforces 253B - Physics Practical
- codeforces 253B Physics Practical
- CodeForces 253B Physics Practical
- B. Physics Practical
- codeforces#154_div2_B (253B) Physics Practical
- Codeforces Round #154 (Div. 2) B题(Physics Practical)
- cf-B
- cf B
- CF 443B(253B)Kolya and Tandem Repeat
- CF 253B. Kolya and Tandem Repeat
- CF 1B Spreadsheet
- CF 3B Lorry
- CF 176B
- CF 91B
- cf 131 DIV2 B
- CF 113B || CF196D
- CF 126B
- JQuery -- this 和 $(this) 的区别
- SecurityException: Neither nor current process has android.permission.INSTALL_PACKAGES
- Spherical covariance Gaussians
- 迷失自我的小羔羊~~~
- 23种设计模式学习—abstract factory模式
- CF 253B B. Physics Practical
- 编程之美——数组循环移位
- aiml解析之 Linux C++ libaiml 编译+执行测试程序+支持中文
- Nios/uCOS II笔记---uCOS移植
- C++的异常处理(二)
- 设置python的编码
- 移动创业者深陷“红海”,艾瑞报告能否“拨云见日”?
- PYTHON文件第一行编码方式注释在Mac系统和Windows系统中的区别
- 买房流程