Skip to content

Instantly share code, notes, and snippets.

@Yangff
Yangff / clicker.cpp
Created January 19, 2016 12:07
click..
#include <cstdio>
#include <windows.h>
int main(){
for (;;){
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(40);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Sleep(30);
}
// g++ aa.cpp -o aa.exe -std=c++14
#include <cstdio>
#include <functional>
#include <tuple>
using namespace std;
template<int n, class Iso, class TRet, class... TArgs>
struct _bindArgs;
@Yangff
Yangff / strong.rb
Last active January 25, 2016 10:15
strong type system for ruby
class Symbol
def [](*args)
a = [self, args, '[]']
a.instance_eval('@_type_flag = \'[]\'')
a
end
def <<(*ary)
a = [self, ary.flatten, '<']
a.instance_eval('@_type_flag = \'<\'')
a
#include <cstdio>
int main(){
freopen("B.in", "w", stdout);
printf("5\n");
for (int i = 0; i < 5; i++){
printf("100000\n");
for (int j = 2; j <= 100000; j++)
printf("%d ", j - 1);
puts("");
@Yangff
Yangff / acac.md
Last active August 29, 2015 13:57

关于马甲

http://www.acfun.tv/aaa 这会是一个404页面,然后在地址栏输入:

注意直接复制到地址栏的话javascript:在chrome上会被吃掉,请手打javascript:然后复制后面的内容><

javascript:var x = JSON.parse(localStorage.getItem("av.y_acex")).majialst; for (var i in x) alert(i); 就可以获得马甲的用户名了,如果要密码一起的话就输入: javascript:alert(JSON.stringify(JSON.parse(localStorage.getItem("av.y_acex")).majialst));

static int sandbox_main(Sandbox::SandboxSettings *args){
// Set Limit
#define ERROR {}
#define SetRLimit(name, lmt) {rlimit limit; limit.rlim_cur = limit.rlim_max = (lmt); setrlimit(name, &limit);}
if (args->doTimeLimit){
SetRLimit(RLIMIT_CPU, (args->TimeLimit/1000) + 1); // some function will not take cpu time!
} else
SetRLimit(RLIMIT_CPU, (Sandbox::MaxRuningTime/1000) + 1);
if (args->doStackLimit)
SetRLimit(RLIMIT_STACK, args->StackLimit);
@Yangff
Yangff / Treap.cpp
Created January 6, 2014 07:03
Treap...
#include <cstdio>
#include <algorithm>
#include <ctime>
#include <cstdlib>
using namespace std;
struct node{
int val, key, size;
node* ch[2], *p;
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
Version 5.1.2 Based on the Byte Magazine Unix Benchmark
Multi-CPU version Version 5 revisions by Ian Smith,
@Yangff
Yangff / G.in
Created December 27, 2013 09:14
where is wrong..
3 3
0 0 10
1 0 8
2 0 9
0 2 10
1 2 10
2 2 10
0 3 9
1 3 9
2 5 11
#include <cstdio>
#include <cstdlib>
#include <set>
#include <algorithm>
using namespace std;
struct pii{
int x, y;
pii(int x = 0, int y = 0):x(x), y(y){};