Skip to content

Instantly share code, notes, and snippets.

View tarawa's full-sized avatar
🏠
Working from home

Jiaqi Yang tarawa

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tarawa on github.
  • I am qj (https://keybase.io/qj) on keybase.
  • I have a public key ASBAKzZl3M5_EPNFytzNj7e3C5Q-B-FSNwA2OzdGqEWvcQo

To claim this, I am signing this object:

@tarawa
tarawa / sol.txt
Last active August 29, 2015 13:57
sol
f(0)=0
f(1)=1/3+(2a+1)/2+(a^2+a)
=a^2+2a+5/6
f(a)=a^3/3-(2a+1)a^2/2+(a^2+a)a
=a^3/3+a^2/2, a =[0,1]
f'(a)=a^2+a, max : a=1, maxval=5/6
f(a+1) = (a+1)^3/3-1/2(2a+1)(a+1)^2+(a^2+a)(a+1)
@tarawa
tarawa / 1000.asm
Created August 28, 2013 06:34
Test
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.20617.1
TITLE C:\cygwin64\home\twilight\1000.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
@tarawa
tarawa / p1059.vijos.c
Created July 22, 2013 03:33
Vijos 1059 (C)
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#define maxn 110
#define sqrmaxn 12100
int n;
bool f[maxn][sqrmaxn];
@tarawa
tarawa / buylow.pas
Created July 20, 2013 11:35
POJ1952 (Pascal)
const
maxn=5000;
var
n,i,j:longint;
a,f,g,next:array [0..maxn+10] of int64;
function max(p,q:int64):int64;
begin
if p>q then exit(p) else exit(q);
@tarawa
tarawa / poj3264.2.cpp
Created July 19, 2013 02:33
POJ3264 (Segment Tree, C++)
#include <cstdio>
using namespace std;
#ifndef maxn
#define maxn 50010
#endif
struct Segment {
int left,right,value;
@tarawa
tarawa / SparseTable.h
Created July 18, 2013 01:30
SparseTable Class (C++)
#include <cstdio>
using namespace std;
#ifndef maxn
#define maxn 150000 //default maxn=150000
#endif
class SparseTable {
private:
@tarawa
tarawa / poj3264.cpp
Created July 18, 2013 01:20
POJ3264 (C++)
#include <cstdio>
#include <cmath>
using namespace std;
//#define DEBUG
#ifndef maxn
#define maxn 150000
#endif
@tarawa
tarawa / tyvj1661_bit.pas
Created July 10, 2013 08:36
TYVJ1661 (树状数组、Pascal)
const
maxn=100000;
var
f:array [0..maxn] of int64;
n,k,l,r,i:longint;
order:char;
tmp,x:int64;
function lowbit(x:longint):longint;
@tarawa
tarawa / tyvj1659.pas
Last active December 19, 2015 10:18
TYVJ1659 (Pascal)
type
edge=record
src,dest,v:longint;
end;
var
a:array [0..100010] of edge;
b,f:array [0..10000] of longint;
ans,min,i,g,n,m:longint;