https://blog.csdn.net/qq_36876305/article/details/80275708 #include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (long long i=a;i<n;i++) #define per(i,a,n) for (long long i=n-1;i>=a;i--) #define pb push_back #define mp make_pair
hdu6172 模板的简单应用 先根据题中的表达式求出前几项,再上BM,注意一下n的大小关系. #include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (long long i=a;i<n;i++) #define per(i,a,n) for (long long i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define al
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (long long i=a;i<n;i++) #define per(i,a,n) for (long long i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #def
1.KMP #include<cstring> #include<algorithm> #include<cstdio> using namespace std; const int maxn=1e6; ],b[maxn+]; ]; int len1,len2,t; int main() { scanf("%d\n",&t); while(t) { --t; scanf("%s%s",b,a);//a是母串 b是匹配串 l
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous. Every hour, God Water will eat one kind of food among meat, fish and chocolate. If there are 3 c
题目意思非常明确,就是叫你求第n项,据我们学校一个大佬说他推出了矩阵,但是我是菜鸡,那么肯定是用简单的方法水过啦!我们先p^(1/2)的复杂度处理出i=[i,p]范围内的所有种类的(int)(p/i),然后我们就可以知道种可能的除数的范围,就是分成几块 这里我不太会表达,看代码比较好 /** 求n/i的所有结果 **/ #include<stdio.h> int main( ){ int n; scanf("%d", &n); long long nex; ; i&