Codeforces Round #603 (Div. 2) C.Everyone is A Winner!
tag里有二分,非常的神奇,我用暴力做的,等下去看看二分的题解
但是那个数组的大小是我瞎开的,但是居然没有问题233
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
const int N = 1e7;
int c[N];
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
int m = sqrt(n) + ;
memset(c, , sizeof(c));
int cnt = ;
for (int i = ; i <= m; i++)
c[cnt++] = n / i;
while (n >= m) {
m = n / (n / m) + ;
c[cnt++] = n / m;
}
printf("%d\n", cnt);
for (int i = cnt - ; i >= ; i--)
printf("%d ", c[i]);
puts("");
}
return ;
}
Codeforces Round #603 (Div. 2) C.Everyone is A Winner!的更多相关文章
- Codeforces Round #603 (Div. 2) C. Everyone is a Winner! (数学)
链接: https://codeforces.com/contest/1263/problem/C 题意: On the well-known testing system MathForces, a ...
- Codeforces Round #603 (Div. 2) C. Everyone is a Winner! 二分
C. Everyone is a Winner! On the well-known testing system MathForces, a draw of n rating units is ar ...
- Codeforces Round #603 (Div. 2) A. Sweet Problem(水.......没做出来)+C题
Codeforces Round #603 (Div. 2) A. Sweet Problem A. Sweet Problem time limit per test 1 second memory ...
- Codeforces Round #603 (Div. 2) E. Editor 线段树
E. Editor The development of a text editor is a hard problem. You need to implement an extra module ...
- Codeforces Round #603 (Div. 2) E. Editor(线段树)
链接: https://codeforces.com/contest/1263/problem/E 题意: The development of a text editor is a hard pro ...
- Codeforces Round #603 (Div. 2) D. Secret Passwords 并查集
D. Secret Passwords One unknown hacker wants to get the admin's password of AtForces testing system, ...
- Codeforces Round #603 (Div. 2) D. Secret Passwords(并查集)
链接: https://codeforces.com/contest/1263/problem/D 题意: One unknown hacker wants to get the admin's pa ...
- Codeforces Round #603 (Div. 2) B. PIN Codes
链接: https://codeforces.com/contest/1263/problem/B 题意: A PIN code is a string that consists of exactl ...
- Codeforces Round #603 (Div. 2) A. Sweet Problem(数学)
链接: https://codeforces.com/contest/1263/problem/A 题意: You have three piles of candies: red, green an ...
随机推荐
- instanceof读解
function instance(l,r){ let 0 = r.prototype; let v = l.__proto__; while(true){ if(v === null){ retur ...
- Docker Compose 启动mysql,redis,rabbitmq
这里使用的centos7,首先切换到root. sudo -s 首先去设置下载镜像,否则下载这三个东西要很久,而且可能失败. vim /etc/docker/daemon.json 内容如下: { & ...
- Vue中echarts的使用
1.安装 npm install echarts --save 2. 导入并挂载 <template> <!-- 1. 为ECharts准备一个具备大小(宽高)的Dom --&g ...
- Android记事本在菜单栏添加搜索按钮方法
效果图 这个app结构和我之前将记事本开发的博客基本一致,我这里直接讲一下怎样添加 使用的开发软件为android studio 首先在res目录下新建文件夹menu,添加目录布局文件main_men ...
- java遍历统计一个文件夹中所有文件单词出现次数
思路就是通过递归进行文件遍历,把所有文件夹中的非目录文件都遍历一遍,并判断其中读取到的字符串是不是单词,并对单词进行记录和计数,并在最后进行排序输出,下面是代码: package word; impo ...
- tensor维度变换
维度变换是tensorflow中的重要模块之一,前面mnist实战模块我们使用了图片数据的压平操作,它就是维度变换的应用之一. 在详解维度变换的方法之前,这里先介绍一下View(视图)的概念.所谓Vi ...
- [[FJOI2016]神秘数][主席树]
明白之后 5min 就写好了-自闭- 这题的题意是问你 \([L,R]\) 区间的数字不能构成的数字的最小值- 首先考虑 如果 \([1,x]\) 可以被表示 那么加入一个 \(a_i\) 显然 \( ...
- scp 后台执行(防止大文件关闭会话丢失)
Linux scp 设置nohup后台运行 Linux scp 设置nohup后台运行 1.正常执行scp命令 2.输入ctrl + z 暂停任务 3.bg将其放入后台 1.正常执行scp命令 从or ...
- gulp常用插件之gulp-cache使用
更多gulp常用插件使用请访问:gulp常用插件汇总 gulp-cache这是一款基于临时文件的gulp缓存代理任务. 更多使用文档请点击访问gulp-cache工具官网. 安装 一键安装不多解释 n ...
- ros下怎么查看usb设备在哪个端口
检查usb设备是否有权限以及在哪个端口,或者lsusb ls -l /dev |grep ttyUSB 查到设备端口,在启动文件下配置相应的端口号 <param name="seria ...