fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <cstring>
  6. #include <deque>
  7. #include <time.h>
  8. #include <stack>
  9. #include <stdio.h>
  10. #include <map>
  11. #include <set>
  12. #include <string>
  13. #include <fstream>
  14. #include <queue>
  15. #define mp make_pair
  16. #define pb push_back
  17. #define PI 3.14159265358979323846
  18. #define MOD 1000000007
  19. #define INF ((ll)1e+15)
  20. #define x1 fldgjdflgjhrthrl
  21. #define x2 fldgjdflgrtyrtyjl
  22. #define y1 fldggfhfghjdflgjl
  23. #define y2 ffgfldgjdflgjl
  24. typedef long long ll;
  25. using namespace std;
  26. ll i,n,x,m,k,ans;
  27. int main()
  28. {
  29. cin >> n;
  30. x = n;
  31. while (x)
  32. {
  33. x /= 10;
  34. m++;
  35. }
  36. ans = n*m + m - 1;
  37. k = 1;
  38. for (i = 0; i < m-1; i++)
  39. {
  40. k *= 10;
  41. ans -=k;
  42. }
  43. cout << ans << endl;
  44. return 0;
  45. }
  46.  
Success #stdin #stdout 0s 16064KB
stdin
13
stdout
17