链接:https://leetcode-cn.com/problems/add-two-numbers/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * L ...
分类:
其他好文 时间:
2020-05-25 00:15:00
阅读次数:
65
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:
其他好文 时间:
2020-05-24 11:27:13
阅读次数:
52
Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval li ...
分类:
其他好文 时间:
2020-05-24 09:40:12
阅读次数:
58
数组指针和指针数组 一、概念 数组指针就是指针,是指向数组的指针,a pointer to an array,首先它是一个指针,它指向一个数组,在32 位系统下永远是占4 个字节。 指针数组就是数组,是个保存指针的数组,array of pointers,即用于存储指针的数组,也就是数组元素都是指针 ...
分类:
编程语言 时间:
2020-05-23 20:26:08
阅读次数:
69
博客转自:http://www.lighthouse3d.com/tutorials/glut-tutorial/subwindow-reshape/ The callback for the reshape function needs to do two things: it resizes t ...
分类:
其他好文 时间:
2020-05-23 18:30:51
阅读次数:
61
#include<bits/stdc++.h>#define ll long longusing namespace std;/*题意:A和B两人分n个糖,每人最少一个,且A分得的数量要大于B,只要分奇偶情况输出就行*/int main(){ ll t,n; cin>>t; for(int i=0; ...
分类:
其他好文 时间:
2020-05-23 13:09:20
阅读次数:
51
题面:https://vjudge.net/problem/CodeForces-1288C 这道题其实比较难想,据说题解一种方法是组合方法(然而我不会),我来总结总结dp的方法吧。 首先我们采用一个dp数组,dp[i][j][k]:在生成的a,b字符串中,第k个的数字分别是i,j,在满足这种情况下 ...
分类:
其他好文 时间:
2020-05-21 16:36:28
阅读次数:
53
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the ...
分类:
其他好文 时间:
2020-05-21 10:33:22
阅读次数:
54
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu ...
分类:
其他好文 时间:
2020-05-20 12:40:43
阅读次数:
58
I have two components. I want to call a method of the first component from the second component. How can I do it? Here is my code. First Component cla ...
分类:
Web程序 时间:
2020-05-20 10:49:28
阅读次数:
143