摘要:
补交。 #include<iostream> #include<cstdio> using namespace std; int g[105],f[105],a[105],s[105]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a 阅读全文
摘要:
4维dp(因为n<=10) 就是二维dp+判断是否重复取 #include<bits/stdc++.h> using namespace std; int dp[15][15][15][15],a[15][15],x,y,z; int main() { ios::sync_with_stdio(0) 阅读全文
摘要:
交了锣鼓,但没交vjudge。 补交一下。 #include <iostream> using namespace std; void solve2(int n, int &y, int &m, int &d, bool flag) { static int todate[366][2]={{0,0 阅读全文
摘要:
dp 然而我们可以使用前缀和+暴搜,而且更好理解,同时复杂度约O(n2),能过 #include<bits/stdc++.h> using namespace std; int n,m,a[2505][2505],x[2505][2505],y[2505][2505],z[2505][2505],a 阅读全文
摘要:
赞美斯特勒(stl)。 #include <bits/stdc++.h> #define int long long using namespace std; priority_queue<int,vector<int>,greater<int> >q; signed main() { int n, 阅读全文
摘要:
终于想起来发博客了,呃呃呃呃呃呃 这题不难,但要看到 1≤L≤R<231和R−L≤106。 我们可以考虑先把<216的素数先筛出来,然后再把区间里的合数筛光。 然后……就没有然后了。 上代码: #include <bits/stdc++.h> #define int long long using 阅读全文
摘要:
又忘发博客了啊啊啊啊啊啊啊 马的遍历竟然现在才写…… 模板bfs。 #include<bits/stdc++.h> using namespace std; queue<int> _x,_y; int ma[405][405],dx,dy; int qx[8]={1,1,2,2,-1,-1,-2,- 阅读全文
摘要:
还好有题解,公式不用自己推了 #include<bits/stdc++.h> using namespace std; const int _G=3,mod=1004535809,Maxn=135000,MaxNum=10000500; long long powM(long long a,int 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int n,m,t,p,b[310000],tr[310000],d[310000],e[310000],g[310000],kk; char ch[100]; struct sth { int x,y,z,w 阅读全文