This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Solution: | |
- Backtracking: O(1) time, O(1) space | |
*/ | |
func solveSudoku(board [][]byte) { | |
columns := initColumns(board) | |
rows := initRows(board) | |
squares := initSquares(board) | |
backtrack(board, columns, rows, squares, 0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### GIT ### | |
# Frequently used | |
git config --global alias.co checkout | |
git config --global alias.st status | |
git config --global alias.re reset | |
# Not frequently used | |
git config --global alias.ci commit | |
git config --global alias.br branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
const int MAX_AMOUNT = 100000; | |
const int NOT_LEAF = -1; | |
pair<int, int> segment_tree[4 * MAX_AMOUNT]; | |
int current_index = 1; // Этой контсантой даем листьям номера |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "SerialNumber", | |
"value": "477", | |
"related": { | |
"name": "type", | |
"value": "control", | |
"related": { | |
"name": "requiredAccessLevel", | |
"value": "4", | |
"related": {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
// region Debug | |
// Если верен - на каждой итерации выводится не только её результат, но ещё и состояния всех бинов | |
bool debug = true; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <malloc.h> | |
#include "main.h" | |
bmpHeader header_plug; | |
bmpHeader header; | |
image_t image; | |
int condition = 0; | |
int main(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <malloc.h> | |
#include "main.h" | |
bmpHeader header_plug; | |
bmpHeader header; | |
image_t image; | |
int condition = 0; | |
int main(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t width = image.height; | |
size_t height = image.width3; | |
char** pixels = (char**) calloc(height, sizeof(char*)); | |
for (int i = 0; i < width; i ++) { | |
pixels[i] = (char*) calloc(width, sizeof(char)); | |
} | |
for (int i = 0; i < height; i++) { | |
for (int j = 0; j < width; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int height = 10; | |
int width = 5; | |
int** double_array = new int*[height]; | |
for (int i = 0; i < height; i++) { | |
double_array[i] = new int[width]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spam test |
NewerOlder