Skärmdump från http://www.svtplay.se/video/1680485/del-6-av-10@18:56.
Första delen av koden är från POIU: Parallel Operator on Independent Units.
with open('gymnastics.in', 'r') as fin: | |
K, N = map(int, fin.readline().split()) | |
P = {k: {int(n): i for i, n in enumerate(fin.readline().split())} | |
for k in range(K)} | |
ans = 0 | |
for n1 in range(1, N + 1): | |
for n2 in range(1, N + 1): | |
if n1 == n2: |
import requests | |
import xmltodict | |
def find_post_by_photo_url(photo_url, start=0, num=50): | |
total = start + 1 | |
while start < total: | |
r = requests.get('https://marklovejoydotcom.tumblr.com/api/read', params={'start': start, 'num': num}) | |
r.raise_for_status() |
Skärmdump från http://www.svtplay.se/video/1680485/del-6-av-10@18:56.
Första delen av koden är från POIU: Parallel Operator on Independent Units.
An alternate view of the solar terminator.
_ = sp.require('underscore'); | |
sp.core.library.getTracks().length | |
// Versus: | |
// Total number of tracks in "library" = all playlists | |
_.reduce(sp.core.library.getPlaylists(), function (a, x) { return a + _.reject(_.map(_.range(x.length || 0), function (i) { return x.getTrack(i); }), function (t) { return t.isLocal || t.isAd || t.isPlaceholder || !t.availableForPlayback; }).length; }, 0) | |
// Number of unique tracks (unique track URIs) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>API</title> | |
<link rel="stylesheet" href="sp://import/css/adam.css"> | |
<style> | |
body { | |
-webkit-box-orient: vertical; | |
display: -webkit-box; |
import qualified Data.Map as M | |
import Data.List (find) | |
import Data.Maybe (fromMaybe) | |
firstNonRep :: String -> Maybe Char | |
firstNonRep xs = let m = M.fromListWith (+) . map (\c -> (c,1)) $ xs | |
lookup = flip (M.findWithDefault 0) m | |
in find ((== 1) . lookup) xs | |
main = print $ case firstNonRep "faabcbcdee" of |
diff --git a/page.c b/page.c | |
index 07ac9d5..69374c4 100644 | |
--- a/page.c | |
+++ b/page.c | |
@@ -30,7 +30,7 @@ | |
static caddr_t startAddr = (caddr_t) 0; | |
#if ( !defined(sgi) && !defined(_AIX) ) | |
-extern int sys_nerr; | |
+/*extern int sys_nerr;*/ |