ICode9

精准搜索请尝试: 精确搜索
  • Python 的一些高级特性2021-12-08 23:33:00

    好的代码应当是简洁易懂易维护的,所以代码不是越多越好,也不是越复杂越好。 在工作中,如果刻意得去炫技,故意写一些复杂的、难以看懂的代码,会导致这代码只有你自己能看懂,甚至一段时间之后,你自己也会看不懂。 等你离职了,下一个接手项目的人在看代码的时候会非常痛苦,心里一定在骂你。 要

  • 【数据库】 -- MySQL中查询当前时间间隔前1天的数据2021-12-08 01:31:16

    1.背景 实际项目中我们都会遇到分布式定时任务执行的情况,有时定时任务执行的时候如果查询的数据量比较大时,我们会选择执行时间间隔几天前的数据筛选后进行执行。 避免执行全量的数据导致内存占用过大或执行时间过长导致OOM等问题。 这里我们就会用到SQL来过滤当前时间间隔1天或几

  • map容器2021-12-06 21:01:55

    map容器 #include <map> #include <string> #include <iostream> using namespace std; int main(){ //初始化map map<int, string> mapStudent; mapStudent.insert(pair<int, string>(1, "student_one")); mapStude

  • 【CTF】攻防世界·Reverse(二)open-source2021-12-02 23:05:22

    Hello,又是我,我又双叒叕被催更了...... 首先看一下题目给我们的c语言的源代码: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { if (argc != 4) { printf("what?\n"); exit(1); } unsigned int first = atoi(argv[1]);

  • 学习python第(n’)天——我在看笨办法学python(参数,解包,变量)2021-12-02 11:33:11

    这是所有的语言 from sys import argv#read the WYSS section for how to run this.#ex3.py是参数。# argv 是参数变量(argument variable)。#import的作用是调用参数特性,这些导入的特性称为模块(module)或库(library)。 script, first, second, third = argv#这是一个解包(unpac

  • C++结构体数组2021-11-28 19:06:02

    【问题描述】定义一个结构体数组,存放3为职工的信息,并计算最高的工资值及所有职工工资的合计值。 【输入形式】输入结构体数组中各元素的成员 【输出形式】输出三个成员的在最高工资和工资合计值,成员包括name、id和salary。 【样例输入】the first person:           

  • CF1006B 题解2021-11-27 16:33:42

    题意 给定长度为n的序列,要求分成k段,最大化每段最大值的和 输入 第一行n和k(1 <= k <= n <= 2000) 第二行为序列a[1],a[2],a[3]....... 输出 第一行n和k 题解 1.排序排出前kk个数值 2.再把位置从低到高排一下,还原数组 3.碰到前kk个数中其中一个数就分割,分摊到每一组。 代码 #in

  • java Math.pow2021-11-27 08:02:12

    Math.pow /** * Returns the value of the first argument raised to the power of the * second argument. Special cases: * * <ul><li>If the second argument is positive or negative zero, then the * result is 1.0. * <

  • uva112922021-11-24 19:58:57

    你的王国里有一条n个头的恶龙,你希望雇佣一些骑士把它杀死(即砍掉所有头)。村里有m个骑士可以雇佣,一个能力值为x的骑士可以砍掉恶龙一个直径不超过x的头,且需要支付x个金币。如何雇佣骑士才能砍掉龙的所有头,且需要支付的金币最少?注意,一个骑士只能砍一个头。(且不能被雇佣两次)。 输

  • 学习记录11.232021-11-23 20:58:15

    1#include <stdio.h>2#include <string.h> 3int main(int argc, char *argv[]) { 4    if (argc != 4) {            // argc = 4  5       printf("what?\n"); 6        exit(1);  7   } 8    unsigned int first = atoi(argv[1]);  9   if (first !

  • leetcode-删除链表的倒数第N个节点,包含入栈、双指针2021-11-18 16:01:47

    struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; 1.暴力解法 class Solution { public:

  • Google Earth Engine(GEE)——GEE自带的归一化指数计算工具介绍2021-11-18 10:59:22

    上一篇当中有介绍直接通过波段运算,但是更好的方式是通过内置的算法来实现,这样适配性问题会更好一些 normalizedDifference(bandNames) Computes the normalized difference between two bands. If the bands to use are not specified, uses the first two bands. The normalize

  • 第16题:网络延迟时间2021-11-17 22:58:11

    解题思路:先写一个比较函数,用于得到最小值,用Dijkstra算法算出源点到所有点的最短路径,再取最长的那个返回即可 源代码: struct MyStruct {     int pos;     int time;     //  比较函数, 在优先队列里, 将较小的排在尾部, top()得到的就是队列里面最小值  

  • 2021-11-14(JZ57 和为S的两个数字)2021-11-17 12:31:49

    import java.util.ArrayList; public class Solution { public ArrayList<Integer> FindNumbersWithSum(int [] array,int sum) { ArrayList<Integer> result=new ArrayList<>(); int first=0,second=array.length-1; while(fi

  • linq-Except2021-11-16 16:31:28

    源码: public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second) { if (first == null) throw Error.ArgumentNull("first"); if (sec

  • 联合类型和类型保护2021-11-14 17:59:18

    联合类型和类型保护 类型保护在需要联合类型的时候才会出现或需要类型保护(类型守护)。 先创建两个接口 interface Student{ anjiao: boolean; say: () => { } } interface Teacher { anjiao: boolean; skill: () => {}; } 调用判断接口,所采用

  • Vue中获取当前时间组件2021-11-14 15:30:46

    <template> <div>{{ nowDate }}</div> </template> <script> export default { data() { return { nowDate: "", // 当前日期 }; }, methods: { currentTime() { setInterval(this.formatDate, 500);

  • map的三种插入方法和常用函数以及一些小问题2021-11-13 17:31:30

    #include <bits/stdc++.h> using namespace std; #define x first #define y second map<int, int> a; map<pair<int, int>, int > b; map<int, pair<int, int> > c; int main() { for (int i = 1; i <= 3; i ++ ) { a[i] =

  • C++的STL容器案例-员工分组2021-11-13 14:32:25

    文章目录 前言一、主要功能二、源程序1.程序2.功能界面 总结 前言 环境:Visual Studio 2017版本 B站的课程链接:https://www.bilibili.com/video/BV1et411b73Z?p=236&spm_id_from=pageDriver 一、主要功能 二、源程序 1.程序 #include<iostream> #include<string> usin

  • CSS-second-passage2021-11-09 19:01:21

    一、Emment语法 1.作用 (1)快速生成HTML结构语法 (2)快速生成CSS样式语法 2.使用方法   (1)tab+标签名   (2)生成多个相同标签:标签名*个数+tab   (3)包含关系:标签名>标签名   (4)并列关系:标签名+标签名   (5)标签名.类名     #标签名   (6)div+{ 内容 } +tab    

  • 【JAVA】编程(2)---时间管理2021-11-09 11:00:28

    作业要求: 定义一个名为 MyTime 的类,其中私有属性包括天数,时,分,秒;定义一个可以初始化时,分,秒的构造方法,并对初始化数值加以限定,以防出现bug;定义一个方法,可以把第几天,时,分,秒打印出来;通过定义方法可以分别对时,分,秒进行加运算,要保证天数,时,分,秒间的进制转换无误; 调试:在主方法中创建time对

  • Vue按格式 实时获取当前时间并显示2021-11-08 10:04:35

    <template> <div>{{ nowDate }}</div> </template> <script> export default { data() { return { nowDate: "", // 当前日期 }; }, methods: { currentTime() { setInterval(this.formatDate, 500);

  • 1607D - Blue-Red Permutation(贪)2021-11-07 11:58:16

    ​​​​​​1607D - Blue-Red Permutation 题目: int数组a和char数组b,当b[i]=R时可以将a[i]增大,b[i]=B时可以将a[i]减小。求是否能将a[i]变成包含1~n的数组。 题解: 用pair数组存储,对其进行排序,贪心一下,让B在前面,R在后面。 因为B只能减小,所以放在前面,R反之。 #include<bits/s

  • Python编程题26--爬楼梯2021-11-06 11:31:24

    题目 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。每次你可以爬 1 或 2 个台阶。请问有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数,其范围为:1 ≤ n ≤ 100。 例如: 给定一个正整数:2,返回结果:2 说明:共有 2 种方法爬到楼顶,第一种为 1阶 + 1阶,第二种为 2 阶。 给定一个

  • 云学编程的第6天—【微软官方python入门教程 P13-P14笔记】2021-11-06 数字与字符串类型转换2021-11-06 11:06:53

    P13数字与字符串类型的转换   calculate : You can do math with numbers the plus sign for addition; the negative sign for subtraction; the slash for division; the asterisk symbol for multiplication; exponent or to the power of is a double asterisk. first_n

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有