基础
viva_la_vida__
这个作者很懒,什么都没留下…
展开
-
左闭右开总结
边界值是需要注意的,贯彻左闭右开思想,左指针一直在当前被计算的位置,右指针在该区间往后一个位置。原创 2022-07-18 13:26:30 · 200 阅读 · 0 评论 -
python 语法
1.python self代表类的实例,在刷leetcode的时候可以当成全局变量使用 2.pass by reference/pass by value pass by reference: mutable objects array,dict, set, deque, heapq, treenode pass by value: immutable integer,string,tuple3.sort原创 2022-07-12 13:02:42 · 341 阅读 · 0 评论 -
二分查找
注意 用SCANF节省时间 •#include •#include •#include •#include •usingnamespace std; •intdata[1000001]; •intmain() •{ • intr,l,mid; //定义左 右 •intn,m; •while(cin>>n>>m) •{原创 2017-04-02 19:24:19 · 189 阅读 · 0 评论 -
Fibonacci Again hdu1021
There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). Input Input consists of a sequence of lines, each containing an integer n.原创 2017-04-03 19:46:45 · 196 阅读 · 1 评论