hdu 4779 Tower Defense
原先以为是哈希+DP没想到超时得不能忍
借鉴了这篇博客的思路 http://www.cnblogs.com/wangsouc/articles/3639137.html
枚举几种状态的种类:2个重型炮同行(占用2列1行)、2个重型炮同列(占用2行1列)、一行1炮(占用1行1列)
其中大数除法用费马小定理求逆元
#include <cstdio>
#include <iostream>
#include <cmath>
#include <map>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
typedef __int64 ll;
const ......
阅读全文