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
num = int(input()) | |
verteces = int(input()) | |
data = [[-1]*(verteces+1) for i in range(verteces+1)] | |
for i in range(num): | |
indata = [int(i) for i in input().split()] | |
data[indata[0]][indata[1]] = indata[2] | |
current = 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
import colorsys | |
import pandas as pd | |
from scipy.stats import beta | |
from matplotlib import pyplot as plt | |
import math | |
import numpy as np | |
import matplotlib.patches as mpatches | |
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 pygame | |
import math | |
start_x = 50 | |
start_y = 150 | |
start_dist = 300 | |
top_guy = [start_x,start_dist+start_y] | |
bottom_guy = [start_x,start_y] | |
vel = 0.1 | |
angle = 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
program rucksack; | |
uses math; | |
type THistory = array [0..10000,0..10000] of integer; | |
tItem= record | |
val,size:integer; | |
end; | |
TItems = array [1..10000] of tItem; | |
var fin,fout: text; | |
maxSize,maxItems,curSize,counter,counter2:integer; | |
History:THIstory; |
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 pygame, math, sys | |
def draw(dot1,dot2,dot3,order): | |
pygame.draw.lines(screen, (255,0,0), True, [dot1,dot2,dot3], 1) | |
if order>0: | |
newDot1 = (int((dot1[0]+dot2[0])*0.5),int((dot1[1]+dot2[1])*0.5)) | |
newDot2 = (int((dot2[0]+dot3[0])*0.5),int((dot2[1]+dot3[1])*0.5)) | |
newDot3 = (int((dot3[0]+dot1[0])*0.5),int((dot3[1]+dot1[1])*0.5)) | |
pygame.draw.lines(screen, (255,0,0), True, [newDot1,newDot2,newDot3], 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
import requests | |
from BeautifulSoup import BeautifulSoup | |
import dryscrape | |
import time | |
url = "http://www.drfrostmaths.com/homework/do-question.php?aaid=161230" | |
sess = dryscrape.Session() | |
sess.visit("http://www.drfrostmaths.com/homework/login.php") | |
name = sess.at_xpath('//*[@name="login-email"]') # Where <input name="username"> | |
name.set("email here") |
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 pygame, pygame.font | |
import random | |
def IsWritten(): | |
defTemp = True | |
for x in xrange((lettersOnScreen[0] / 2) - (len(str) / 2), (lettersOnScreen[0] / 2) + (len(str) / 2) + 1): | |
if xHeads[x] == -1: | |
defTemp = False | |
return defTemp |
OlderNewer