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
import re | |
import requests | |
from Crypto.Cipher import AES | |
user_agent = 'Mozilla/5.0 AppleWebKit/537.36 Chrome/102.0.4972.0 Safari/537.36' | |
home_page = 'https://codeforces.com' | |
def init_session(s): | |
s.headers.update({'User-Agent': user_agent}) | |
r = s.get(home_page) |
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
splitlines2 =: (LF, LF) & strsplit | |
splitlines =: LF & cut | |
parsemany =: ". each | |
part1 =: >./ @: > @: ((+/ @: > @: parsemany @: splitlines) each) @: splitlines2 | |
ans1 =: part1 readaoc 1 | |
part2 =: +/ @: (3 & {.) @: \:~ @: > @: ((+/ @: > @: parsemany @: splitlines) each) @: splitlines2 | |
ans2 =: part2 readaoc 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
countIncrease :: [Int] -> Int | |
countIncrease xs = length $ filter (uncurry (<)) $ zip xs (tail xs) | |
main :: IO () | |
main = print . countIncrease . map read . lines =<< getContents |
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
{-# LANGUAGE FlexibleContexts, QuantifiedConstraints, ScopedTypeVariables, TupleSections #-} | |
import Control.Monad | |
import Control.Monad.ST | |
import Data.Array.Base | |
import Data.Array.ST | |
import Criterion.Main | |
import Data.Foldable | |
import qualified Data.IntMap.Strict as IM | |
import qualified Data.List as L | |
import qualified Data.Map.Strict as M |
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
// ==UserScript== | |
// @name NoG4G | |
// @namespace https://github.com/meooow25 | |
// @match *://www.google.com/search* | |
// @grant none | |
// @version 0.3 | |
// @author meooow | |
// @description Removes G4G from Google search results | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name CF Linemaster | |
// @namespace https://github.com/meooow25 | |
// @match *://*.codeforces.com/* | |
// @grant GM.setClipboard | |
// @version 0.9 | |
// @author meooow | |
// @description Adds supports for line highlighting and copying on Codeforces | |
// @downloadURL https://gist.github.com/meooow25/8c91d4b111057f225c1d66e46cf00de2/raw/cf-linemaster.user.js | |
// ==/UserScript== |
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
document.body.textContent.trim().split('\n').map(x => Number(x)) | |
.flatMap((x, i, a) => a.flatMap((y, j) => i < j && x + y === 2020 ? [x * y] : [])) |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta name="X-Csrf-Token" content="29a92b8221e77eed6b9ccc6291788d75"/> | |
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=0.01"/> | |
<script type="text/javascript" src="//sta.codeforces.com/s/81126/js/jquery-1.8.3.js"></script> | |
<script type="application/javascript"> | |
window.standaloneContest = false; |
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
import argparse | |
import json | |
import urllib.request | |
from matplotlib import pyplot as plt | |
STATUS_URL_FMT = 'https://codeforces.com/api/user.status?handle={}' | |
CONTESTS_URL = 'https://codeforces.com/api/contest.list' | |
DEFAULT_LO, DEFAULT_HI = 500, 3800 | |
STEP = 100 | |
FIGSIZE = (12, 6) |
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
""" | |
Checks if a password is pwned using the https://haveibeenpwned.com/ API | |
Usage: python passcheck.py password | |
""" | |
import argparse | |
import hashlib | |
import urllib.request | |
URL = 'https://api.pwnedpasswords.com/range/' |
NewerOlder