
搜索
文章平均质量分 76
whzzt
这个作者很懒,什么都没留下…
展开
-
[BZOJ1053] 反素数 - dfs
钦定大水题qwq#include"stdio.h"using namespace std;typedef long long ll;int ans,ansn,n;int pri[20]={0,2,3,5,7,11,13,17,19,23,29,31,37};void dfs(int pos,int x,int lat,int a,int s){ if (x<pri[pos原创 2016-05-05 22:05:21 · 349 阅读 · 0 评论 -
[BZOJ1072] [SCOI2007] 排列perm - dfs/dp
dfs用链表优化一下即可。#include"stdio.h"#include"iostream"#define rep(f,a,b) for(f=a;f<=b;f++)using namespace std;struct node{ int w; node*next; node(){}; node(int _w,node*_n){ w=_w;原创 2016-05-14 19:17:45 · 284 阅读 · 0 评论 -
[BZOJ3643] phi的反函数 - 欧拉函数 - dfs
QAQ原创 2016-05-16 20:51:30 · 1823 阅读 · 0 评论 -
清华集训2017题解
ioi赛制好评QAQ好像啥都记不得了就不写游记了Day 11.1 生成树计数(tree.cpp)1.1.1. 题意 有 n≤30000n≤30000 n \le 30000 个点,第 ii i 个点有点权 aiai a_i ,设第 ii i 个点的点度为 didi d_i ,那么求求所有生成树的权值和。一个生成树的权值 w(T)w(T) w(T)...原创 2018-02-12 21:43:44 · 2313 阅读 · 0 评论 -
AtCoder Peterzavodsk Contest 001 题解
A. Two integers求是 xx x 的倍数且不是 yy y 的倍数的一个数 zz z ,要求 zz z 不超过 10181018 10^{18} 。#include<bits/stdc++.h>#pragma GCC optimize("no-stack-protector")#pragma GCC optimize("-funroll-loops...原创 2018-02-13 14:35:43 · 1358 阅读 · 3 评论