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 ...
随机推荐
- HTML5中input新增类型+表单新增属性+其他标签属性
@ (猴头) Input 新增属性 email 邮箱(只在手机端有效) url 网址(只在iphone手机有效) tel 手机号(只在手机端有效) number 数字(右侧有上下按钮,只能输入 ...
- Upx 压缩go编译的程序 frp
1. frp 程序占用大 .路由器 不够空间 2. UPX 下载地址 https://github.com/upx/upx/releases/ 3. 压缩命令 upx.exe -9 C ...
- vulnhub靶机之DC6实战(wordpress+nmap提权)
0x00环境 dc6靶机下载地址:https://download.vulnhub.com/dc/DC-6.zip dc6以nat模式在vmware上打开 kali2019以nat模式启动,ip地址为 ...
- input清空和重置select下拉框
背景 一般页面搜索条件都会有input输入框和select选择框,同时页面上都会有重置reset按钮,这时就需要清空input和重置select 实现 清空input 清空单个input: $(&qu ...
- 数据库MySQL之show processlist
在实际项目开发中,如果我们对数据库的压力比较大,比如有大批量的查询或者插入等sql,尤其是多线程插入等情况,针对部分执行比较慢的sql,我们可以将其kill掉,常用的一个命令就是show proces ...
- sql-labs 18-20(sqlmap注入)
这三题主要是关于HTTP头部的注入 常见的HTTP注入点产生位置为 [Referer].[X-Forwarded-For].[Cookie].[X-Real-IP].[Accept-Language] ...
- [CF1303G] Sum of Prefix Sums - 点分治,李超线段树
给定一棵 \(n\) 个点的带点权的树,求树上的路径 \(x_1,...,x_k\) ,最大化 \(\sum_{i=1}^k ia_{x_i}\) Solution 树上路径问题可用点分治. 考虑如何 ...
- LeetCodeTwo Sum IV 树的遍历+Hash大法好
题意 给定一颗二叉搜索树,返回是否存在两个节点的值之和为给定值K. 思路 同Two Sum.使用Hash表解决.只是要写个树的遍历而已,选取DFS. 源码 class Solution { publi ...
- unity中ContentSizeFitter刷新不及时的问题
ContentSizeFitter,自适应宽高脚本要在下一帧的时候才会适应宽高.如果想立即生效,可以调用 LayoutRebuilder.ForceRebuildLayoutImmediate(rec ...
- docker镜像ubuntu封装jdk1.8.0【dockerfile】
github地址:https://github.com/laileman/Docker/Dockerfile/ubuntu-jdk1.8.0_172 1-目录结构 2- dockerfile内容 3- ...