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
""" | |
usage: cutter.py src destPrefix | |
""" | |
import sys, os | |
from time import sleep | |
CHUNK = 8 * 1024 | |
BLOCK = 2 * 1024 ** 3 - 1 | |
src = sys.argv[1] | |
destPrefix = sys.argv[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
#include<iostream> | |
#include<string> | |
#include<cstdio> | |
#include<cstring> | |
#include<cctype> | |
#include<vector> | |
#include<cstring> | |
#include<algorithm> | |
#include<vector> | |
#define For(i, n) for(i = 0; i < n; 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
#include<iostream> | |
#include<sstream> | |
#include<string> | |
#include<queue> | |
#include<cstdio> | |
#include<cstring> | |
#include<cctype> | |
#include<vector> | |
#include<cstring> | |
#include<algorithm> |
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 java.io.*; | |
import java.net.*; | |
import java.util.Scanner; | |
import java.util.NoSuchElementException; | |
public class MyServer{ | |
ServerSocket serverSocket; | |
Socket clientSocket; | |
Scanner in; | |
BufferedWriter out; |
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 java.io.*; | |
import java.net.*; | |
import java.util.Scanner; | |
public class MyClient{ | |
Socket clientSocket; | |
OutputStreamWriter out; | |
Scanner in; | |
public void connect(String dest, int port){ | |
try{ |
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
from collections import deque | |
import random | |
def gen_graph(n, m): | |
a = [[None] * n for i in range(n)] | |
for i in range(m): | |
x = random.randint(0, n-1) | |
y = random.randint(0, n-1) | |
c = random.randint(1, 100) | |
a[x][y] = c | |
return 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
#!/usr/bin/env python2 | |
import pygame | |
from pygame.locals import * | |
COLOR_BG = (0xff, 0xff, 0xff, 0xff) | |
COLOR_BLACK = (0, 0, 0, 0xff) | |
COLOR_TRANS = (0, 0, 0, 0) | |
G = 1 | |
class SMTNode: |
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
#!/usr/bin/python2 | |
class Window(object): | |
def draw(self, device): | |
device.append('flat window') | |
def info(self): | |
pass | |
# The subclass approch | |
class BorderedWindow(Window): |
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 as pg | |
import bz2 | |
import itertools | |
import Image | |
import ImageDraw | |
import pickle | |
from random import randint | |
from math import pi,sin,cos,sqrt,atan2 | |
norm = lambda c:c/abs(c) |
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
| Team| Solved| Penalty| A| B| C| D| E| F| G| H| I| J | |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
> SYSU_TimeWizard| 7| 696| (4)| 1:27:23(1)| 2:37:22(1)| 0:42:34| | | 3:51:29(3)| 0:04:25| 0:24:06| 0:29:27(1) < | |
| sysu_stardust| 6| 700| | 3:04:55(4)| | 1:19:22| | | 4:20:29(1)| 0:07:49| 0:18:54(1)| 0:28:56 | | |
> MagnetWarrior| 6| 819| | 2:40:05| | 2:45:02(2)| | | 4:02:23(1)| 0:46:13| 0:54:45| 1:11:17(1) < | |
| sysu_3idiots| 5| 309| | (3)| | 1:00:11| | | 2:48:47(1)| 0:13:16| 0:19:30| 0:27:21 | | |
> DarkMagician| |