This file contains hidden or 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
import numpy as np | |
import timeit | |
from collections import deque | |
NUMBER_OF_MINES = 10 ** 5 | |
# Keep this low to prevent RuntimeError: maximum recursion depth exceeded | |
# (we can increase recursion depth, but it's ok also to avoid it just for the test) | |
MAX_BLAST_RADIUS = 200 | |
MAX_COORDINATE_XY = 700000 |
This file contains hidden or 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
import os.path | |
def within_blast_radius(x1, y1, blast_radius, x2, y2): | |
# Note that this counts points on the edge of the radius which is incorrect | |
# Proper way would be to exclude them as they are not in the radius (replace <= with <) | |
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) <= (blast_radius ** 2) | |
def explode_mine(mines, mine, exploded): | |
"""Recursive explosion calculation |
This file contains hidden or 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
"use strict"; | |
var vscode = require("vscode"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var helpers = require("../helpers"); | |
var moment = require("moment"); | |
/** | |
* Main command to create a file from a template. | |
* This command can be invoked by the Command Palette or in a folder context menu on the explorer view. | |
* @export |
This file contains hidden or 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
# | |
# Automatically generated make config: don't edit | |
# Linux/arm 3.0.36 Kernel Configuration | |
# | |
CONFIG_ARM=y |