Skip to content

Instantly share code, notes, and snippets.

View memset0's full-sized avatar
🌴
On winter vacation

Memento mori. memset0

🌴
On winter vacation
View GitHub Profile
@memset0
memset0 / pdf2svgs.py
Created December 3, 2022 13:41 — forked from vitchyr/pdf2svgs.py
Convert PDF to multiple SVGs with Inkscape and pyPdf
"""
Author: Vitchyr Pong
Convert a PDF to svg files. Note that this is pretty slow since it makes
subprocess calls to inkscape's PDF-to-SVG command line convert.
Requirements:
- Inkscape (https://inkscape.org/)
- pyPdf (http://pybrary.net/pyPdf/)
- A '/tmp' directory. If not, you must pass in another directory.
@memset0
memset0 / stylish.css
Created March 15, 2019 15:44
memset0 自用的 stylish 脚本 | 一些自用的对网站样式的小修改 | 代码很不规范啊 QAQ ...
@-moz-document url-prefix("https://memset0.cn/admin/write-post.php") {
/* memset0 博客后台编辑优化(配合 Editor MD 插件使用) */
.resize,
.editormd-toolbar,
.editormd-preview,
.typecho-option-tabs,
.editormd-preview-container,
#advance-panel-btn {
display: none !important;
@memset0
memset0 / LJOJ5214.cpp
Created February 14, 2019 10:13
Naive Codes
// =================================
// author: memset0
// date: 2019.02.14 14:37:16
// website: https://memset0.cn/
// =================================
#include <bits/stdc++.h>
#define ll long long
namespace ringo {
template <class T> inline void read(T &x) {
x = 0; register char c = getchar(); register bool f = 0;
@memset0
memset0 / luogu-block
Created February 8, 2019 02:24
屏蔽洛谷与刷题无关的内容
! 以下为广告过滤规则,请使用广告过滤软件导入一下内容
! 在 uBlock 中实测可用
www.luogu.org##.user-nav > a.color-none.icon-btn:nth-of-type(1)
www.luogu.org##.user-nav > a.color-none.icon-btn:nth-of-type(2)
www.luogu.org###app-sidenav > a.color-none:nth-of-type(5)
www.luogu.org##div.am-g:nth-of-type(4) > .lg-right.lg-index-benben.am-u-md-8.am-u-lg-9 > div.lg-article:nth-of-type(1)
www.luogu.org##.am-hide-sm.lg-article
www.luogu.org##div.am-g:nth-of-type(3) > .lg-right.am-u-md-4.am-u-lg-3 > .lg-article
www.luogu.org##div.am-g:nth-of-type(3) > .lg-right.lg-index-benben.am-u-md-8.am-u-lg-9 > .lg-article
@memset0
memset0 / vscode-user-settings.json
Last active April 4, 2019 12:53
my VSCode config
{
"[cpp]": {},
"files.associations": {
"*.cpp": "cpp"
},
"workbench.iconTheme": "vscode-great-icons",
"materialTheme.fixIconsRunning": false,
"window.zoomLevel": 0,
"editor.fontSize": 15,
"editor.insertSpaces": false,
@memset0
memset0 / LIS.cpp
Created July 18, 2018 03:57
十行写一个nlogn的最长上升子序列
#include <bits/stdc++.h>
int n, x, f[100001];
int main() {
std::memset(f, 63, sizeof(f));
std::scanf("%d", &n);
for (int i = 1; i <= n; i++)
std::scanf("%d", &x), *std::lower_bound(f + 1, f + n + 1, x) = x;
std::printf("%d\n", std::lower_bound(f + 1, f + n + 1, f[0]) - f - 1);
return 0;
}
@memset0
memset0 / get_time_v1.bat
Last active July 13, 2018 12:50
获取两次操作中间相隔了多少时间并做一些简单的转换
@echo off
:loop
set t_before=1%time:~3,2%%time:~6,2%%time:~9,2%
pause
set t_after=1%time:~3,2%%time:~6,2%%time:~9,2%
if %t_before% gtr %t_after% set /a t_after=%t_after%+216000
set /a t_time=%t_after%-%t_before%
set /a t_min=%t_time%/3600
set /a t_sec=(%t_time%-%t_min%*3600)/60
set /a t_mis=%t_time%-%t_min%*3600-%t_sec%*60
@memset0
memset0 / LJOJ3851.cpp
Created July 11, 2018 13:44
my first 300-line code
#include <bits/stdc++.h>
//#define DEBUG 1
#define ll long long
using namespace std;
int read() {
int x = 0; char c = getchar(); bool m = 0;
while (!isdigit(c) && c != '-') c = getchar();
if (c == '-') c = getchar(), m = 1;
while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
if (m) return -x; else return x;