2 条题解
-
0
经典除法分块加速问题
不会的去看 模板 。一模一样!!!
#include<bits/stdc++.h> #define int long long using namespace std; int n; vector<int>a; signed main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>n; for(int l=1,r;l<=n;l=r+1){ a.emplace_back(n/l); r=n/(n/l); } cout<<a.size()<<"\n"; for(auto i=a.rbegin();i!=a.rend();i++) cout<<*i<<" "; return 0; }
- 1
信息
- ID
- 3249
- 时间
- 1000ms
- 内存
- 1024MiB
- 难度
- 6
- 标签
- 递交数
- 41
- 已通过
- 12
- 上传者