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
/************************************************************** | |
Problem: 1969 | |
User: zxytim | |
Language: C++ | |
Result: Accepted | |
Time:654 ms | |
Memory:7568 kb | |
****************************************************************/ | |
/* |
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
#include <sys/time.h> | |
#include <cmath> | |
#include <cstdio> | |
typedef unsigned long long time_ms_t; | |
time_ms_t get_time() | |
{ | |
static timeval tv; | |
gettimeofday(&tv, 0); | |
return tv.tv_sec * 1000 + tv.tv_usec * 0.001; |
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
/* | |
* $File: fast-read.cc | |
* $Date: Fri Dec 21 14:44:05 2012 +0800 | |
* $Author: Xinyu Zhou <zxytim[at]gmail[dot]com> | |
* | |
* A template for fast read of integer and string. | |
* | |
* This implementation is in MACRO format because it | |
* yields a slightly faster code that that of using | |
* function calls. |
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/python3 | |
from random import * | |
def rand_coord(): | |
return randint(0, coord_max) | |
def rand_pt(): | |
print(rand_coord(), rand_coord(), | |
randint(0, val_max)) |
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
/* | |
* $File: class_uniq_thread_job_pool.hh | |
* $Date: Sat Jan 18 14:33:53 2014 +0800 | |
* $Author: Xinyu Zhou <zxytim[at]gmail[dot]com> | |
*/ | |
#pragma once | |
#include <vector> | |
#include <queue> |
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
/* | |
$ g++ a.cc -o a -std=c++1y | |
$ ./a | |
3.1 | |
3.1 | |
3 | |
3.1 | |
3 | |
3.1 |
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 python2 | |
# -*- coding: utf-8 -*- | |
# $File: prefetch.py | |
# $Date: Tue Aug 26 18:12:01 2014 +0800 | |
# $Author: Xinyu Zhou <zxytim[at]gmail[dot]com> | |
from multiprocessing import Pool | |
from collections import deque | |
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
//#include "opencv_traits.hh" | |
#include <opencv2/core/core.hpp> | |
#include <set> | |
#include <tuple> | |
#include <map> | |
#include <vector> | |
struct Value { |
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
//#include "opencv_traits.hh" | |
#include <opencv2/core/core.hpp> | |
#include <set> | |
#include <tuple> | |
#include <map> | |
#include <vector> | |
template <typename value_t> |
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 python2 | |
# -*- coding: utf-8 -*- | |
# $File: push-phone | |
# $Date: Thu Sep 18 11:29:13 2014 +0800 | |
# $Author: Xinyu Zhou <zxytim[at]gmail[dot]com> | |
import sys | |
import getpass | |
import socket | |
import argparse |
OlderNewer