随笔分类 - 模拟训练
摘要:``` #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep_1(i,m,n) for(int i=m;i pii; typedef unsigned l
阅读全文
摘要:``` #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep_1(i,m,n) for(int i=m;i pii; typedef unsigned l
阅读全文
摘要:``` #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep_1(i,m,n) for(int i=m;i pii; typedef unsigned l
阅读全文
摘要:``` #include #include #include #include #define ll long long const int N = 1E6; const int mod = 1E9 + 9; using namespace std; int dp[5][5][30][30][30]; //预处理出a,b, c字符串中任意字母 和中间两个任意符号的情况数 void init() {
阅读全文
摘要:``` #include using namespace std; typedef long long ll; const ll mod = 1e9 + 7; const int N = 5010; char str1[N], str2[N]; int p[N], a[N], mod2; ll dp[N][65][65]; ll dfs(int pos, int sum, int last, bo
阅读全文
摘要:```#include #include #include #include #include #include using namespace std;const int N = 2e3;int n, arr[N + 5], cnt[N + 5], maxv;vector> res;vector ans;//现在多少数//最大是多少void solve(int u, int maxnow){ i...
阅读全文
摘要:```#includeusing namespace std;int a[8][8],len[12],cnt;int d[4][2]= {{1,0},{-1,0},{0,1},{0,-1}};bool vis[8][8];bool check(int x,int y){ return x>=1&&x=1&&ymxdep) return false; //如果长度恰好等于股价函数 ,也就是到了边缘...
阅读全文
摘要:```//#include#include#include#include#include#include#include#define int long longusing namespace std;#define rep_1(i,m,n) for(int i=m;i='0'&&ch='0'&&ch pii;typedef unsigned long long ull;typedef pair...
阅读全文
摘要:非常难受的是,我用链表写的,要么wa,要么tle,甚至还出现了超内存。。。 然后换成矩阵,开始还是wa了两次,然后换了别的快读,才过,难受。
阅读全文
摘要:``` #include #include #include #include #include #include using namespace std; #define ll long long const int N=1e5+5; const int M=1e5+5; const int INF=0x3f3f3f3f; int read() { int res=0,ch,flag=0; if
阅读全文
摘要:``` #include #define f first #define s second using namespace std; typedef long long ll; const int N=300005; typedef pair P; int n,tot,t,V; map mp; map,int> mp2; vector G[N]; int match[N]; bool used[N
阅读全文
摘要:```#include#includeusing namespace std;typedef long long ll;int read(){ int temp=0,ch,flag=0; if((ch=getchar())=='-') //判断正负 flag=1; else if(ch>='0'&&ch='0'&&ch>str+1>>m; n=strlen(str+1);...
阅读全文
摘要:```#include#include#include#include#include#includeusing namespace std;typedef long long ll;int read(){ int res=0,ch,flag=0; if((ch=getchar())=='-') //判断正负 flag=1; else if(ch>='0'&&ch='0'...
阅读全文
摘要:```#include#include#define int long longusing namespace std;const int N=4010,mod=1e9+7;int a[N];int e[N*N],ne[N*N],idx,h[N];int st[N];int ans;int ans1[N];int read(){ int res=0,ch,flag=0; if((ch=getcha...
阅读全文
摘要:```#include#include#include#include#include#includeusing namespace std;#define LL long longconst int N=1010;int val[N][N];int res[N][N];char c[N][N];int n,m;bool check(int mid){ memset(res,0,sizeof re...
阅读全文
摘要:问题 A: sciorz画画 题目描述 众所周知,sciorz会画画。某天,sciorz画了一个凸多边形,这个多边形的每个顶点都有一个权值a[i]。sciorz觉得这个凸多边形不够美丽,于是他决定在n个点之间连线,最终用n-3条不相交的线将这个凸n边形分割成n-2个三角形。sciorz认为,一个三角
阅读全文