题目传送门

 /*
水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:)
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
using namespace std; typedef long long ll;
const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f; int main(void) //Codeforces Round #308 (Div. 2) B. Vanya and Books
{
// freopen ("B.in", "r", stdin); ll n;
while (scanf ("%I64d", &n) == )
{
int len = ; ll tmp = n;
while (tmp)
{
tmp /= ; len++;
} ll ans = ; ll x = ;
for (int i=; i<=len-; ++i)
{
ans += x * i; x *= ;
}
ll y = ;
for (int i=; i<=len-; ++i) y *= ; ans += (n - y + ) * len;
printf ("%I64d\n", ans);
} return ;
}

最新文章

  1. 多个jar包合并成一个jar包的办法
  2. jQuery读取和设定KindEditor的值
  3. Python中的编码
  4. iOS - C 基本语法
  5. frameset框架下,刷新整个页面
  6. 快学Scala习题解答—第一章 基础
  7. interview(转)
  8. Android学习——移植tr069程序到Android平台
  9. 在Windows、Mac和 Linux系统中安装Python与 PyCharm
  10. Checkpoint 和Breakpoint
  11. Nginx+Tomcat整合的安装与配置(win.linux)
  12. 正则表达式matcher.group()用法
  13. axios 设置拦截器 全局设置带默认参数(发送 token 等)
  14. centos7搭建.netcore运行环境
  15. (转)&lt;Unity3D&gt;Unity3D在android下调试
  16. JDK自带工具之问题排查场景示例
  17. DateFormat 线程安全
  18. Web前端页面的浏览器兼容性测试心得(二)搭建原汁原味的IE8测试环境
  19. C# ContentType: &quot;application/json&quot; 请求方式传json参数问题
  20. iptables详解(13):iptables动作总结之二

热门文章

  1. Download Software Top 10
  2. ext.net 2.5 导出excel的使用方法
  3. Idea 13 新建maven项目
  4. MVC在View中页面跳转
  5. RGB中的颜色的设置
  6. 解决javah生成.h头文件找不到找不到android.support.v7.app.AppCompatActivity的问题
  7. 菜鸟Sublime日记
  8. 【iOS系列】-单例模式的实现
  9. UPDATE command denied DELETE
  10. Java中去除字符串中的所有空格