Skip to content

Instantly share code, notes, and snippets.

View vijfhoek's full-sized avatar

Sijmen vijfhoek

View GitHub Profile
streams: 1
threads per block: 32
blocks: 4096
warp size: 32
number of multiprocessors (CUs or WGPs): 20
total threads: 131072
max warps active: 1272
max blocks active: 1272
max threads per multiprocessor: 2560
est. max warps per CU/WGP: 63.6
input_ = """7 6 4 2 1
1 2 7 8 9
9 7 6 2 1
1 3 2 4 5
8 6 4 4 1
1 3 6 7 9
"""
input = """18 21 22 24 26 29 28
9 11 14 17 18 21 21
from std/strutils import split, parseInt
from std/sequtils import map, foldl
let numbers = readLine(stdin).split(',').map(parseInt)
var buckets: array[9, int]
for number in numbers:
buckets[number] += 1
for i in 0..<256:
from std/strutils import split, parseInt
from std/sequtils import map, foldl
let numbers = readLine(stdin).split(',').map(parseInt)
var buckets: array[256 + 9, int]
for number in numbers:
buckets[number] += 1
for i in 0..<256:
function getEventsCompanies() {
return fetch(`${baseUrl}/events/companies`).then((response) => response.json());
}
function getEventsOther() {
return fetch(`${baseUrl}/events/other`).then((response) => response.json());
}
function formatDateRange(start, end) {
const startMoment = moment(start);
/* Generated from day02.scm by the CHICKEN compiler
http://www.call-cc.org
Version 5.1.0 (rev 8e62f718)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
command line: day02.scm -output-file day02.c
uses: library eval expand extras data-structures
*/
#include "chicken.h"
static C_PTABLE_ENTRY *create_ptable(void);
(import (chicken io))
(import (chicken format))
(import (chicken string))
(import srfi-1)
(define (parse-line line)
(let ((words (string-split line)))
(list (car words) (string->number (car (cdr words))))))
(define (parse inputs)
use core::fmt::Debug;
use std::{
collections::{HashSet, VecDeque},
io::BufRead,
};
#[derive(PartialEq)]
enum Tile {
Nothing,
Wall,
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
import fileinput
part1, part2 = 0, 0
for line in fileinput.input():
line = line.strip()
part1 += len(line) - len(eval(line))
part2 += line.count("\\") + line.count('"') + 2
print(part1, part2)