Strict Standards: Non-static method HTML_content::Title() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 470
B4. Bộ sưu tập
Strict Standards: Non-static method HTML_content::EditIcon() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 632
|
Strict Standards: Non-static method HTML_content::PdfIcon() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 473
Strict Standards: Non-static method mosHTML::PrintIcon() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 476
Strict Standards: Non-static method mosAdminMenus::ImageCheck() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/includes/joomla.php on line 2329
Strict Standards: Non-static method HTML_content::EmailIcon() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 479
Strict Standards: Non-static method HTML_content::Section_Category() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 511
Strict Standards: Non-static method HTML_content::Section() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 755
Strict Standards: Non-static method HTML_content::Category() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 758
Strict Standards: Non-static method HTML_content::Author() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 514
Người viết: Ngô Minh Đức
|
Strict Standards: Non-static method HTML_content::CreateDate() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 517
20/06/2008 |
Strict Standards: Non-static method HTML_content::URL() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 520
Strict Standards: Non-static method HTML_content::TOC() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 526
Một bộ sưu tập tiền xu cổ được
coi là có giá trị phải gồm không ít hơn đồng
tiền vàng, đồng
tiền bạc và đồng
tiền đồng.
Bộ sưu tập ban đầu
của Alibaba có một số lượng nhất định
các đồng tiền vàng, bạc và đồng nhưng chưa
phải là một bộ sưu tập có giá trị. Tại
Trụ sở của Hiệp hội những người
sưu tầm tiền cổ có đặt một máy đổi
tiền để giúp hội viên đổi được
các bộ sưu tập có giá trị. Tuy nhiên, máy đổi
chỉ hỗ trợ việc đổi tiền trọn
gói theo quy tắc đổi gói ( ) lấy gói ( ) đồng tiền. Các quy tắc đổi
tiền khác nhau từng đôi một, được gán
số hiệu tuần tự 1,2,3, . . . và được
công bố trước. Hội viên có thể tạo gói
tiền thích hợp từ bộ sưu tập của mình để
thực hiện việc đổi tiền. Số lần đổi
tiền là không hạn chế, tuy nhiên, để ngăn
chặn việc đầu cơ, Hiệp hội quy định
mỗi hội viên không được giữ quá 4 đồng
tiền mỗi loại. Các đồng tiền nhận được
sau mỗi lần đổi được gộp lại
với các đồng tiền mà hội viên đang có để
thành một bộ sưu tập mới và có thể được
sử dụng để đổi trong những lần
sau nếu cần.
Yêu cầu: Cho
biết số lượng các đồng tiền vàng, bạc, đồng
mà Alibaba có ban đầu và các quy tắc đổi
tiền. Hãy chỉ ra một phương án đổi tiền
nào đó để Alibaba có được bộ sưu
tập có giá trị. Dữ liệu vào đảm bảo
luôn có phương án.
Dữ
liệu: Vào từ file văn bản COLLECT.INP:
·
Dòng đầu ghi 6 số nguyên không
âm ;
·
Các dòng tiếp theo mỗi dòng ghi 6
số nguyên không âm xác định một quy tắc đổi
tiền.
Kết
quả: Đưa ra file văn bản COLLECT.OUT
một dòng ghi dãy số hiệu các quy tắc theo thứ
tự đã sử dụng trong phương án đổi
tiền.
Các số
trên một dòng của file dữ liệu và file kết
quả đặt cách nhau ít nhất một dấu cách.
Ví dụ:
COLLECT.INP
|
|
COLLECT.OUT
|
4 0 1 3 3 3
1 0 1 0 2 2
0 1 1 0 0 3
2 0 1 1 2 3
1 0 0 1 1 0
|
|
3 4
|
|
|
Strict Standards: Non-static method HTML_content::ModifiedDate() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 536
Strict Standards: Non-static method HTML_content::ReadMore() should not be called statically in /home/vmapps4u/public_html/vnoi_v0/components/com_content/content.html.php on line 539