网站首页 站内搜索

搜索结果

查询Tags标签: cur,共有 591条记录
  • LeetCode 128 Longest Consecutive Sequence

    Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in \(O(n)\) time. Solution 既然不能排序,那就用 \(set\) 将元素全部存进去。从所有可能序列中的最小开始遍历,逐…

    2022/9/17 23:16:19 人评论 次浏览
  • 自动产生configure

    #!/bin/bash dir=$(pwd) echo $dircd $dir rm -rf cur cp test cur -r cd curautoscan name=configure.ac mv configure.scan $name sed -i s|AC_OUTPUT|AC_OUTPUT(Makefile)|g $name sed -i s|\[FULL-PACKAGE-NAME\]|demo|g $name sed -i s|\[VERSION\]|1.0|g $name sed …

    2022/9/15 23:18:35 人评论 次浏览
  • leetcode 78. 子集 js 实现

    给你一个整数数组 nums ,数组中的元素 互不相同 。返回该数组所有可能的子集(幂集)。 解集 不能 包含重复的子集。你可以按 任意顺序 返回解集。 示例 1: 输入:nums = [1,2,3]输出:[[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]示例 2: 输入:nums = [0]输出:[[],[…

    2022/9/14 6:16:24 人评论 次浏览
  • 算法--链表

    方法一:构造链表 如果此类型的题出现在笔试中,如果内存要求不高,可以采用如下方法:可以先用一个vector将单链表的指针都存起来,然后再构造链表。此方法简单易懂,代码好些。/* struct ListNode {int val;struct ListNode *next;ListNode(int x) :val(x), next(NULL) …

    2022/9/5 14:24:17 人评论 次浏览
  • leetcode 面试题08.08 有重复字符串的排列组合 C/C++ 排序 + 深度优先搜索(分支限界)

    #include<iostream>#include<algorithm>#include<vector>using namespace std;class Solution {public: vector<string> permutation(string S) { sort(S.begin(),S.end()); vector<string> retVec; vector<int…

    2022/9/4 14:23:04 人评论 次浏览
  • SQLServer重建索引

    查询碎片率SELECT a.index_id ,B.name [IndexName] ,avg_fragmentation_in_percent FROM sys.dm_db_index_physical_stats ( DB_ID() , NULL , NULL, NULL, NULL ) AS A JOIN sys.indexes AS B ON a.object_id = b.object_id AND a.index_id = b.index_id inner JOIN sys.…

    2022/9/4 2:22:45 人评论 次浏览
  • 移除链表元素

    移除链表元素 难度简单1013收藏分享切换为英文接收动态反馈 给你一个链表的头节点 head 和一个整数 val ,请你删除链表中所有满足 Node.val == val 的节点,并返回 新的头节点 。 示例 1:输入:head = [1,2,6,3,4,5,6], val = 6 输出:[1,2,3,4,5]示例 2: 输入:head =…

    2022/9/2 23:24:48 人评论 次浏览
  • 206 反转链表

    题目206 反转链表 给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。 示例 1: 输入:head = [1,2,3,4,5] 输出:[5,4,3,2,1] 示例 2: 输入:head = [1,2] 输出:[2,1] 示例 3: 输入:head = [] 输出:[] 双指针思路:定义指针cur指向head,定义指针pre,定…

    2022/9/1 23:26:06 人评论 次浏览
  • LeetCode 854. K-Similar Strings

    原题链接在这里:https://leetcode.com/problems/k-similar-strings/ 题目: Strings s1 and s2 are k-similar (for some non-negative integer k) if we can swap the positions of two letters in s1 exactly k times so that the resulting string equals s2. Given t…

    2022/8/29 6:52:52 人评论 次浏览
  • 10.异步mysql

    python中操作mysql连接、操作、断开都是网络IO#安装支持异步aiomysql的模块 pip3 install aiomysql async def execute():# 网络IO操作,连接数据库,遇到IO切换任务conn = await aiomysql.connect(host, 3306, root, password, db)# 网络IO操作,遇到IO自动切换任务cur = …

    2022/8/23 2:24:19 人评论 次浏览
  • 【题解】后缀自动机(SAM)选做(22.8.11)

    做完这些我才感觉我的后缀自动机入门了之前写的东西就是一坨屎 对于后缀自动机的学习,我总结了以下三句话: 千万不要死磕模板!!! 千万不要死磕模板!!! 千万不要死磕模板!!! 谁死磕模板谁&#*%#(@# 这次就主要是我对于后缀自动机的理解,只是纯纯的自动机,不…

    2022/8/11 23:30:08 人评论 次浏览
  • 一键安装Mysql并配置主从复制

    出于学习目的, 编写一键搭建Mysql脚本主机信息IP 名称 角色192.168.114.133 node1 master192.168.114.134 node2 slave192.168.114.135 node3 slave使用三台机器,搭建一主两从 前期准备使用Ansible, 便于集群主机节点管理配置文件, 机器IP,角色信息脚本 配置文件 con…

    2022/8/9 2:23:37 人评论 次浏览
  • SQL serve 游标记录数据条数

    这个很好办,你在你的游标循环中加一个变量纪录滚过的纪录即可 如: declare @cur_pos int declare mycursor cursor for select col1,col2 from mytable declare @col1 char(10) declare @col2 char(10)open mycusor fetch next mycursor into @col1,@col2 while @@fetch_s…

    2022/7/29 2:53:35 人评论 次浏览
  • 2022“杭电杯”中国大学生算法设计超级联赛(3)1002/1011补题

    2022“杭电杯”中国大学生算法设计超级联赛(3)大量参考官方题解1002 Boss Rush 题意:给定\(n\)个技能,每个技能最多使用一次,释放第\(i\)个技能需要的回合数为\(t_i\),伤害持续的回合为\(len_i\),持续回合的伤害为\(d_{i,j}(1\le j\le len_i)\)。在一个技能释放时不…

    2022/7/27 14:22:53 人评论 次浏览
  • [LeetCode] 919. Complete Binary Tree Inserter

    A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. Design an algorithm to insert a new node to a complete binary tree keeping it complete after the i…

    2022/7/26 6:52:57 人评论 次浏览
共591记录«上一页1234...40下一页»
扫一扫关注最新编程教程