1030. 完美数列(25)
来源:互联网 发布:如何制作mac os启动盘 编辑:程序博客网 时间:2024/06/05 01:14
挺好的一道题目。
// 2017/10/14 NCU // PAT-B 1053// scienceZ#include <cstdio>#include <cstring>#include <iostream>#include <cctype>#include <algorithm>using namespace std;int n, p, mymax;int arr[100010];int main(){ cin >> n >> p; for (int i = 0; i<n; i++) cin >> arr[i]; sort(arr, arr+n); for (int i = 0; i<n; i++){ for(int j = i+mymax; j<n; j++){ if(float(arr[j])/arr[i]<=p) mymax++; else break; } } cout << mymax; return 0;}
阅读全文
0 0
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- 1030. 完美数列(25)
- notepad++
- Vijos P1193 扫雷
- 区分冒泡与选择排序
- ASP.NET GirdView
- javascript事件流讲解(冒泡事件,捕获事件)
- 1030. 完美数列(25)
- PHP设计模式-单例模式
- socket
- linux学习第三篇:单用户模式与救援模式
- Ubuntu修改设备名
- SpringBoot整合Mybatis实现增删改查的功能
- 内存管理
- 学生成绩转换
- 数据结构实验一