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
//I know that this program is ugly and else,but I will try my best to prompt the programming perls; | |
#include<isotream> | |
using namespace std; | |
int main() | |
{cout<<"end<<"<<endl; | |
} |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
from collections import deque | |
class Node(object): | |
def __init__(self, val=-1, left=None, right=None): | |
self.val = val |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import os | |
def line_count(): | |
dir_path = '/home/hzcortex/projects/recommend-about/cortexForum' | |
exclude = ['.git', '.idea', 'ven', 'migrations', 'static'] | |
exlude_files = ['base.txt'] | |
count = 0 | |
for root, dirs, files in os.walk(dir_path, topdown=True): |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
''' | |
可以优化的部分包括: | |
1. money 可以提前运算,因为是一个固定值 | |
2. 在计算的时候,以 bottle 为例,先用 bottle%=2,之后再对 bottle进行+temp | |
''' |
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
#如果一个女生说,她集齐了十二个星座的前男友,我们应该如何估计她前男友的数量? | |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
from __future__ import division | |
from random import randint | |
def judge(bf_list): | |
t=set(bf_list) | |
if len(t)!=12: |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# 这种做法和位运算非常相似,是更巧妙的做法 | |
from __future__ import division | |
from random import randint | |
def calculate(): | |
collections, cnt = [False] * 12, 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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
from __future__ import division | |
from itertools import permutations | |
from operator import itemgetter | |
from collections import defaultdict # no doc:-) pity | |
import time | |
teams = { |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import re | |
import os | |
import sys | |
import random | |
import cookielib | |
import requests | |
from bs4 import BeautifulSoup |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import multiprocessing as mp | |
import Queue | |
import time | |
import re | |
import requests | |
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
# 贝叶斯习题的内容 | |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
from __future__ import division | |
import numpy as np | |
# 采用多项式求解 | |
class Bayes(object): |
OlderNewer