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
each.rankings.map(function(each){ | |
return each.rank | |
}).reduce(+)); |
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 <iostream> | |
using namespace std; | |
class BankEvent | |
{ | |
private: | |
int time; | |
public: | |
int getTime() | |
{ |
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
long long log_epic(long long a) | |
{ // takes the log base 2 of a in log(log(a)) time | |
long temp = a; | |
int low = 0; | |
int high = 0; | |
int shift = 32; | |
while(shift > 0) | |
{ | |
while(temp > 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
#include <iostream> | |
using namespace std; | |
long long log_epic(long long a) | |
{ | |
long temp = a; | |
int low = 0; | |
int high = 0; | |
int shift = 32; |
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
public class SudokuData | |
{ | |
int[][] values = new int[9][9]; | |
public JTextField[][] convertToJTF() | |
{ | |
//you implement this, it's REALLY easy | |
} |
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
public class RPSGame extends JFrame implements ActionListener | |
{ | |
int wins = 0; | |
int ties = 0; | |
int total = 0; | |
JPanel scores; | |
public RPSGame(String title) | |
{ |
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
boolean isPrime(long n) | |
{//fermats :D | |
if (n%2==0 || n%3==0) | |
{ | |
return false; | |
} | |
boolean res = true; | |
for (long a = 2; a<n; a*=2) | |
{ | |
res = res&&exp_mod_itr(a,n,n)==a; |
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
package edu.wpi.tmathmeyer.euler; | |
public class Probs { | |
public static void problem30(){ | |
int[] fives = new int[10]; | |
for(int i = 0; i < 10; i++) | |
{ | |
fives[i] = pow(i, 5); | |
System.out.println(fives[i]); | |
} |
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
package edu.wpi.tmathmeyer.euler; | |
public class Problem433 { | |
int[][] mem = new int[50000][]; | |
int size = 500000; | |
public static void main(String[] args){ | |
new Problem433().problem(); | |
} | |
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
/******************************************************************************* | |
* Copyright (c) 2013 Ted Meyer. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* Ted Meyer - being a generally kickass person | |
******************************************************************************/ |