Skip to content

ForestHouse2316/DoYouKnowRithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

DoYouKnowRithm

A personal algorithm study backup repository

Why public?

Just hope my answers of quetions be helpful to others who suffering from problem solving. That's all.

What language

I used Python, but because of the Python's running speed limitation, now I'm using C++.
So I'll use Python only for some string problems.

Comment style

Initially committed files might not have comments.
I'll leave a comment for variables or methods, from now.

Base Code

C++

Init

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define a first
#define b second
typedef pair<int, int> pii;


int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    ;
}

BFS & 2D Diffusion Mask

Rotation : CW

queue<pii> q;
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
// Diagonal
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy[] = {1, 1, 0, -1, -1, -1, 0, 1};

Plane Visulaizer

for (int y = 0; y < Y; y++) {
    for (int x = 0; x < X; x++) {
        cout << (board[y][x] ? "" : "·") << " ";
    }
    cout << "\n";
}

Learning

Basics

Additional

Just link...

About

A personal algorithm study backup repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published