Trang Chủ | Diễn Đàn | Thành Viên (Đăng Ký) | Tìm Kiếm | Tutorial Room
CLB Thuật toán - DSAP Club - Một số bài về dãy Fibonacci! Help me!
Data Structures + Algorithms = Programs Club. CLB dành cho các bạn yêu thích các bài tập thuật toán. DSAPVN Club Homepage.
Chú ý: CLB Thuật toán FAQs
First page Previous page  (Page 1 )   1   Next page Last page
Một số bài về dãy Fibonacci! Help me!
Member
Member since
00:40 28-11-2009
Posts: 757
Fantasy Points: 2,649
Rank
question Posted at 06:18 27-02-2010 Move Move Topic   Pin/Unpin Pin Topic   Lock Lock Topic
1. Cho F(m) và F(m'). Tính F(u), F(1), F(2).
2. Tính:
a/ F(1) + F(3) + ... + F(2n+1)
b/ F(2) + F(4) + ... + F(2n)
c/ F(1) + F(2) + ... + F(n)
d/ F(m+d) + F(2m+d) + ... + F(km+d).
1,2/
Code theo 2 cách:
Cách 1: Cách thô nhất (tính từ F(1) lên).
Cách 2: Cách tối ưu.
Trên đời nghìn vạn điều cay đắng
Cay đắng chi bằng học môn văn
This post has been edited 1 time(s). Last edited by bigbelly on 23:12 27-02-2010.
Reply Reply   Quote Quote   Edit Edit   Delete Delete   Report Report
This post has been viewed 2,452 time(s). 1 direct repli(es) and 1 indirect repli(es).
Title Poster
question Một số bài về dãy Fibonacci! Help me!
 
answer Re: Một số bài về dãy Fibonacci! Help me!
bigbelly
Re: Một số bài về dãy Fibonacci! Help me!
Member
Member since
00:40 28-11-2009
Posts: 757
Fantasy Points: 2,649
Rank
answer Posted at 03:56 04-03-2010
Reply to Một số bài về dãy Fibonacci! Help me! (bigbelly)
Help me mod lyf (hay ai đó) ơi!!!!
Trên đời nghìn vạn điều cay đắng
Cay đắng chi bằng học môn văn
Reply Reply   Quote Quote   Edit Edit   Delete Delete   Report Report
This post has been viewed 2,404 time(s). 1 direct repli(es) and 0 indirect repli(es).
Title Poster
answer Re: Một số bài về dãy Fibonacci! Help me!
 
answer Re: Một số bài về dãy Fibonacci! Help me!
thaohothi
Re: Một số bài về dãy Fibonacci! Help me!
Member
Member since
16:59 18-01-2010
Posts: 24
Fantasy Points: 86
Rank
answer Posted at 10:23 09-03-2010
Reply to Re: Một số bài về dãy Fibonacci! Help me! (bigbelly)
1.Không mất tính tổng quát, giả sử m<m'<u.
- Viết đệ quy:
int F(i);
{if (i=m') return F(m');
else
if (i =m) return F(m);
else
return F(i-1)*F(i-2);
}
- Ta có thể viết bằng qui hoạch động, nội suy các giá trị khác cho đến khi đạt F(u), cách này hay hơn đệ quy.
- Ngoài ra ta có thể nhẩm ra a, b dựa trên u, m, m' để
a.F(m) + b.F(m') = F(u).
Cách này hay nhất.
Mình mới nêu ra cách giải, chưa kiểm nghiệm.

2. Theo mình cũng dùng toán như cách thứ ba là lẹ nhất.
Chú ý: F(1), F(2) theo đề là hoàn toàn chưa biết.
Reply Reply   Quote Quote   Edit Edit   Delete Delete   Report Report
This post has been viewed 2,303 time(s). 0 direct repli(es) and 0 indirect repli(es).
First page Previous page  (Page 1 )   1   Next page Last page

Permissions: Create Topic: No  |  Reply Topic: No  |  Attach File: No  |  Make Poll: No

Vietnamese Keyboard: AUTO TELEX VNI VIQR VIQR* OFF

Go top || Print page ||

All logos, trademarks and graphics artwork in this site are property of their respective owners.
Opinions expressed in articles within this site are those of their owners and may not reflect the opinion of TXBB.

TXBB: Home - Disclaimer - Help - Contact
Copyright (C) 2000-2006 TXBB. All rights reserved.

TreXanh Bulletin Board v2.0 (Build: #332 Nov 21, 2006)

DEBUG INFORMATION
Execution 0.198s - SQL used 6s - Concurrent process(es) 0