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
// | |
// It's not a Bug, It's a Feature! (Java Version) | |
// Christopher Vo (cvo1 at cs.gmu.edu) | |
// | |
public class Main { | |
private static final class Patch { | |
private int cost = 0, rp = 0, rm = 0, pp = 0, pm = 0; | |
} | |
private static final class Node implements Comparable<Node> { | |
private int state = 0, cost = 0; |
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
// | |
// Switching Channels | |
// Uses exhaustive search through all possible programs | |
// This version does not use next_permutation! | |
// Christopher Vo (cvo1 at cs.gmu.edu) | |
// | |
#include <iostream> | |
#include <cstdio> | |
#include <algorithm> | |
#include <climits> |
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
// | |
// An example of how to generate permutations | |
// using STL algorithms library | |
// | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main () { | |
const int N = 8; |
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> | |
const static int const prime_list[170] = { 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, | |
29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, | |
107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, | |
191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, | |
271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, | |
367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, | |
457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, | |
563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, |
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
; A scene called "Bars" by Christopher Vo | |
(scene "bars" | |
(author "Christopher Vo") | |
; World / global properties go here. | |
; e.g. fog, ambient light, background, skybox, and gravity | |
(world | |
(gravity 9.8) | |
(colorAmbient 0.1 0.1 0.1) | |
(colorBackground 0.2 0.2 0.2)) |
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
#!/bin/bash | |
sudo service network-manager stop | |
sudo ifconfig wlan0 down | |
sudo iwconfig wlan0 mode ad-hoc essid $1 channel 4 | |
sudo ifconfig wlan0 172.17.116.106 netmask 255.255.255.0 up |
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
// Problem A: A Contesting Decision | |
// Author: Christopher Vo | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
struct team | |
{ | |
string name; |
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
// Problem H: Reverse Roman Notation | |
// Author: Christopher Vo | |
#include <iostream> | |
#include <stack> | |
#include <string> | |
using namespace std; | |
stack<int> sys; | |
// exceptions |
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
// Problem C: Choose Your Words Carefully | |
// Author: Christopher Vo | |
import java.util.*; | |
public class C { | |
public static void main(String args[]) { | |
HashMap<String, Integer> map = new HashMap<String, Integer>(); | |
Scanner sc = new Scanner(System.in).useDelimiter("[^a-zA-Z0-9]+"); | |
while (sc.hasNext()) { |
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
// Problem E: Helping Florida | |
// Author: Christopher Vo | |
#include <iostream> | |
#include <vector> | |
#include <list> | |
#include <map> | |
#include <sstream> | |
#include <algorithm> | |
using namespace std; |
OlderNewer