report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Faulty addition - FlandreOJ: Flandre Online Judge

Faulty addition

Time limit: 1000 ms
Memory limit: 256 MB
Define a "faulty addition" as the process of adding the digits without adhering to the standard rules of carrying. For example: Given an integer $n$, count the number of non-negative integer pairs $a, b$ such that the faulty addition of $a$ and $b$ results in $n$. ### Input - One line containing an integer $n$. ### Output - Print the number of pairs satisfying the condition. Note that pairs $(a, b)$ and $(b, a)$ are considered distinct. ### Constraints - $1 \le n \le 10^{18}$. ### Example Input: ``` 111 ``` Output: ``` 40 ```
Introduction to Dynamic Programming (Part two)
Sake game
Coins
Coins 2
Game on array
Longest increasing subsequence 2
Convolution
Regular bracket sequence
Faulty addition
Weird bank
Delete operation
Palindromize
Color ribbon
Unique subsequences
Unique subsequences 2
Cow exhibition
Knapsack 3
Compressing array
Regular bracket sequence 2
Maximum path 3
Concating substring
Soil
Stacking boxes
String transformation
Palindromic quadruple
Finding teammates
Topic
Dynamic Programming
Rating 1300
Solution (1) Solution