Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Input: A = [4,5,0,-2,- ...
分类:
其他好文 时间:
2020-05-28 00:53:15
阅读次数:
54
package LeetCode_496 /** * 496. Next Greater Element I * https://leetcode.com/problems/next-greater-element-i/description/ * * You are given two array ...
分类:
其他好文 时间:
2020-05-26 22:09:23
阅读次数:
112
链接: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
博客转自: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
博客转自:http://www.lighthouse3d.com/tutorials/glut-tutorial/subwindows/ 创建和销毁子窗口 With GLUT we can define subwindows, i.e. divide the main window in diffe ...
分类:
其他好文 时间:
2020-05-23 18:29:11
阅读次数:
54
#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
Description Given an array A of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by K. Example 1: Note: 1 思路 ...
分类:
编程语言 时间:
2020-05-22 12:29:23
阅读次数:
47
题面:https://vjudge.net/problem/CodeForces-1288C 这道题其实比较难想,据说题解一种方法是组合方法(然而我不会),我来总结总结dp的方法吧。 首先我们采用一个dp数组,dp[i][j][k]:在生成的a,b字符串中,第k个的数字分别是i,j,在满足这种情况下 ...
分类:
其他好文 时间:
2020-05-21 16:36:28
阅读次数:
53