题面: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
本文主要阐述基于 "python镜像" 和mysql镜像,利用docker容器搭建python3的系统环境,并运行简单的python程序 一.Python镜像的构造文件、Python程序代码 :one: python镜像的 ps:由于直接pip速度较慢,这里使用了清华源镜像加速 :two: 记录py ...
分类:
编程语言 时间:
2020-05-19 22:36:01
阅读次数:
1195
JSON (JavaScript Object Notation) is most widely used data format for data interchange on the web. This data interchange can happen between two comput ...
分类:
Web程序 时间:
2020-05-19 00:31:34
阅读次数:
66
题1:两数之和 II - 输入有序数组(Two Sum II - Input array is sorted) Leetcode题号:167 难度:Easy 链接:https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/ 题 ...
分类:
编程语言 时间:
2020-05-18 22:54:30
阅读次数:
72
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 来源:力扣(LeetCode) 一次哈希表遍历法。 class Solution { public: ...
分类:
其他好文 时间:
2020-05-18 20:57:28
阅读次数:
50
1、for/each和for/in 区别:for/each并不是遍历对象的属性,而是遍历属性的值 //遍历对象 let o = {one:1, two:2, three:3} for(let p in o) console.log(p) //'one' , 'two', 'three' for ea ...
分类:
编程语言 时间:
2020-05-18 18:18:17
阅读次数:
81
题意:给一个n*m的矩阵 里面初始是黑白相间的格子,两坐标和为偶数的都是白格子,奇数的为黑格子,现在有次操作,第一次操作时将给定 区域内的格子全部变成白色,第二次操作时将给定区域内的操作全部变为黑格子 问最后的白格子有多少,黑格子有多少 思路:算出总的白格子 然后用总数减去黑格子即可 关键在于 重合 ...
分类:
其他好文 时间:
2020-05-17 19:18:01
阅读次数:
64