Skip to content

Instantly share code, notes, and snippets.

@Yangff
Yangff / trainJIT.cpp
Last active December 20, 2015 00:19
NOI2013 Day1 T3 JIT
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <map>
#include <cctype>
#ifdef _WIN32
#include <Windows.h>
#endif
using namespace std;
@Yangff
Yangff / Set.coffee
Last active December 24, 2015 23:39
A javascript multiset with O(logN) insert , delete and Query.
class Set
constructor :(array=[])->
@ary = array
@pos = {}
for value,key in @ary
if @pos.hasOwnProperty value
@pos[value].push key
else
@pos[value] = [key]
@Yangff
Yangff / 2105.cpp
Created December 17, 2013 07:51
BZOJ2105(TLE)
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <ext/rope>
#include <cstring>
using namespace std;
using namespace __gnu_cxx;
char buff0[111111],buff1[111111];
bool check(rope<char> &str, int x,int y, int i){
#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){};
@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
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
Version 5.1.2 Based on the Byte Magazine Unix Benchmark
Multi-CPU version Version 5 revisions by Ian Smith,
@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;
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 / 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));

#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("");