Skip to content

Instantly share code, notes, and snippets.

View tice0-2's full-sized avatar

tice0-2

View GitHub Profile
@tice0-2
tice0-2 / SEERC-2017-J.md
Created October 28, 2018 23:58
Cases for SEERC 2017, J

Cases

Case 1, all piles are 1

take n % 3, if 0 then A loses

Case 2, only one pile > 1

A always wins

Case 3, no less than two piles > 1

@tice0-2
tice0-2 / SEERC-dc.md
Created October 29, 2018 03:45
SEERC Divide and Conquer

first conclusion: no more than 3 edges are removed

Proof: by contra, assume otherwise, implying every degree of node >= 4; then there exists >= 2n edges in the graph. Because this graph is composed of 2 trees, then only 2n - 2 edges. Contradiction.

Then if we have the # of edges to remove as 2 <= e <= 3, we can reach the conclusion that both edges from A and edges from B are removed. Then if e == 2, it must be true that one A edge is removed, one B edge is removed. If e == 3, then either A or B must only have one edge removed.

By that, observe that if we treat one tree (WLOG Tree A with only 1 edge removed) as our main tree, it is equivalent to slice this tree

class Dice
def [](value)
raise 'unimplemented'
end
def apply(value = nil)
self[value].floor
end
class << self
var i, j, field;
var cols = parseInt($('#col').val());
var rows = parseInt($('#row').val());
for (i = 0; i < rows; i ++) {
$('<div class=row></div>').appendTo('.board');
for (j = 0; j < cols; j ++) {
field = $('<div class="field hidden"></div>').appendTo('.row');
}
}
@tice0-2
tice0-2 / in1.java
Created January 28, 2019 05:31
MiniJava Test Programs
class zvMUuWgUwcPqPSN4{public static int zzw67ItW7UvaCX2rr7VypMD;public static bool gaX9B0oWiLrIIsMb0F6rMeVVmn (kgyYizUFr2tUdmeA7B[] jhEvawFYKd_,int[] lIGM_x1pzhvotutfTD_oZQ,bEY0kqPTq6ElsS001bDSDFmF8gsZi fv9l8dYMbihcFSM,m2R[] e_N8F5wi6bG,vJNT80OoZ3wWlTHxY66AEqX6iOVYgbp[] hpkNYB7VEEFPKzQSC97meOAY,int[] iVAFJZ,bool rckq5uB7cvAvL8K,pN1tYK3o3KaN1CB8r_[] jM7MliI6YeMKnQ2,px5ZS8AgTSzTQ3fVCbs7[] gkXYlW4R,int heBxHrw5HkSspvUs,gS3sd569ehshX nMvnvA,qs5GfUwXPERVrvGt8Ae3lvrLPq1w[] i1BPENkVNkO53gOMzNT8snQ,kF48GNc z28_ned,int gElkYNbH8QbgtaCLT52wFK,hdLpbVdZx9HxGQmLNmEx7DCpL8vUgM[] iE3R9cBjL3Bzvci_4mebi0,mk8LtM9vAoNWYR0vcDEGK5[] a_nkWoweJxnucIuzjLR4,p48qaEUZnimP4QlHZSDOKiAAJ3HbdDL[] zAOE0_u,bool yjNGuuuFnKtTJpk,ge7Lm2r0uMTSq70rdOFIMATSXOa4nb[] fg,qwC_dNDiAFMKBkr6T4uRfeBI illoJZMgztObxMTNsQNxpCP3,uDRbbM1BkPdzLlIqemR s1rxeC3K9GIkBFuH76sBFtcZ2,int yoFH9Dny,yWIEfu2ezmLDN3nFC2hiLuVVJ4q6GOh jdHiHIGvTp7n7dDNR,g f9ujzKjhznUxenQUMlQPhCqI,s0rlILJ3mfF8R8_g3MjiBdBRbrG[] wVmIWGlkMNn7HAC3_RyNt6bGqmcfyL,int x1I5bOoiWL1dGzOYH_dU9al_NsFiCaS,
// every line is an expression
false
gVJPCHzOvIqKeIT5otZ.pLkpaauz.j1UTF6A_VQtORjVs3ZSNW0EuSw.oe1SAMEO9B7wJWiQvcpi||(z7pZlv7g6Qqfb.sHhRe4ka3ujCxdzSsYyfJb3_u3Znfau)
2||this>=!new h2eQwBfTTO15aMLP2GDQVdmbSUWm9Pq[dfGDBIHkS_un[(27)]]/true
false
new lPIWkLJR[false]
this[this[new int[cMPs5UCZlb()]]]
wqWZTDl0o94nTbP_ipiwrmwpGDx5[this((((-mBB.ojGVeRpCdIRp_kyjJH47tseEAicb.glzkwm_8lYWIc8cl))))]*mzKpxr7L1FSZojC9K3K5_wb9kh2
!new veQNbQuIkzgggfOIUD()
fCIy7c8y2Stf2OCCTN0
import numpy as np
import math
from collections import Counter
# note that this assumes that all base pairs are upper cased
def kmers(coll, k):
n = len(coll)
for i in range(0, n - k + 1):
yield coll[i:i+k]
@tice0-2
tice0-2 / exprs.java
Last active January 31, 2020 21:08
machine generated test cases for expressions, statements, programs, for PA1
/*
* Each test case is an expression.
*/
//Test Case ID: 0
3
//Test Case ID: 1
7
//Test Case ID: 2
-9

repeat_master (a nameplay on RepeatMasker, never thought anyone else excpet me would use it so sorry about the name, feel free to rename it...) is a simple wrapper for querying the mice database with repeat master.

Simple Usage

from repeat_master import repeat_master
repeat_master(list of sequences) # returns a list of results for each sequence, corresponding to the highest score entry from repeatmasker
class PS {
void println(int n) {
}
}
class Sys {
static PS out;
}