A personal algorithm study backup repository
Just hope my answers of quetions be helpful to others who suffering from problem solving. That's all.
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.
Initially committed files might not have comments.
I'll leave a comment for variables or methods, from now.
#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);
;
}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};for (int y = 0; y < Y; y++) {
for (int x = 0; x < X; x++) {
cout << (board[y][x] ? "■" : "·") << " ";
}
cout << "\n";
}