码迷,mamicode.com
首页 >  
搜索关键字:turn    ( 27138个结果
python:practice built-in function
built-in function,is python already prepar for us ,anytime we can call built-in function when we needed it . all() dict() help() all([1,2,'') eval('1+ ...
分类:编程语言   时间:2020-03-15 11:23:37    阅读次数:79
设计模式之工厂模式(简单工厂,工厂方法,抽象工厂)
设计模式6大原则:1.开闭原则:对拓展开放,对修改关闭2.单一职责原则:一个类只复杂一项职责3.里氏原则:子类可以扩展父类的功能,但不改变父类原有的功能4.依赖倒置原则:面向接口编程5.接口隔离原则:设计接口功能尽量细粒度,最小功能单元6.迪米特法则:降低耦合度(局部变量中,不要引入新的类) 这里对 ...
分类:其他好文   时间:2020-03-15 09:49:14    阅读次数:49
CodeForces 1325D Ehab the Xorcist(异或和+算数和)
http://codeforces.com/contest/1325/problem/D 大致题意: 给出两个数a,b,求最短的一组数,使得他们异或和为a,算术和为b。 因为 a^t^t=a,所以只要能写成 a+t+t=b 的形式,就满足正确性,所以这组数最多也就3个数。 如果a和t的各个二进制位上 ...
分类:其他好文   时间:2020-03-15 09:21:35    阅读次数:71
js轮播图
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>原生js轮播图</title> <style type="text/css"> *{ padding: 0; margin: 0; list-style: none ...
分类:Web程序   时间:2020-03-15 09:16:59    阅读次数:64
力扣第1013题 将数组分成和相等的三部分
力扣第1013题 将数组分成和相等的三部分 ...
分类:编程语言   时间:2020-03-15 00:10:46    阅读次数:59
一个数中不含有某个数字的算法
bool f(int x){ for(;x!=0;x/=10) //注意 x必须不等于0,并非x>=0 if(x%10==7) return true; return false; } 思路:先看个位是不是那个数字,然后看十位是不是那个数字,以此类推 ...
分类:编程语言   时间:2020-03-15 00:03:22    阅读次数:79
leetcode162 Find Peak Element
1 """ 2 A peak element is an element that is greater than its neighbors. 3 Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element a ...
分类:其他好文   时间:2020-03-14 21:47:44    阅读次数:51
2020.3.13实验室周赛题解(2019山东)
A.Calendar 题意: 每一年12个月,每个月30天,每星期只有5天,问下一个日期是星期几。 题解: 直接忽略年和月,算天数就可以得到答案。 #include<bits/stdc++.h> using namespace std; typedef int ll; int T; int year ...
分类:其他好文   时间:2020-03-14 20:24:52    阅读次数:77
二重指针应用
1 //利用二重指针实现改变指针数组和数组元素之间的mapping,并没有改变原数组 2 3 #include<stdio.h> 4 int a[5]; 5 int *name[]={&a[0],&a[1],&a[2],&a[3],&a[4]}; 6 int **p; 7 int main() 8 ...
分类:其他好文   时间:2020-03-14 20:04:55    阅读次数:48
HDU6579 Operation
题意: 有两种操作: 0 l r 在区间l,r里面选择一些数,使得他们的异或和最大,并输出这个最大值。 1 x 将x推进序列,序列长度加1。 题解: 看了网上的线性基才会做,知识盲区... #include<cstdio> #include<algorithm> #include<cstring> ...
分类:其他好文   时间:2020-03-14 19:49:48    阅读次数:43
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!