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
let lines = require("fs").readFileSync("/dev/stdin", "utf8").split`\n`; | |
const [N, K] = lines[0].split` `.map(Number); | |
const A = lines[1].split` `.map(Number); | |
if (K === 1) { | |
console.log(1); | |
return; | |
} | |
const log2ceil = Math.ceil(Math.log2(K)); |
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
let lines = require("fs").readFileSync("/dev/stdin", "utf8").split("\n"); | |
const [H, W, N, M] = lines[0].split` `.map(Number); | |
const S = lines.slice(1, H+1).map(v => v.split``); | |
const MOVES = lines.slice(H+1, H+M+1).map(v => v.split` `.map(Number)); | |
const HOLE = "#"; | |
const DS = [[-1, -1], [-1, 0], [-1, 1], [0, 1], [1, 1], [1, 0], [1, -1], [0, -1]]; | |
const raycast = (y, x, dy, dx) => { | |
let result = []; |
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
// 7ビット固定 crypto | |
crypto.randomUUID().replace(/-/g,"") | |
// Math.randomでの最短コード? | |
(f=n=>n--?Math.random().toString(16)[2]+f(n):"")(32) |
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
div>div:has(a[href="/zhcsqsha"])~div:nth-last-child(1)>div>div[aria-label][role=group][id] { | |
display: none !important; | |
} |
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 | |
import sys | |
import msvcrt | |
from itertools import product, repeat | |
from concurrent.futures import ProcessPoolExecutor | |
from tqdm import tqdm | |
RESET = '\x1b[0m'; | |
REVERSE = '\x1b[7m'; | |
LIGHT = '#'; |
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
from itertools import permutations, combinations | |
def find_combinations(A, B): | |
if len(A) == 0: | |
return [] | |
a = A[0] | |
for b1, b2 in permutations(B, 2): | |
temp_B = B.copy() | |
if b1 + b2 == a: | |
x = f"{b1} + {b2} = {a}" |
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
class PegSolitaire: | |
def __init__(self, board): | |
self.board = board | |
self.height = len(board) | |
self.width = len(board[0]) | |
self.moves = [] | |
def is_valid_move(self, x, y, dx, dy): | |
if (0 <= x+2*dx < self.height and 0 <= y+2*dy < self.width and | |
self.board[x][y] == 'o' and |
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
for /f "tokens=3" %%i in ('pnputil /enum-devices /connected /class USB /problem 43^|find "インスタンス ID"') do pnputil /restart-device "%%i" |
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
// ==UserScript== | |
// @name Add 2game.info link to Nexusmods | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-01-24 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.nexusmods.com/skyrim/mods/* | |
// @match https://www.nexusmods.com/skyrimspecialedition/mods/* | |
// @match https://www.nexusmods.com/cyberpunk2077/mods/* | |
// @match https://www.nexusmods.com/fallout4/mods/* |
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
const INTEGRANTS = [{"name":"Abecean Longfin","effects":["Fortify Restoration","Fortify Sneak","Weakness to Frost","Weakness to Poison"]},{"name":"Bear Claws","effects":["Damage Magicka Regen","Fortify Health","Fortify One-handed","Restore Stamina"]},{"name":"Bee","effects":["Ravage Stamina","Regenerate Stamina","Restore Stamina","Weakness to Shock"]},{"name":"Beehive Husk","effects":["Fortify Destruction","Fortify Light Armor","Fortify Sneak","Resist Poison"]},{"name":"Bleeding Crown","effects":["Fortify Block","Resist Magic","Weakness to Fire","Weakness to Poison"]},{"name":"Blisterwort","effects":["Damage Stamina","Fortify Smithing","Frenzy","Restore Health"]},{"name":"Blue Butterfly Wing","effects":["Damage Magicka Regen","Damage Stamina","Fortify Conjuration","Fortify Enchanting"]},{"name":"Blue Dartwing","effects":["Fear","Fortify Pickpocket","Resist Shock","Restore Health"]},{"name":"Blue Mountain Flower","effects":["Damage Magicka Regen","Fortify Conjuration","Fortify Health","Restore Health"]},{"name |