This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n, m = map(int, raw_input().split()) | |
grid = [] | |
for i in range(n): | |
grid.append(map(int, raw_input().split())) | |
dp = [] | |
for i in range(n): | |
dp.append([0]*m) | |
for i in range(n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var label = 'schedule'; | |
function dpad(num){ | |
if(num<10){ | |
return "0"+num; | |
}else{ | |
return num; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Keepvid video downloader by ongspxm | |
This script uses keepvid to download videos from streaming sites (youtube, etc). Currently, it is set to download 480p quality videos. Edit to fit your needs. | |
The links are to be entered in this format: | |
[name of file w/o extension] [link to video] | |
To automate the process, you can combine all of the links into a list. Then you can run the script in the following manner: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as etree | |
ns = {'wp': 'http://wordpress.org/export/1.2/', 'content': 'http://purl.org/rss/1.0/modules/content/'} | |
blog = etree.parse('data.xml').getroot().find('channel') | |
for item in blog.findall('item'): | |
header = [] | |
title = item.find('title').text | |
slug = item.find('wp:post_name', ns).text | |
content = item.find('content:encoded', ns).text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.highlight { background: #1e2426; color: #babdb6} | |
.highlight .hll { background-color: #ffffcc } | |
.highlight .c { color: #656763} /* Comment */ | |
.highlight .err { color: #babdb6} /* Error */ | |
.highlight .g { color: #babdb6} /* Generic */ | |
.highlight .k { color: #729fcf} /* Keyword */ | |
.highlight .l { color: #babdb6} /* Literal */ | |
.highlight .n { color: #babdb6} /* Name */ | |
.highlight .o { color: #babdb6} /* Operator */ | |
.highlight .x { color: #babdb6} /* Other */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class CatIndex < Page | |
def initialize(site, base, dir, cat) | |
@site = site | |
@base = base | |
@dir = dir | |
@name = 'index.html' | |
self.process(@name) | |
self.read_yaml(File.join(base, '_layouts'), 'cat_index.html') | |
self.data['cat'] = cat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T = input() | |
for t in range(T): | |
J, P, S, K = map(int, raw_input().split()) | |
poss = [] | |
for j in range(1, J+1): | |
for p in range(1, P+1): | |
if K>=S: | |
for s in range(1, S+1): poss.append('%d %d %d'%(j, p, s)) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T = input() | |
for t in range(T): | |
B, M = map(int, raw_input().split()) | |
fixed = [] | |
if M>2**(B-2): | |
print 'Case #%d: IMPOSSIBLE'%(t+1) | |
else: | |
config = bin(M-1)[2:] | |
if B==2: config='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T = input() | |
grps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
for t in range(T): | |
N = input() | |
P = map(int, raw_input().split()) | |
plans = [] | |
while sum(P)>0: | |
idx = P.index(max(P)) | |
P[idx] -= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""MangaReader downloader. | |
Usage: | |
dw.py <manga> [<chapter>] [<page>] | |
Options: | |
-h --help Show this screen | |
--version Show version | |
""" |