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
import YOUR_AI_FILENAME_HERE as AI | |
def get_sharpness(move_sequence: str): | |
def change_in_sharp(current_sharp: int, action: str): | |
if action == 'P' and current_sharp > 0: | |
return current_sharp - 1 | |
elif action == 'S': | |
return current_sharp + 1 | |
else: | |
return current_sharp |
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
# Kevin Cao | |
# March 9, 2015 | |
# define intro function | |
def intro(): | |
# give rules | |
print ("This is a puzzle favored by Einstein. \nYou will be asked to enter a three digit number, \nwhere the hundred's digit differs from the one's digit \nby at least two. \nThe procedure will always yield 1089.") | |
# define function einstein | |
def main(): | |
# prompt user for number |
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
# Kevin Cao | |
# March 9, 2015 | |
# define intro function | |
def intro(): | |
# give rules | |
print ("This is a puzzle favored by Einstein. \nYou will be asked to enter a three digit number, \nwhere the hundred's digit differs from the one's digit \nby at least two. \nThe procedure will always yield 1089.") | |
# define function einstein | |
def main(): | |
# prompt user for number |
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
def setUp(self): | |
self.mybag = Bag(['d','a','b','d','c','b','d']) | |
def test_len(self): | |
self.assertEqual(len(self.mybag), 7) | |
for removal in ['d','a','b','d','c','b','d']: | |
baglen = len(self.mybag) | |
self.mybag.remove(removal) | |
self.assertEqual(baglen - 1, len(self.mybag)) |
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
cf3 = | |
Compile[ | |
{}, | |
Module[ | |
{n1, l, max = 0, maxN = 0}, | |
Do[ | |
n1 = n; | |
l = 1; | |
While[ | |
n1 != 1, |
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
cf3 = | |
Compile[ | |
{}, | |
Module[ | |
{n1, l, max = 0, maxN = 0}, | |
Do[ | |
n1 = n; | |
l = 1; | |
While[ | |
n1 != 1, |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 91 columns, instead of 61. in line 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
name,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89 | |
Rand Paul,0.16,0.14,0.18,0.17,0.17,0.18,0.16,0.15,0.12,0.15,0.13,0.12,0.13,0.15,0.14,0.12,0.14,0.15,0.14,0.15,0.15,0.16,0.13,0.2,0.17,0.17,0.16,0.16,0.16,0.17,0.16,0.19,0.14,0.13,0.15,0.12,0.13,0.12,0.12,0.11,0.1,0.15,0.11,0.11,0.11,0.12,0.1,0.12,0.12,0.11,0.12,0.12,0.12,0.12,0.1,0.09,0.12,0.09,0.09,0.1,0.1,0.1,0.09,0.11,0.1,0.11,0.1,0.12,0.11,0.11,0.12,0.12,0.11,0.14,0.1,0.1,0.09,0.1,0.08,0.09,0.11,0.09,0.09,0.09,0.08,0.09,0.07,0.07,0.07,0.09 | |
Rick Santorum,0.04,0.07,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.07,0.06,0.06,0.07,0.07,0.07,0.08,0.08,0.06,0.06,0.06,0.07,0.09,0.09,0.08,0.08,0.08,0.06,0.06,0.08,0.06,0.06,0.06,0.05,0.06,0.04,0.06,0.07,0.07,0.03,0.06,0.06,0.06,0.04,0.06,0.06,0.07,0.05,0.05,0.07,0.05,0.05,0.07,0.05,0.08,0.08,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
n, m, s, x, y, z = map(int, input().split()) | |
cost = x + y + z | |
import math | |
comps = math.ceil(s/n) | |
if comps * cost <= m: | |
print(m - comps*cost) | |
else : | |
print( m%(comps*cost)) |
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
//////////////////////////////////////////////////////////////////////////////// | |
// | |
//Private helper methods | |
template<class KEY,class T, int (*thash)(const KEY& a)> | |
int HashMap<KEY,T,thash>::hash_compress (const KEY& key) const { | |
return (abs(this->hash(key)) % bins); | |
} | |
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
# coding: utf-8 | |
# In[54]: | |
from bs4 import BeautifulSoup | |
# In[55]: |
OlderNewer