>>> from pyb import RTC
>>>help(RTC)
object <class 'RTC'> is of type type
init --<function>
info --<function>
datetime --<function>
wakeup --<function>
calibration --<function>
from pyb import RTC
import time
# 定义星期数组
weekdays =['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
rtc =RTC()
rtc.datetime((2023,11,28,2,21,10,15,0)) # set a specific date and time
if __name__ =='__main__':while True:#Get the current time from the RTC
current_time = rtc.datetime()print(current_time) # get date and time
time.sleep(1)
year, month, day,weekday, hour, minute, second, yearday = rtc.datetime()
# 获取星期对应的数组成员
weekday_name = weekdays[weekday]print("当前时间:{}-{}-{} {}:{}:{} Week:{}".format(year, month, day, hour, minute, second,weekday_name))
这里写自定义目录标题 题目分析代码思路 题目分析 n,m都是 1 0 5 10^5 105 ,需要将时间复杂度控制在 n log n n \log n nlogn以内。 如果有两次连续的前缀操作,由于它们都是降序排列,等价于只做第二次排列,忽略掉第一次。 同…