Skip to content

Instantly share code, notes, and snippets.

View stphung's full-sized avatar

Steven Phung stphung

  • Autodesk, Inc.
  • San Francisco, CA
View GitHub Profile
@stphung
stphung / milk2.java
Created April 13, 2011 05:33
My solution to "Milking Cows" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: milk2
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
@stphung
stphung / ride.java
Created April 12, 2011 04:18
My solution to "Your Ride Is Here" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: ride
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
@stphung
stphung / beads.java
Created April 12, 2011 04:17
My solution to "Broken Necklace" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: beads
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Scanner;
@stphung
stphung / gift1.java
Created April 12, 2011 04:16
My solution to "Greedy Gift Givers" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: gift1
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
@stphung
stphung / friday.java
Created April 12, 2011 04:15
My solution to "Friday the Thirteenth" from USACO
/*
ID: stphung1
LANG: JAVA
TASK: friday
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
;; Initialize a variable to count actions
(defvar apm-num-chars)
(setq apm-num-chars 0)
;; Calculates actions per minute
(defun apm (duration-seconds actions)
(truncate (* (/ actions (float duration-seconds)) 60)))
;; Increase actions and display
(defun update-apm (a b c)