摘要:
你总共有 n 枚硬币,并计划将它们按阶梯状排列。对于一个由 k 行组成的阶梯,其第 i 行必须正好有 i 枚硬币。阶梯的最后一行 可能 是不完整的。 给你一个数字 n ,计算并返回可形成 完整阶梯行 的总行数。 应该首先判断数据源是否是有序的,先二分。 var rs = ArrangeCoins(1 阅读全文
摘要:
using System; namespace PX; public class PXTest { public static void Show() { ScoreInfo scoreInfo = new ScoreInfo() { ID = 1, Name = "张三", CSharp = 12 阅读全文
摘要:
using System.Collections; using System.Collections.Generic; namespace HS; public class HXTest{ public const int k = 500_001; // 生成一个长度为50万的数组并初始化 publ 阅读全文
摘要:
C# 字典、集合、列表的时间复杂度 - 你也很优秀 - 博客园 (cnblogs.com) Dictionary查找Key的源码 private int FindEntry(TKey key) { if( key == null) { ThrowHelper.ThrowArgumentNullExc 阅读全文
摘要:
Sub 将sheet1中没有sheet2也有的加标记A() Dim i As Integer, j As Integer For i = 1 To 2880 'Worksheets("Sheet1").Cells(行,列) 和 Sheet1.Cells(行,列)等效 For j = 1 To 42 阅读全文
摘要:
给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 你可以按任意顺序返回答案。 来源:力扣(LeetCode)链接:htt 阅读全文
摘要:
Sub test() Dim arr()Dim i, j As Integerj = Range("A65536").End(xlUp).Row - 1ReDim arr(1 To j)For i = 1 To jarr(i) = Range("D"&i+1)+Range("E"&i+1)+Rang 阅读全文
摘要:
Sub test() '先在VBA的"工具(T)"->"引用(R)"中添加引用:Microsoft Word 14.0 Object Library Dim objApp As New Word.Application, Path, FileNamePath, i, j, arr, brr, str 阅读全文