Ubiquity

AtCoder
IDabc178_c
Time2000ms
Memory256MB
Difficulty
How many integer sequences $A_1,A_2,\ldots,A_N$ of length $N$ satisfy all of the following conditions? * $0 \leq A_i \leq 9$ * There exists some $i$ such that $A_i=0$ holds. * There exists some $i$ such that $A_i=9$ holds. The answer can be very large, so output it modulo $10^9 + 7$. ## Constraints * $1 \leq N \leq 10^6$ * $N$ is an integer. ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
2
Output #1
2

Two sequences ${0,9}$ and ${9,0}$ satisfy all conditions.
Input #2
1
Output #2
0
Input #3
869121
Output #3
2511445
API Response (JSON)
{
  "problem": {
    "name": "Ubiquity",
    "description": {
      "content": "How many integer sequences $A_1,A_2,\\ldots,A_N$ of length $N$ satisfy all of the following conditions? *   $0 \\leq A_i \\leq 9$ *   There exists some $i$ such that $A_i=0$ holds. *   There exists some",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc178_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "How many integer sequences $A_1,A_2,\\ldots,A_N$ of length $N$ satisfy all of the following conditions?\n\n*   $0 \\leq A_i \\leq 9$\n*   There exists some $i$ such that $A_i=0$ holds.\n*   There exists some...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments