当前位置:网站首页>Basic exercises of test questions Fibonacci series
Basic exercises of test questions Fibonacci series
2022-06-13 02:07:00 【Jerry-hao】
This method is easy to burst the memory
f =[1]*1000000
n = int(input())
for i in range(3,n+1):
f[i]=(f[i-1]+f[i-2])%10007
print(f[n])
This is better :
f1 = 1
f2 = 1
n = int(input())
for i in range(n-2):
f = (f1+f2)%10007
f1 = f2
f2 = f
print(f2)
边栏推荐
- Top level configuration + cooling black technology + cool appearance, the Red Devils 6S Pro is worthy of the flagship game of the year
- 传感器:SHT30温湿度传感器检测环境温湿度实验(底部附代码)
- Delphi7 compressed pictures (BMP, JPG, PNG)
- 华为设备配置CE双归属
- STM32 sensorless brushless motor drive
- Ten thousand words make it clear that synchronized and reentrantlock implement locks in concurrency
- Calculation of accuracy, recall rate, F1 value and accuracy rate of pytorch prediction results (simple implementation)
- 蓝牙模块:使用问题集锦
- How to learn C language and share super detailed experience (learning note 1 -- basic data types of C language)
- Parameter measurement method of brushless motor
猜你喜欢

Devaxpress Chinese description --tcxpropertiesstore (property store recovery control)

柏瑞凯电子冲刺科创板:拟募资3.6亿 汪斌华夫妇为大股东
![[learning notes] xr872 GUI littlevgl 8.0 migration (file system)](/img/9b/0bf88354e8cfdbcc1ea91311c9a823.jpg)
[learning notes] xr872 GUI littlevgl 8.0 migration (file system)

Application circuit and understanding of BAT54C as power supply protection

LabVIEW大型项目开发提高质量的工具

Get started quickly cmake

Stm32 mpu6050 servo pan tilt support follow

Installing Oracle with docker for Mac

SQLserver2008 拒绝了对对象 '****' (数据库 '****',架构 'dbo')的 SELECT 权限

记录:如何解决MultipartFile类的transferTo()上传图片报“系统找不到指定的路径“问题【亲测有效】
随机推荐
Decompression and compression of chrome resource file Pak
Gome's ambition of "folding up" app
Devaxpress Chinese description --tdximageslider (picture rotation control)
STM32F103 IIC OLED program migration complete engineering code
[the second day of the actual combat of the smart lock project based on stm32f401ret6 in 10 days] light up with the key ----- input and output of GPIO
Pytoch freeze pre training weights (feature extraction and BN layer)
CCF 201409-1: adjacent number pairs (100 points + problem solving ideas)
Huawei equipment is configured with dual reflectors to optimize the backbone layer of the virtual private network
JS get element
Sensor: sht30 temperature and humidity sensor testing ambient temperature and humidity experiment (code attached at the bottom)
16 embedded C language interview questions (Classic)
Leetcode daily question - 890 Find and replace mode
[work with notes] MFC solves the problem that pressing ESC and enter will automatically exit
The commercial value of Kwai is being seen by more and more brands and businesses
Calculation of accuracy, recall rate, F1 value and accuracy rate of pytorch prediction results (simple implementation)
Can't use typedef yet? C language typedef detailed usage summary, a solution to your confusion. (learning note 2 -- typedef setting alias)
Review the history of various versions of ITIL, and find the key points for the development of enterprise operation and maintenance
Learning notes 51 single chip microcomputer keyboard (non coding keyboard and coding keyboard, scanning mode of non coding keyboard, independent keyboard, matrix keyboard)
[the second day of actual combat of smart lock project based on stm32f401ret6 in 10 days] GPIO and register
Why is "iFLYTEK Super Brain 2030 plan" more worthy of expectation than "pure" virtual human