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
from collections import defaultdict | |
import sys | |
N = int(sys.stdin.readline()) | |
grid = defaultdict(lambda: 0) | |
grid[0, 0] = 1 | |
x, y = 0, 0 | |
dx, dy = 1, 0 | |
while grid[x, y] <= 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
# Based on original katawa-shoujo PKGBUILD (but use native renpy instead of bundled one) written by Anton Larionov <diffident dot cat at gmail dot com> | |
# Maintainer: Cravix < dr dot neemous at gmail dot com > | |
pkgname=katawa-shoujo | |
pkgver=1.3.1 | |
pkgrel=2 | |
pkgdesc="a bishoujo-style visual novel by Four Leaf Studios built on renpy" | |
arch=('any') | |
url='http://katawa-shoujo.com/' | |
license=('CCPL:BY-NC-ND') |
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
# Maintainer: Kyle Sferrazza <kyle.sferrazza@gmail.com> | |
# Contributor: Maks Verver <maksverver@geocities.com> | |
# Contributor: p2k <Patrick.Schneider@uni-ulm.de> | |
# Contributor: nokangaroo <nokangaroo@aon.at> | |
pkgname=golly | |
pkgver=2.8 | |
pkgrel=3 | |
pkgdesc="A simulator for Conway's Game of Life and other cellular automata" | |
arch=('i686' 'x86_64') |
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
from __future__ import print_function | |
digits = [ | |
[3,3,3,5,6,3,6,3], | |
[3,6,6,3,3,5,6,3], | |
[3,3,3,3,3,2,3,3], | |
[3,3,5,3,3,3,3,3], | |
[2,3,3,3,3,3,3,3], | |
[3,6,3,3,3,2,3,2], | |
[3,3,3,4,3,3,3,3], |
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
#include <stdio.h> | |
#include <assert.h> | |
/* Calculates the square root of a nonnegative number using Newton's method. */ | |
double square_root(double a) { | |
assert(a >= 0); | |
if (a == 0) return 0; | |
double x = a, prev; | |
do { | |
prev = x; |
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
CFLAGS=-std=c99 -O3 -march=native | |
OBJS=main.o search1.o search2.o search3.o | |
main: $(OBJS) | |
cc -o $@ $(OBJS) | |
clean: | |
rm -f $(OBJS) |
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
/* 1) Immediately prints the base puzzle SVG to stdout. | |
* 2) Creates a path-*.svg each * time it hits a longest path. | |
* 3) Creates a solution-*.svg for each solution. | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#define WIDTH 8u | |
#define HEIGHT 8u |
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
class A { | |
public static boolean isPrime(int i) { | |
if (i < 2) return false; | |
for (int j = 2; j <= (int) Math.sqrt(i); ++j) { | |
if (i % j == 0) return false; | |
} | |
return true; | |
} |
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
# https://www.hackerrank.com/challenges/candies | |
import sys | |
N = int(sys.stdin.readline()) | |
ratings = [ int(sys.stdin.readline()) for n in range(N) ] | |
candies = [1]*N | |
for i in range(1, N): | |
if ratings[i] > ratings[i - 1]: | |
candies[i] = candies[i - 1] + 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
#include <algorithm> | |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
using namespace std; | |
#define FOR(i, a, b) for(int i = int(a); i < int(b); ++i) | |
#define REP(i, n) FOR(i, 0, n) | |
#define SZ(c) (int((c).size())) |