摘要:
暴力。每次合并两个点之后,把新产生的连通关系都记录下来。 #include<cstdio> #include<algorithm> #include<vector> #include<cstring> using namespace std; int T, n, m, p, u, v, G; int 阅读全文
摘要:
水题 #include<cstdio> #include<cstring> #include<cmath> #include<ctime> #include<vector> #include<algorithm> using namespace std; int n; long long a[100 阅读全文
摘要:
简单DP。dp[i][j]表示走到这格的最大金钱数。 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int maxn=1000+10; int n,m 阅读全文
摘要:
预处理打表,sum[i][j]表示1.。。。。i这些数字中 j 有几个。然后就很好处理询问了。 #include<stdio.h> #include<math.h> #include<string.h> int sum[100000+10][15]; char s[100000+10]; int n 阅读全文
摘要:
有些问题,不做实践与猜测,可能一辈子也想不出答案,例如这题。 #include<stdio.h> #include<math.h> long long x; int main() { while(~scanf("%lld",&x)){ if(x<7) printf("-1\n"); else pri 阅读全文