Skip to content

Instantly share code, notes, and snippets.

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

牜攵 nevikw39

🉑
🉑抹茶拿鐵 o'_'o
View GitHub Profile
#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 / 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;
@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;
};
810049
810150
810164
810187
810214
810215
810245
810246
810319
810337