[jzoj]3729. 【NOIP2014模拟7.10】表达式的值(exp) (分块转化模型)
来源:互联网 发布:.域名的续费是怎么回事 编辑:程序博客网 时间:2024/05/17 08:08
Link
https://jzoj.net/senior/#contest/show/1937/0
Problem
求
Data constraint
对于 60%的数据,
对于 100%的数据,
Solution
60%
直接模拟即可
100%
考虑转化模型.
故总的时间复杂度为
Code
var ans,t,t1,x,n:qword; i:longint;begin readln(n); for i:=1 to trunc(sqrt(n)) do begin t:=n div i; t1:=n div (i+1); inc(ans,((t+t1+1)*(t-t1) div 2)*i); x:=n div i; if (x<=i) then continue; t:=n div x; t1:=n div (x+1); inc(ans,((t+t1+1)*(t-t1) div 2)*x); end; writeln(n*n-ans);end.
0 0
- [jzoj]3729. 【NOIP2014模拟7.10】表达式的值(exp) (分块转化模型)
- JZOJ 3899. 【NOIP2014模拟】逻辑的连通性
- JZOJ 3731. 【NOIP2014模拟7.10】庐州月
- JZOJ NOIP2014模拟 8.12
- JZOJ NOIP2014模拟 8.13
- JZOJ 3806. 【NOIP2014模拟8.24】小X 的道路修建
- JZOJ 3804. 【NOIP2014模拟8.24】小X 的AK 计划
- JZOJ 3813. 【NOIP2014模拟9.7】我要的幸福
- JZOJ 3806 【NOIP2014模拟8.24】小X的道路修建
- JZOJ 3885. 【长郡NOIP2014模拟10.22】搞笑的代码
- JZOJ-senior-3899. 【NOIP2014模拟】逻辑的连通性
- jzoj NOIP2014提高组模拟8.9总结
- [JZOJ 3794]. 【NOIP2014模拟8.20】高级打字机
- 【JZOJ】 【NOIP2014】【模拟试题】保镖排队
- JZOJ 3808. 【NOIP2014模拟8.25】道路值守
- JZOJ 3807. 【NOIP2014模拟8.25】地砖铺设
- JZOJ 3807. 【NOIP2014模拟8.25】地砖铺设
- JZOJ 3809. 【NOIP2014模拟8.25】设备塔
- #define const and static
- 基于Problem Solving with Algorithms and Data Structures using Python的学习记录(6-1)——Tree
- dubbo的作用及理解
- 建立一个对象数组,内放5个学生的数据(学号,成绩),用指向对象的指针做函数参数,在max函数中找出5个学生中成绩最高者,并输出其学号。
- 你真的了解位运算?用了这个运算符,算法的时间复杂度竟然降了一个数量级!
- [jzoj]3729. 【NOIP2014模拟7.10】表达式的值(exp) (分块转化模型)
- 重载c++的<<操作符
- c++作业4
- INCORRECT STRING VALUE: '\XF0\XA1\XA1\X92' FOR COLUMN 'HERST' AT ROW 1
- eclipse中文字体小、主题背景以及中文乱码
- C++实验3-个人所得税计算器
- c++作业3:本月有几天?
- jsp和servlet的区别
- 网络攻防之——数据库评估