摘要:
这题还是比较裸的,可是花了好长时间,一直TLE,最后加上一个优化,当一个字符放到DFA上跑不动的时候,后面相同的字符就直接PASS,终于过了,泪流满面啊……/* * hdu3695/win.cpp * Created on: 2011-9-21 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAX_PATTERN 阅读全文
摘要:
找规律推公式的题目,公式挺简单的,就是(2 * n)!/(n!)*(n!)*4^n不过因为有用到大数,还是用java比较方便import java.math.BigInteger;import java.util.Scanner;public class Main { public static void work(int n) { BigInteger up = BigInteger.ONE; for (int i = 2; i <= 2 * n; i++) { up = up.multiply(BigInteger.valueOf(i... 阅读全文