码迷,mamicode.com
首页 >  
搜索关键字:k sum    ( 21381个结果
【leetcode】1396. Design Underground System
题目如下: Implement the class UndergroundSystem that supports three methods: 1. checkIn(int id, string stationName, int t) A customer with id card equal t ...
分类:其他好文   时间:2020-04-04 14:27:25    阅读次数:69
Java编程中常用到的编程思想
求和变量思想: 1.定义求和变量 2.将要求和的数字相加存储到求和变量中 public class SumTest{ public static void main(String[] args) { //求1-100(包含1和100)的数字总和 int sum = 0; for (int i = 1 ...
分类:编程语言   时间:2020-04-04 11:59:51    阅读次数:147
UCF Practice Local Contest 2018 (practice)Rummy Score (dfs)
dfs,对于每个点数的牌,都有:不出、作为同花出、作为顺子出这三种选择 #include<bits/stdc++.h> using namespace std; int a[20],x,anss=0x3f3f3f3f; void dfs(int k) { if(k>13) { int sum=0; ...
分类:其他好文   时间:2020-04-04 11:28:29    阅读次数:50
并查集题目整理
并查集 之前写最小生成树的时候对这一部分的知识也并没有十分详细的整理 近天做了一些用到并查集的题目,来整理一下 知识回顾 首先,先来回顾一下有关并查集的内容 <1> 定义 并查集是一种树型的数据结构,用于处理一些不相交集合(Disjoint Sets)的合并及查询问题。常常在使用中以森林来表示。 集 ...
分类:其他好文   时间:2020-04-04 09:34:21    阅读次数:61
2020.2.26考试T2 三元组
首先我们正着对每一个 $j$ 求一边 $\displaystyle \sum i$,设为 $a[j]$ 类似的倒着对每个 $j$ 求一边 $\displaystyle \sum k$,设为 $b[j]$ 那么答案就是 $\displaystyle \sum a[i] \times b[i+1]$ 考 ...
分类:其他好文   时间:2020-04-03 22:09:57    阅读次数:75
shell中的while循环实例
1.利用while循环计算1到100的和: 示例代码1: #!/bin/bashi=1sum=0while [ $i -le 100 ]do let sum=sum+$i let i++done echo $sum 示例代码2:利用while循环计算1到100之间所有奇数之和 #!/bin/bash ...
分类:系统相关   时间:2020-04-03 22:07:50    阅读次数:204
473. 火柴拼正方形
1 class Solution 2 { 3 public: 4 bool makesquare(vector<int>& nums) 5 { 6 if(nums.size()<4) return false; 7 int sum=0; 8 for(int i=0;i<nums.size();i++ ...
分类:其他好文   时间:2020-04-03 21:40:51    阅读次数:59
面试题 02.05. 链表求和
https://leetcode cn.com/problems/sum lists lcci/ ...
分类:其他好文   时间:2020-04-03 21:40:31    阅读次数:60
1089 Insert or Merge
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert ...
分类:其他好文   时间:2020-04-03 13:46:45    阅读次数:70
CF438E The Child and Binary Tree——生成函数
题面 CF438E 解析 一开始又把题读错了... 设$g_i=1/0$表示数$i$是否在$c$中出现过,$f_i$表示权值和为$i$的二叉树个数,有下式:$$f_i=\sum_{j=1}^{m}g_j\sum_{k=0}^{i-j}f_k f_{i-j-k}$$ 设$F(x)=\sum_{i=0} ...
分类:其他好文   时间:2020-04-03 13:41:37    阅读次数:61
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!