摘要:
欧拉函数,n每扩大一个,就会有euler(n)个数字加入到集合中,所以欧拉函数的前n项和即为所求。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 1000006long long phi[maxn], num[maxn];int n;int main(){ //freopen("t.txt", "r", stdin); int 阅读全文
posted @ 2011-05-22 10:49
undefined2024
阅读(225)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 100005int f[maxn], pos[maxn];int main(){ //freopen("t.txt", "r", stdin); int n; while (scanf("%d", &n), n != 0) { for (int i 阅读全文
posted @ 2011-05-22 10:28
undefined2024
阅读(244)
评论(0)
推荐(0)
摘要:
二分图匹配,每个点只判断与其周围各点的匹配情况,难点在于对于一个编号求期所在的行列,以及对于给出的坐标求编号。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 70int n, m, h;bool map[maxn][maxn];int xM[maxn * maxn], yM[maxn * maxn];bool chk[maxn * maxn];int uN, vN;i 阅读全文
posted @ 2011-05-22 09:25
undefined2024
阅读(649)
评论(0)
推荐(0)