Skip to content

Instantly share code, notes, and snippets.

View nevikw39's full-sized avatar
🉑
🉑抹茶拿鐵 o'_'o

牜攵 nevikw39

🉑
🉑抹茶拿鐵 o'_'o
View GitHub Profile
810049
810150
810164
810187
810214
810215
810245
810246
810319
810337
@nevikw39
nevikw39 / 寒訓名稱亂數產生器.py
Created September 28, 2019 07:59
寒訓名稱亂數產生器
#!/usr/local/bin/python3
import random
arr = ['資', '電', '漫', '遊', '網', '路', '漫', '遊', '者', '神', '經', '漫', '遊', '者', '訊', '息', '壁', '壘', '網', '域', '遊', '蕩', '漂', '流', '虛', '擬', '戰', '爭', '虛', '擬', '現', '實', '資', '安', ',', '駭', '客', ',', '網', '域', '漫', '遊', '者', '超', '頻', '駭', '客', '與', '資', '訊', '壁', '壘', '天', '才', '瘋', '子', '大', '字', '典', '家', '都', '市', '擴', '張', '電', '晶', '駭', '入', '滲', '透', '電', '元', '電', '晶', '元', '電', '容', '資', '訊', '安', '全', '駭', '客', '阻', '斷', '服', '務', '攻', '擊', 'D', 'D', 'O', 'S', '記', '憶', '儲', '存', '資', '訊', '洩', '露', '閃', '存', '盜', '夢', '空', '間', '幻', '境', '現', '實', '夢', '境', '電', '資', '幻', '夢', '訪', '生', '人', '不', '會', '夢', '見', '電', '子', '羊', '網', '域', '漫', '遊', '資', '電', '幻', '夢', 'H', 'i', 'g', 'h', ' ', 'T', 'e', 'c', 'h', ' ', 'L', 'o', 'w', ' ', 'L', 'i', 'f', 'e', '這', '個', '是', '總', '召', '想', '的', '一', '堆', '名', '稱', '碎', '片']
while True:
print(random.choice(arr) + random.choice(arr) + random.choice(arr) + random.choice(arr))
input()
@nevikw39
nevikw39 / g_d005.cpp
Created January 28, 2020 09:36
GreenJudge d005: 99年台中區第五題
#include <iostream>
#include <sstream>
#include <stack>
// #pragma GCC optimize("O3")
using namespace std;
struct node
{
int n;
node *l, *r;
};
@nevikw39
nevikw39 / konsole-ptt-paste.sh
Created April 18, 2020 06:00
以模擬方式將剪貼內容逐字輸入至 konsole 視窗,藉以獲得 p 幣。
#!/usr/bin/zsh
zmodload -i zsh/mathfunc
for pid in $(pgrep konsole); do
for window in $(xdotool search --pid $pid); do
if [[ "$(xdotool getwindowname $window)" =~ "ptt" ]]; then
xdotool type --window $window --delay $(( 666 + 1334 * rand48() )) $(xclip -o -selection clipboard);
fi
done;
done;
#include <bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
int main()
{
char c;
list<char> l;
auto itr = l.begin();
while ((c = getchar()) != EOF)
@nevikw39
nevikw39 / 1253.cpp
Created January 28, 2021 02:57
TIOJ 1253
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
vector<int> g[1001];
bool v[1001];
int m[1001];
bool dfs(int x)
{
for (const int &i : g[x])
@nevikw39
nevikw39 / seg_tree_node.cpp
Last active June 9, 2021 11:24
Segment Tree Node w/o build function
struct node
{
T val, tag_update, tag_modify;
bool modified;
node *nl, *nr;
node()
{
val = tag_update = modified = 0;
nl = nr = nullptr;
}
@nevikw39
nevikw39 / ptt_ip.md
Last active October 21, 2022 08:34
ptt IP

ptt IP

Detect whether an IP address on ptt belong to VPN or proxy networks

一款 userscript, 令您只要雙擊選取 pttIP 便可即時取得相關資訊.

適用於 www.ptt.cc, term.ptt.cc.

安裝步驟

@nevikw39
nevikw39 / mathjax.txt
Last active July 3, 2022 16:22
Polyfill to support LaTeX on NTHU OJ. Insert this to the source.
<style>
@font-face {
font-family: "MJXTEX";
src: url(data:application/octet-stream;base64,d09GRk9UVE8AAIVwAAsAAAAAuhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAe4MAAKkD+UhnsEZGVE0AAHyMAAAAHAAAABxdKvr2R0RFRgAAfKgAAAAfAAAAIAFQAARPUy8yAAB8yAAAAFIAAABgQXBY2GNtYXAAAH0cAAAC0AAABEpuir4+aGVhZAAAf+wAAAAzAAAANg5mmLloaGVhAACAIAAAACEAAAAkBK0IB2htdHgAAIBEAAACUwAABIzBgCUabWF4cAAAgpgAAAAGAAAABgEjUABuYW1lAACCoAAAAroAAAZdqQQjYHBvc3QAAIVcAAAAEwAAACD/hgAyeJy8vAd8W0X2L65rW9KQgIEIhW4DAQKhpVMCpAcCpJKeOIl770Vusnq599x71WW5996tNKdCCqGTLBBa2IRddmGBQCCBkblmf2+ulEB22d237/3f52/ZHumWmTNnzjnf75mZK0oSESGhKEq5LLYg5bnY4m3LYlOzHlqdmFyYEZsnocIklOTRwHWSwDEq8EpY4Hh44NWIXxRC623y8T/fJL1dIpHffi35L5FcR/5fFXe9+P4h8q/hxgmSfvFmJLlWMlFyu+RuyUOS2ZKnJEskyyRrJJslcZJUSY5EJamQGCRWCSdxSTySSkmtpEXSLumS9Et2SvZLjkhel5yUfCg5I/mL5BvJBYlARVDXUjdSt1H3UA9Ss6m51LPUKmoDtY1KojKpAqqM0lM0ZacqqXqqjRqi9lGvUu9RZ6kvqPOUECYLiwybGHZ72OSwR8Jmhz0VtihsZdj6sK1hiWG5YSVhFWGmMDbMG9YQ1hM2GLYn7FDYK2FvhZ0K+yzsy7DvwnB4WPj48BvDo8LvCX8wfEb43PBl4RvDk8OzwgvDy8MN4Uy4O7wmvCt8MHx3+MHwY+Fvh
@nevikw39
nevikw39 / match.py
Created July 3, 2022 16:14
Perform a `match` based on the measure adopted by the Div. of Curriculum, NTHU to assign the students to GE & PE courses.
import random
from typing import List
class Member:
def __init__(self, s: str, lst: List[int]) -> None:
self.s = s
self.lst = lst
self.n = 0