{{{2013-03-16-sgu-321.markdown}}}
(
// Contributor: gxx, mxh, lty, lmy, yzh | |
digraph { | |
// 2023 | |
唐靖淇->李南锡 | |
唐靖淇->谢尚航 | |
唐靖淇->冯启豫 // replacement | |
杨宗翰->张建军 | |
杨宗翰->张明驰 | |
刘泳霖->戴之恒 | |
刘泳霖->李青峰 |
import SimpleHTTPServer | |
import SocketServer | |
PORT = 8000 | |
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
pass | |
Handler.extensions_map['.shtml'] = 'text/html' |
data State = Null | |
| Node String State State | |
valid :: State -> Bool | |
valid state = case state of | |
Null -> undefined | |
Node string _ _ -> null string | |
match :: String -> String -> [Int] | |
match pattern = map fst . filter (valid . snd) . scanl step (0, root) |
class MyString < String | |
attr_reader :flag | |
def initialize(s, f) | |
super s | |
@flag = f | |
end | |
end | |
s1 = MyString.new ' misa', :misa |
#!/bin/bash | |
tmpfile=$(mktemp) | |
for f in `git diff --cached --name-only --diff-filter=ACMR | egrep '\.(cc|cu|cuh|h)$'`; do | |
git show :"$f" > $tmpfile | |
if ! diff -q "$tmpfile" <(clang-format "$tmpfile") 2>&1 >/dev/null; then | |
echo "$f" is not clang-formatted. | |
rm -rf $tmpfile | |
exit 1 | |
fi | |
done |
#include <bits/stdc++.h> | |
const int N = 40; | |
const int MOD = 1e9 + 7; | |
using Mask = uint64_t; | |
void update(int &x, int a) { | |
x += a; |
PublicTransitHard http://community.topcoder.com/stat?c=problem_statement&pm=13797 | |
SimilarNames http://community.topcoder.com/stat?c=problem_statement&pm=12868 | |
n个字符串s_1, s_2, …, s_n,m个条件(a_i, b_i),统计满足s_{p(a_i)}是s_{p(b_i)}前缀的排列p_1, p_2, …, p_n数量 | |
n <= 50, |s_i| <= 50, m <= 8 | |
BichromeSky http://community.topcoder.com/stat?c=problem_statement&pm=13711 | |
n个红点,m个蓝点,没有三点共线,第i个红点以p_i的概率出现,求红点的凸包包含所有蓝点的概率 | |
n, m <= 100 |
prebuilt_cxx_library( | |
name = 'test', | |
exported_headers = ['test.h'], | |
shared_lib = 'libtest.so', | |
preferred_linkage = 'shared', | |
) | |
cxx_binary( | |
name = 'main', | |
srcs = ['main.cpp'], |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<cstring> | |
#include<iostream> | |
#include<ctype.h> | |
#include<algorithm> | |
#include<vector> | |
#include<string> | |
#include<set> | |
#include<map> |