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
map<vector<int>, int > dp; | |
int rec(vector<int> v){ | |
if(dp.find(v) != dp.end()){ | |
return dp[v]; | |
} | |
if(v.size() == 2){ | |
return 0; | |
} |
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
set t_Co=256 | |
set background=dark | |
if !has('gui_running') | |
let g:solarized_termcolors=&t_Co | |
let g:solarized_termtrans=1 | |
endif | |
colorscheme solarized |
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
call pathogen#runtime_append_all_bundles() | |
call pathogen#helptags() | |
set ai ts=2 sw=2 nu expandtab | |
filetype plugin on | |
filetype indent on | |
syntax enable | |
set t_Co=256 | |
set background=dark |
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 reverse_linearsearch(v, L): | |
index = len(L) - 1 | |
while index > -1 and L[index] != v: | |
index -= 1 | |
return index | |
def find_all(v, L): | |
li = [reverse_linearsearch(v, L)] |
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
#include <string> | |
#include <iostream> | |
using namespace std; | |
class Node{ | |
public: | |
string s; | |
int id; | |
Node *next; |
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
#include <iostream> | |
#include <cmath> | |
#define p(x) cout << #x << ":" << x << endl; | |
#define LIMIT (int)pow(2, 3) | |
using namespace std; | |
class Node{ |
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
#include <iostream> | |
#include <fstream> | |
#include <algorithm> | |
#include <string> | |
#include <cmath> | |
#include <vector> | |
#include <map> | |
#include <cstdlib> | |
#include <cstring> |
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
#!/bin/bash | |
for file in example_bots/*.jar | |
do | |
player_1_counter=0 | |
player_2_counter=0 | |
echo "Bot: $file" | |
for i in {1..100} | |
do | |
#echo "Map: $i" | |
RES=`java -jar tools/PlayGame.jar maps/map$i.txt 1000 1000 log.txt "java -jar $file" "./MyBot" 2>&1 | grep ^Player` |
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 java.util.*; | |
public class MyBot { | |
// The DoTurn function is where your code goes. The PlanetWars object | |
// contains the state of the game, including information about all planets | |
// and fleets that currently exist. Inside this function, you issue orders | |
// using the pw.IssueOrder() function. For example, to send 10 ships from | |
// planet 3 to planet 8, you would say pw.IssueOrder(3, 8, 10). | |
// | |
// There is already a basic strategy in place here. You can use it as a |
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
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int findRoot(int num, int root){ | |
int newNum = (int)abs((float)num); | |
// cout << "Finding root " << root << " for " << newNum << endl; | |
for(int i = 2; i <= newNum/root; i++){ | |
int val = i; |
NewerOlder