随笔分类 - hdu_together
摘要:#include <cstdio> #include <vector> #include <cstring> #include <algorithm> using namespace std; int T,n,val[100010],c_back[100010],c[100010],ans[1000
阅读全文
摘要:#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int n,m; double dp[1010][20],ans; struct edge{double p,q;}a[1010]; bool
阅读全文
摘要:生成树计数 按位枚举每一位为1的个数在进行最小生成树计数时间复杂度O(Tn^2*30) #include <bits/stdc++.h> using namespace std; #define N 110 #define LL long long #define ll long long LL K
阅读全文
摘要:树形dp裸题 两遍dfs 第一次求dp[i][0]表示选取k-1条边(除父节点外)所能取得的最大权值 第二次求dp[i][1]表示i点可以超过k条边其他点不行所能取得的最大权值,过程中更新父亲的dp[fa][0] #include <cstdio> #include <algorithm> #inc
阅读全文
摘要:#include <cstdio> #include <cstring> using namespace std; int SG[1010],f[1010],cnt; bool S[1010]; void get_SG(){ for(int i=1;i<=1000;i++){ memset(S,0,
阅读全文
摘要:Problem Description 对于四川同胞遭受的灾难,全国人民纷纷伸出援助之手,几乎每个省市都派出了大量的救援人员,这其中包括抢险救灾的武警部队,治疗和防疫的医护人员,以及进行心理疏导的心理学专家。根据要求,我校也有一个奔赴灾区救灾的名额,由于广大师生报名踊跃,学校不得不进行选拔来决定最后
阅读全文
摘要:#include <cstdio> #include <cstring> #include <algorithm> #include <stack> #include <vector> #include <cmath> using namespace std; #define ll long lon
阅读全文
摘要:#include <cstdio> #include <algorithm> #include <vector> #include <stack> #include <cstring> using namespace std; int n,m,dfn[10010],low[10010],scc[10
阅读全文
摘要://(a,b)最小公倍数=a*b/(a,b)最大公因数 //最大公因数用欧几里得定律求(这里不证明)可百度(说实话我好想不会orz)#include<bits/stdc++.h> using namespace std; int gcd(int x,int y){ return y==0?x:gcd
阅读全文
摘要://特殊数据好坑爹啊- -#include<bits/stdc++.h> using namespace std; int a[2010],n; char s[2010]; bool first; int main(){ while(scanf("%s",&s)!=EOF){ memset(a,0,
阅读全文
摘要://如果 剩下的人+1 > 最大的人 就是Yes 不然 no#include<cstdio> int q,a[1000010],n,x,maxn; long long sum; bool answer; int main(){ scanf("%d",&q); while(q--){ x=0,maxn
阅读全文
摘要:#include int main(){ int n,a,b,c,sum,i,j; scanf("%d",&n); while(n--){ scanf("%d-%d-%d",&a,&b,&c); sum=0; if(b==2&&c==29){printf("-1\n"); continue;} if(b<=2)...
阅读全文
摘要:// 题目数据有问题 这样都能过? 如果没有循环就不行 但是数组也开不了那么大 所以数据或者数据范围有问题#include<bits/stdc++.h> using namespace std; int main(){ int a[10000],x,y,n,m,i; a[1]=a[2]=1; whi
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int n,vmax; string x,smax; map<string,int> m; map<string,int>::iterator p; int main(){ while(scanf("%d",&
阅读全文
摘要://格式最坑的题库- -#include<bits/stdc++.h> using namespace std; int q,f,l,sum,a[100010],maxn,mayf=1; int main(){ scanf("%d",&q); for(int i=1;i<=q;i++){ memse
阅读全文

浙公网安备 33010602011771号