数学
fa茶
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #290 (Div. 2)D - Fox And Jumping——数论gcd=1
http://codeforces.com/contest/510/problem/D给你n个卡片和每个卡片的花费,求用最少的花费使得用所买的卡片可以到达任意的位置只要所取的卡片的最大公约数为1就可以到达任意的位置,贪心维护最小值,最后结果为mp[1]#include<bits/stdc .h>using namespace std;int n;int l[310],c[310];map<原创 2015-02-07 15:29:49 · 689 阅读 · 0 评论 -
HDU5175Misaki's Kiss again——数论
http://acm.split.hdu.edu.cn/showproblem.php?pid=5175若gcd(a,b)= a xor b=c,则b=a-c (打表发现的)c是a的因子,则枚举a的所有因子判断b是否满足a^b=c93MS 1104K 893 B#include<iostream>#include<cstring>#include<cstdio>#include<原创 2015-02-15 14:38:09 · 869 阅读 · 0 评论 -
HDU5171GTY's birthday gift——矩阵快速幂裸题
http://acm.split.hdu.edu.cn/showproblem.php?pid=5171s(n)=s(n-1)+f(n-1)+f(n-2) f(n)=f(n-1)+f(n-2)#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#define N 3#define ll long lo原创 2015-02-12 20:11:21 · 641 阅读 · 0 评论 -
Codeforces Round #295 (Div. 2)C - DNA Alignment——规律
转http://blog.csdn.net/codebattle/article/details/4402210315 ms 108 KB#include<bits/stdc++.h>#define ll long longconst int maxn=100005;const int mod=1e9+7;using namespace std;int n;char s[maxn];原创 2015-03-09 23:54:26 · 472 阅读 · 0 评论