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 <cstdlib> | |
#include <cstdio> | |
#include <cstring> | |
#define MAX_ITEM 32 | |
#define MAX_WEIGHT 20002 | |
#define fin stdin | |
#define fout stdout | |
int n; | |
int max; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define MAX_ELEMENT 10001 | |
inline int fmax(int a, int b) { | |
return a > b ? a : b; | |
} | |
int n; |
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
/* | |
USER: fanzeyi1 | |
TASK: buylow | |
LANG: C++ | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define MAX_DAY 5001 | |
#define MAX_NUM 20001 |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define MAX_PEOPLE 101 | |
int n; | |
int result; | |
int height[MAX_PEOPLE]; | |
int height_r[MAX_PEOPLE]; | |
int f[MAX_PEOPLE]; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define MAX_MISSILE 1001 | |
#define fin stdin | |
#define fout stdout | |
int n; | |
int height[MAX_MISSILE]; | |
int f[MAX_MISSILE]; |
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
x = [lambda: x for x in range(10)] | |
print x[0]() | |
''' | |
俺的第一反应是 x = [lambda: 1, lambda: 2, ...] | |
但是实际上是 x = [lambda x, lambda x], 所以返回的应该是这个 lambda list | |
''' | |
x = (lambda: x for x in range(10)) | |
print x.next()() | |
''' |
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 calendar | |
START_YEAR = 2012 | |
END_YEAR = 2012 | |
START_MONTH = 7 | |
END_MONTH = 7 | |
cal = calendar.Calendar() | |
result = ["&year=%d&month=%d&day=%d" % (year, month, day) \ | |
for year in range(START_YEAR, END_YEAR + 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 calendar | |
START_YEAR = 2012 | |
END_YEAR = 2012 | |
START_MONTH = 7 | |
END_MONTH = 7 | |
cal = calendar.Calendar() | |
result = ["&year=%d&month=%d&day=%d" % (year, month, day) \ | |
for year in range(START_YEAR, END_YEAR + 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
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
require("awful.rules") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
naughty.config.default_preset.width = 400 |
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 grequests | |
BASE_PATH = 'http://xxxxx.com/web/_photo/pic/' | |
urls = ["%d0000%s%d" % (year, '0'*(4-len(str(no))), no) for year in range(2005, 2012) for no in range(2001)] | |
rs = (grequests.get(BASE_PATH + u + '.JPG') for u in urls) | |
result = grequests.map(rs) |