线性推,矩阵乘法+快速幂求通项。
传送门:点击打开链接
#include
#include
#include
#include
using namespace std;
#define LL long long
struct Mat{
LL f[2][2];
};
LL MOD;
Mat mul(Mat a,Mat b)
{
LL i,j,k;
...
分类:
其他好文 时间:
2014-05-15 14:53:10
阅读次数:
225
http://acm.hdu.edu.cn/showproblem.php?pid=1224
基础的求最长路以及记录路径。感觉dijstra不及spfa好用,wa了两次。
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#define...
分类:
其他好文 时间:
2014-05-14 20:59:54
阅读次数:
295
zoj 3673 1 /** 2 6700417 3 **/ 4 #include 5
#include 6 #include 7 #include 8 #include 9 using namespace std;10 11 typedef
unsigned long long LL;12 13 ...
分类:
其他好文 时间:
2014-05-13 18:07:32
阅读次数:
234
题目链接:点击打开链接
暴力出奇迹。
正解应该是最近点对,以i点为x轴,sum[i](前缀和)为y轴,求任意两点间的距离。
先来个科学的暴力代码:
#include
#include
#include
#include
#include
#include
using namespace std;
#define N 100050
#define ll __int64
ll a[N], su...
分类:
其他好文 时间:
2014-05-13 05:45:30
阅读次数:
283
题目来源:POJ 1006 Biorhythms
题意:给出3个周期第一次发生的时间 和 当前开始的天数 求三个周期下一次到达高峰期发生在哪一天
思路:这题很水 试一下我的模版而已
#include
#include
using namespace std;
typedef long long LL;
const int maxn = 10;
int a[maxn], m[maxn];
...
分类:
其他好文 时间:
2014-05-13 05:07:28
阅读次数:
253
1.展示显示textTicker和只有icon的两种情况:当参数showTicker为true时显示否则不显示
// In this sample, we'll use the same text for the ticker and the expanded notification
CharSequence text = getText(textId);
...
分类:
移动开发 时间:
2014-05-13 00:02:35
阅读次数:
465
暴力出奇迹。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll __int64
#define N 42
ll n,m,ans;
ll Gcd(ll x,ll y){
if(x>y)swap(x,y);
while(x){
y%=...
分类:
其他好文 时间:
2014-05-12 23:11:06
阅读次数:
445
//求gcd(a, b)
LL gcd(LL a, LL b)
{
return b ? gcd(b, a%b) : a;
}
//求整数x和y,使得ax+by=d, 且|x|+|y|最小。其中d=gcd(a,b)
void gcd(LL a, LL b, LL& d, LL& x, LL& y)
{
if(!b)
{
d = a;
x = 1;
y = 0...
分类:
其他好文 时间:
2014-05-11 14:45:32
阅读次数:
240
父域dns对子域dns实现授权,子域对父域:1.改变根提示,把父域dns视为根2.转发器[root@host2~]#cd/media/cdrom[root@host2cdrom]#ll[root@host2cdrom]#cdPackages/[root@host2Packages]#llbind*-r--r--r--.2rootroot4173752Aug282013bind-9.8.2-0.17.rc1.el6-r--r--r--.2rootro..
分类:
其他好文 时间:
2014-05-10 04:03:40
阅读次数:
522
非递归版好像被卡掉了,其他2个板子都能过。
#include
#include
#include
#include
#include
using namespace std;
#define ll int
const int MAXN = 100100;//点数的最大值
const int MAXM = 400010;//边数的最大值
const int INF = 0x3f3f3f3f;
st...
分类:
其他好文 时间:
2014-05-09 22:55:23
阅读次数:
476