Sword finger: the stack containing min function (min stack)

Title Description Design a stack that supports push, pop, top and other operations and can retrieve the minimum elements in O(1) time. push(x) - insert element x into the stack pop() - remove top element top() - get the top element of the stack getMin() - get the smallest element in the stack Example MinStack minStack = new MinStack( ...

Posted by nalleyp23 on Fri, 25 Oct 2019 13:13:25 -0700

Dynamic planning HDU-1024

http://acm.hdu.edu.cn/showproblem.php?pid=1024 Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given a consecutive number sequence S 1, S 2, S 3, S 4 ... S x, ... S n (1 ≤ x ≤ n ≤ 1,000,000, -3 ...

Posted by yacaph on Fri, 25 Oct 2019 12:42:27 -0700

Educational codes round 68 (rated for Div. 2) d. 1-2-k game

D. 1-2-K Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Alice and Bob play a game. There is a paper strip which is divided into n + 1 cells numbered from left to right starting from 0. There is a chip placed in the n-th cell (the last one). Players take turns, Alice is first. Each ...

Posted by dekeb55 on Fri, 25 Oct 2019 10:47:36 -0700

vue print canvas display blank

Recently, I have been printing reports in vue + elemnet, and then there is a demand to print the charts directly. After downloading the printing plug-in, I found that the chart part of the charts on the printing page is blank. After careful inspection, I found that the plug-in does not support printing canvas. Later, I found the following js on ...

Posted by darkwolf on Fri, 25 Oct 2019 10:47:05 -0700

Color space conversion, simple color tracking and channel separation and combination of pictures

Color space conversion of a picture Gray color space Single channel, value range [0255] 0 black 255 white RGB color space (BGR is used in opencv) The range of R, G and B channels in opencv is [0255].   HSV/HSL color space      H: 0-180  S: 0-255 V: 0-255 HSV is a representation of points in RGB color space in an inverted cone ...

Posted by raven2009 on Fri, 25 Oct 2019 10:05:19 -0700

Noodle cart

1. noodle cart 1. Print out the goods in cycle first 2. The user inputs the number to select the product (judge whether it is a number and whether the number is within the range) 3 take out the commodity name and price 4. Judge whether the user balance is greater than the commodity price 5. If the balance is greater th ...

Posted by endlyss on Fri, 25 Oct 2019 09:11:35 -0700

php + js to realize convenient score entry function

In the recent "micro classroom" project, there is a need for teachers to enter students' scores. In order to make the function of entering scores more convenient, js is adopted. Now I'll share it with you. Effect The first thing we need to do before we start to write ideas is to know what we want to achieve. Let's take a look at the ...

Posted by srhino on Fri, 25 Oct 2019 07:06:43 -0700

[NOI2019] home route

LOJ3156 Don't put in the question, put in the data range. Seeing \ (n < = 2000, m < = 4000 \) and thinking of direct \ (dfs \) in the end, I actually passed the first \ (4 \) sample and the last \ (2s \). Later, I wrote \ (5 \) score of \ (A=B=0 \), and I knew whether it was wrong or handed in the following code. (LOJ data should be offi ...

Posted by Roo on Wed, 23 Oct 2019 15:26:29 -0700

Python Django implements simple registration function

  For project creation strategy, please refer to the introduction of previous documents. The directory structure is as follows   Edit views.py from django.shortcuts import render # Create your views here. from django.http import HttpResponse from django.shortcuts import render from common.DBHandle import DataBaseHandle import ...

Posted by ixalmida on Wed, 23 Oct 2019 14:32:39 -0700

editor.md: drag, cut, copy, paste, upload pictures, file plug-ins

editor.md is a Markdown editor with beautiful interface and powerful functions. But there is a lack of cutting and dragging upload in the aspect of image and file upload. There are so many shortcomings in each aspect. Here is a simple implementation. There is not much nonsense, just code directly. uploadImg.js function initPasteDragImg(Editor){ ...

Posted by busnut on Wed, 23 Oct 2019 10:55:38 -0700