Tag:lattice

  • Algorithm interview question: how many 7 are there between 1 and 1000?

    Time:2021-8-25

    I saw a very interesting interview question these two days: the examiner directly asked, 1 to 1000 to how many 7? Requirements, no programming, give the answer directly, and give a simple idea.   C / C + + Learning skirt [712]   two eight four   seven zero five  】, Whether you are Xiaobai […]

  • [recursion and recursion] n queen problem, prime ring

    Time:2021-8-24

    n-queens problem N queens are placed on the n * n checkerboard so that they do not attack each other (that is, any two queens are not allowed to be in the same row, the same column, or on the slash at a 45 angle with the checkerboard border).Your task is to find out how […]

  • 521. Spend one night writing maze games for the goddess

    Time:2021-7-30

    Although I have written about going through the maze before, many people reported that they would not deploy the code without finding it and did not understand the principle. This time, I wrote the optimization in more detail and put the code in GitHub. I can put some pictures to the goddess while 520521! cause […]

  • [unity] understanding of ThreadGroup and numthreads in computeshader

    Time:2021-7-30

    Today, I encountered a magical phenomenon. I set up a100 * 100Then use computeshader to fill it with some colors, but the result has a black edge. The code is as follows: _renderTexture = new RenderTexture(100, 100, 24); _renderTexture.enableRandomWrite = true; _renderTexture.Create(); shader.Dispatch(0, _renderTexture.width / 8, _renderTexture.height / 8, 1); [numthreads(8,8,1)] void CSMain (uint3 id […]

  • How to gracefully fill GitHub’s green contributions – autocommit

    Time:2021-2-24

    autoCommit A vscode plug-in for git automatic commit, which can be used to supplement the previously forgotten commit and help you fill the green grid of the home page. Application effect Use this plug-in to control the commit times As shown in the figure below, you can even plan itcommitNumber of times, and then draw […]

  • [caption] life game – leetcode

    Time:2021-2-16

    Title: Life Game According to Baidu Encyclopedia, life game, referred to as life, is a cellular automata invented by British mathematician John Houghton Conway in 1970. Given a panel containing m × n lattices, each lattice can be regarded as a cell. Each cell has an initial state: 1 is live cell, or 0 is […]

  • Leetcode points to offer 47

    Time:2021-1-31

    Title Requirements: Thinking: Create a two-dimensional array to save the maximum value of the gift that each grid can get Traverse the array to get that the maximum value of the current gift is the maximum value of the two of the gifts (the previous or the left) plus the value of the current gift, […]

  • Leetcode 63. Different paths II | Python

    Time:2021-1-22

    63. Different routes II Title Source: leetcode https://leetcode-cn.com/problems/unique-paths-ii subject A robot is located in the upper left corner of an M x n grid (the starting point is marked as “start” in the figure below). The robot can only move down or to the right one step at a time. The robot tries to reach […]

  • Description of Tkinter (01) basic options

    Time:2021-1-6

    Tkinter is Python’s own GUI library, which is based on componentsWidgetTherefore, this paper first introduces some basic content, and then explains the use of each component Note: the Tkinter content here is for reference at present8.5The author’s current Python installation version is3.8.3With tkversion / tclversion:8.6, the platform isWIN 10. The parameter options of grid () […]

  • Will the result of LINQ query open up new memory?

    Time:2021-1-3

    1: Background 1. Tell a story Yesterday, a friend in the group asked: will the result of LINQ query open up new memory? If yes, is it a deep copy of the elements in the original sequence set or just a copy of their references? In fact, I think this question is very good. Many […]

  • Leetcode 994. Implementation of rotten orange in Python

    Time:2021-1-2

    Title Requirements: Thinking: Maintain a cur to save the current rotten orange Traverse the given array. If it is a rotten orange, append the abscissa and ordinate to the cur array Define a time to save the time Use the while loop to traverse cur. When there are still elements in cur, continue the loop. […]

  • Tkinter (46) layout geometry Manager

    Time:2020-12-11

    Layout geometry managers are divided into three categories Pack the parts according to the orientation and roughly Grid parts are placed in the form of tables and divided into grids Place the parts according to the coordinate position and place them accurately Note: the same container, pack and grid can not be mixed, which will […]