ICode9

精准搜索请尝试: 精确搜索
  • <day03>CSS选择器2022-07-13 21:33:22

    元素选择器 以标签名为选择器 语法 <style> p {       color: red; }</style> id选择器 id是每个标签公有的属性,id的值是唯一的 语法 <style> #id值 {       color: red; }</style>​<p id="id值">xxxxxx</p> 类选择器 每个标签共有的属性class 语法 <style>

  • 160 intersection of two linkedlist2022-07-12 02:02:53

    题目:找到两个linkedlist起始交集部分   如果没有交集,推出 O(1)     public class solution{public ListNode getIntersect(ListNode headA, ListNode headB){if(headA==null||headB==null) return null;ListNode a= headA;ListNode b=headB;while(a!=b){a=a==null?headB:a.next;b=

  • LEETCODE2 add two numbers2022-07-12 02:01:42

      so simple for this problem, but when I review it ,there are sill some main points which should be noticed.   1. dummy 2. carray. 3. after while l1,l2 != nulll  or carry=0   4.     public ListNode addTwoNumbers(ListNode l1,ListNdoe l2){ ListNode dummy

  • 325 add two nunber2022-07-12 02:00:30

    class Solution {     public ListNode oddEvenList(ListNode head) {         if(head==null) return null;         ListNode odd=head,even=head.next,evenHead=even;         while(even!=null&&even.next!=null){             odd.

  • 如何使用makedown(.md)做流程图2022-07-11 09:02:44

    转:https://blog.csdn.net/weddell/article/details/122390672     1. 使用VSCode, 首先安装 Markdown preview Enhenced   2. 创建一个.md结尾的文件 3. 样例: 样例一 : 基本图形和线型 ## 样例1```mermaidgraph LRA[方形] B(圆角)C{条件a}D[结果1]E[结果2]F((圆形))G[方形]X[

  • LeetCode Median of Two Sorted Arrays 排序2022-07-10 03:00:08

    Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be \(O(\log (m+n))\). Solution 简单排序即可: 点击查看代码 class Solution { private: vector<int> vc;

  • elastic.for--编法12022-07-09 00:01:55

    SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD, 1 RPL,DDSDDT,DRPLDE,DRPLDT, 2 STRAN,DSTRAN,TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CMNAME, 3 NDI,NSHR,NTENS,NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT, 4 CELENT,DFGRD0,DFGRD1,NOEL,NPT,LAYE

  • Java学习week two2022-07-07 23:05:16

    day02-字面量、变量、运算符1 第一章:Java语法 1.1 关键字 1).在我们昨天编写的程序中: 4).注意: 如果一个表达式中做“多件事情”,++和--在变量的前面或者后面将会影响最终结果: 【注意】 1).main:也要求必须这样写,也都是小写,但它不是“关键字”; 2).String、System、out,println这些都不

  • 数组对比去掉相同数据2022-07-01 16:04:55

    public static void main(String[] args) { List<String> one = new ArrayList<>(); one.add("jim"); one.add("tom"); one.add("jack"); // 集合二 List<String> two = new Arr

  • 409. 最长回文串(longestPalindrome)2022-06-29 11:34:38

    给定一个包含大写字母和小写字母的字符串 s ,返回 通过这些字母构造成的 最长的回文串 。 在构造过程中,请注意 区分大小写 。比如 "Aa" 不能当做一个回文字符串。   示例 1: 输入:s = "abccccdd"输出:7解释:我们可以构造的最长的回文串是"dccaccd", 它的长度是 7。 示例 2: 输入:s

  • [CF1045G]AI robots 题解2022-06-25 20:32:14

    传送门QAQ Preface 第一次学到用 CDQ 分治处理 two-pointers 的 trick QAQ。 Analysis 非常巧的做法。 首先我们发现,如果 \(i,j\) 可以互相看到,那么一定满足 \(\min(r_i,r_j) \ge |x_i-x_j|\)。 所以,我们珂以将所有机器人按 \(r\) 排序,这样右边能看到左边的话,左边必然能看到右边。

  • 二维字典新增数据2022-06-22 23:33:51

    dic = dict() def add_two_dimensional_dictionary(old_dict,key_a,key_b,value): if key_a in old_dict: old_dict[key_a].update({key_b:value}) else: old_dict.update({key_a:{key_b:value}}) add_two_dimensional_dictionary(dic, 'a

  • two pointer2022-06-19 03:00:28

    31. Next Permutation Medium A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3], the following are considered permutations of arr: [1,2,3], [1,3,2], [3,1,2], [2,

  • 获取第38次斐波那契数列的值,以及 前38次值的总和2022-06-13 19:32:12

    (数列规律是:0   1   1   2   3   5   8   13      .....        分析规律是:第三个数=第一个数+第二个数) var one = 0  ; // 第一个数 var two = 1 ; // 第二个数 var three = one + two ;  // 第三个数   var sum =  1 ;  // 求和的变量,因为第三个数=1;所以这

  • cf468 B. Two Sets2022-06-12 18:32:19

    题意: 给定 \(n\) 个两两不同的正整数,问能否把它们不重不漏地分为两个集合 \(A,B\)。要求: \(x\in A\implies a-x\in A\) \(x\in B\implies b-x\in B\) 思路: 法一:很傻很暴力 先假定所有数都属于 \(A\) 检查所有数,对某数 \(x\),若 \(a-x\notin A\),则把 \(x\) 推入待处理队列 \(q\) 检

  • [USACO17DEC]Barn Painting G 题解2022-06-11 00:04:09

    题面翻译 题意:给定一颗N个节点组成的树,3种颜色,其中K个节点已染色,要求任意两相邻节点颜色不同,求合法染色方案数。 题目描述 Farmer John has a large farm with \(N\) barns (\(1 \le N \le 10^5\)), some of which are already painted and some not yet painted. Farmer John wan

  • Blog—two2022-06-01 01:03:42

    前言    1.PTA大作业四前言   本次习题集,共分为三道题,第一题考察了对于正则表达式的运用,相对于前几次运用正则表达式判断输入格式是否合法,本题对于正则表达式的考察更复杂一些,需要提取一段文字中的所有数字,"\\D+" 可以匹配多个除数字外的字符,运用split函数提取出一段文字

  • 节点查找2022-05-30 06:31:24

    父节点查找特点:   1.parentNode 属性     2.返回最近一级的父节点 找不到返回为null   代码: li.parentnode.style.color = 'red' (子元素.parentnode)   子节点查找特点:  children:仅获得所有元素节点,返回的还是一个伪数组 代码: let ul = document.queryselecto

  • BitMask 相关2022-05-30 01:01:15

    318. Maximum Product of Word Lengths Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. If no such two words exist, return 0.  Example 1: Input: words = ["abcw&

  • LeetCode 0167 Two Sum II - Input Array Is Sorted2022-05-28 11:35:11

    原题传送门 1. 题目描述 2. Solution 1 1、思路分析 双指针。初始时,left=0, right=len(nums) - 1。left、right都往中间靠,若nums[left] + nums[right]等于target找到了,返回结果;若nums[left] + nums[right]小于target说明两数和偏小,要加大的话,让left右移(left++);若两数和大了,就要

  • LeetCode 0160 Intersection of Two Linked Lists2022-05-25 20:31:33

    原题传送门 1. 题目描述 2. Solution 1 1、思路分析 设len(A) = m, len(B) = n; A与B共同的部分len = s; m1 = m - s; n1 = n - s; 本题的关键是如何 处理 一般情况下: m1 != n1 方法一: 方案: 求和 鉴于 (m1 + s) + n1 = m + n1 = m1 + ( s + n1) = m1 + n 于是,以headA为出发点

  • Two Exams(ABC 238 F)2022-05-20 23:02:34

    AtCoder - abc238_f 题目大意 有\(n\)个人参加两场比赛,第\(i\)个人在第一场比赛中的排名是\(P_i\),在第二场比赛中的排名是\(Q_i\),现在要求你选择\(k\)个人,要求\(\forall\)被选择的人\(i\)和\(\forall\)没有被选择的人,满足\(P_i>P_j\)或\(Q_i>Q_j\),问有多少种选择的方法,答案对\(99

  • [leetcode] 1. Two Sum2022-05-17 20:01:12

    题目 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have *exactly* one solution, and you may not use the same element twice. You can return the a

  • 从一个字符串提取第一个单词的方法分享2022-05-16 22:02:31

    转自: http://www.java265.com/JavaJingYan/202205/16526262093388.html 字符串或串(String)是由数字、字母、下划线组成的一串字符。 一般记为 s=“a1a2···an”(n>=0)。它是编程语言中表示文本的数据类型。 在代码编写中,字符串(string)为符号或数值的一个连续序列,如符号串(一串字

  • leetcoce-160 相交链表2022-05-16 21:02:31

    Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null. For example, the following two linked lists begin to intersect at node c1: The

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

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

ICode9版权所有