QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22697. Các cách biểu diễn tổng

Statistics

Farmer John yêu cầu bò tìm các tập số khác nhau có tổng bằng số đã cho. Chỉ dùng lũy thừa nguyên của 2. Đây là các tập có tổng 7:

1) 1+1+1+1+1+1+1

2) 1+1+1+1+1+2

3) 1+1+1+2+2

4) 1+1+1+4

5) 1+2+2+2

6) 1+2+4

Giúp FJ đếm mọi cách biểu diễn số nguyên $N$ ($1 \le N \le 1{,}000{,}000$).

Dữ liệu vào

Một dòng chứa một số nguyên $N$.

Dữ liệu ra

Số cách biểu diễn $N$ thành tổng như trên. Có thể rất lớn nên chỉ in 9 chữ số cuối trong biểu diễn thập phân.

Ví dụ

Dữ liệu vào 1

7

Dữ liệu ra 1

6

Bài 1: Các cách biểu diễn tổng

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.