题目如下: 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
求和变量思想: 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
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
首先我们正着对每一个 $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
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
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
https://leetcode cn.com/problems/sum lists lcci/ ...
分类:
其他好文 时间:
2020-04-03 21:40:31
阅读次数:
60
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 解析 一开始又把题读错了... 设$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