Album
米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!
米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。
2025-11-15 19:01:56
溫度26℃ 濕度76% 氣壓1019.11hPa
2025-11-15 17:32:10
閃電27km (0)
2025-11-15 13:54:00
閃電27km (0)
2025-11-15 11:48:22
閃電17km (1)
2025-11-15 11:48:01
閃電31km (0)
2025-11-14 17:19:40
閃電24km (0)
2025-11-13 18:08:18
閃電24km (0)
2025-11-13 18:01:12
閃電31km (0)
2025-11-12 18:15:28
閃電24km (0)
2025-11-11 18:01:15
閃電24km (0)
2025-11-11 18:01:14
閃電24km (0)
溫度26℃ 濕度76% 氣壓1019.11hPa
2025-11-15 17:32:10
閃電27km (0)
2025-11-15 13:54:00
閃電27km (0)
2025-11-15 11:48:22
閃電17km (1)
2025-11-15 11:48:01
閃電31km (0)
2025-11-14 17:19:40
閃電24km (0)
2025-11-13 18:08:18
閃電24km (0)
2025-11-13 18:01:12
閃電31km (0)
2025-11-12 18:15:28
閃電24km (0)
2025-11-11 18:01:15
閃電24km (0)
2025-11-11 18:01:14
閃電24km (0)
Find the longest increasing subsequence.
>>>Find the l...
Find the longest increasing subsequence in a data file.
| 1 | # Author: HUANG KWUN HOI (SKHBBSS, class 4D) |
| 2 | # Last modified: 2020.9.8 |
| 3 | file1=open('data2.txt', 'r') |
| 4 | list1=[] |
| 5 | list2=[] |
| 6 | longest_series=[] |
| 7 | x=0 |
| 8 | current_datum=0 |
| 9 | next_datum=0 |
| 10 | previous_longest_series_length=0 |
| 11 | current_series_length=0 |
| 12 | for data in file1: |
| 13 | a=data |
| 14 | b=a.split(',') |
| 15 | next_datum=float(b[1]) |
| 16 | list1.append(current_datum) |
| 17 | if x==0: |
| 18 | del list1[0] |
| 19 | x=1 |
| 20 | if current_datum>=next_datum: |
| 21 | previous_longest_series_length=int(len(longest_series)) |
| 22 | current_series_length=int(len(list1)) |
| 23 | if current_series_length>previous_longest_series_length: |
| 24 | longest_series=list1.copy() |
| 25 | list2=list1.copy() |
| 26 | list1.clear() |
| 27 | else: |
| 28 | list2=list1.copy() |
| 29 | second_last_datum=current_datum |
| 30 | current_datum=next_datum |
| 31 | file1.close() |
| 32 | if current_datum>second_last_datum: |
| 33 | list2.append(current_datum) |
| 34 | current_series_length=int(len(list2)) |
| 35 | if current_series_length>previous_longest_series_length: |
| 36 | longest_series=list2.copy() |
| 37 | print(longest_series, ' (', int(len(longest_series)), 'Days)' ) |
Album
米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!
米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。
2025-11-15 19:01:56
溫度26℃ 濕度76% 氣壓1019.11hPa
2025-11-15 17:32:10
閃電27km (0)
2025-11-15 13:54:00
閃電27km (0)
2025-11-15 11:48:22
閃電17km (1)
2025-11-15 11:48:01
閃電31km (0)
2025-11-14 17:19:40
閃電24km (0)
2025-11-13 18:08:18
閃電24km (0)
2025-11-13 18:01:12
閃電31km (0)
2025-11-12 18:15:28
閃電24km (0)
2025-11-11 18:01:15
閃電24km (0)
2025-11-11 18:01:14
閃電24km (0)
溫度26℃ 濕度76% 氣壓1019.11hPa
2025-11-15 17:32:10
閃電27km (0)
2025-11-15 13:54:00
閃電27km (0)
2025-11-15 11:48:22
閃電17km (1)
2025-11-15 11:48:01
閃電31km (0)
2025-11-14 17:19:40
閃電24km (0)
2025-11-13 18:08:18
閃電24km (0)
2025-11-13 18:01:12
閃電31km (0)
2025-11-12 18:15:28
閃電24km (0)
2025-11-11 18:01:15
閃電24km (0)
2025-11-11 18:01:14
閃電24km (0)

絕不能在一粒細小的電阻上印上數字來表表它的阻值,只能用色條來表示。記熟了這些色碼(Resistor Color Code),就能隨時讀出一粒電阻的阻值了。
晶體管(Transistor)有很多用途,只要了解幾款晶體管的特性,已能解決大部份驅動電路(Driver circuit)的問題了。
Arduino,電子線路,網站設計等等。