This file contains hidden or 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 sys | |
from fractions import Fraction | |
# Facebook Hacker Cup Online Round 1a - First or Last | |
# http://www.facebook.com/hackercup/problems.php?round=144428782277390 | |
def main(): | |
with open(sys.argv[1]) as fp: | |
input = fp.read().split() |
This file contains hidden or 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 sys | |
# Facebook Hacker Cup Online Round 1a - After the Dance Battle | |
# http://www.facebook.com/hackercup/problems.php?round=144428782277390 | |
def dijkstra(graph, start, end): | |
dist = {} | |
previous = {} | |
for v in graph.keys(): |
This file contains hidden or 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 sys | |
# Facebook Hacker Cup Qualification Round - Studious Student | |
# http://www.facebook.com/hackercup/problems.php?round=4 | |
def lex_compare(x, y): | |
if x.startswith(y) and x != y: | |
return lex_compare(x[len(y):], y) | |
if y.startswith(x) and y != x: |
This file contains hidden or 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
def fib(n: Int): Long = n match { | |
case _ if n <= 1 => n | |
case _ => fib(n-1) + fib(n-2) | |
} |
This file contains hidden or 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
using System.Windows; | |
using System.Windows.Controls; | |
namespace CustomControl | |
{ | |
public class BindablePasswordBox : Decorator | |
{ | |
/// <summary> | |
/// The password dependency property. | |
/// </summary> |
NewerOlder