#include <bits/stdc++.h> const int N=200005; int n,v,a[N],dl[N][20],dr[N][20],pre[1<<20],suf[1<<20],dp[N],W; int main(){ scanf("%d%d",&n,&v); for (int ...
分类:
其他好文 时间:
2021-02-08 11:41:40
阅读次数:
0
#include <bits/stdc++.h> typedef long long ll; ll dp[40][40][40],ans; int n,a[40][40]; char s[40]; ll dfs(int l,int r,int mid){ if (l==r) return 1; if ...
分类:
其他好文 时间:
2021-02-08 11:40:55
阅读次数:
0
A. Space Navigation 签到题 #include<bits/stdc++.h> #include<iostream> #include<map> #include<cstdio> #include<cmath> #define mem(a,b) memset(a,b,sizeof a ...
分类:
其他好文 时间:
2021-02-06 12:18:29
阅读次数:
0
UOJ87 mx的仙人掌 这里没有用传统的方点外接圆点的做法,而是方点虚树上儿子跳到方点所在环上单调队列处理,本质上是一样的. code //爽! #include<bits/stdc++.h> using namespace std; typedef long long ll; const int ...
分类:
其他好文 时间:
2021-02-06 12:15:50
阅读次数:
0
//八皇后#include<bits/stdc++.h>using namespace std;int a[9];bool b[9],c[17],d[17];int num;int print(){ num++; for(int i=1;i<=8;i++) cout<<"("<<i<<","<<a[ ...
分类:
其他好文 时间:
2021-02-05 10:58:33
阅读次数:
0
P3052 [USACO12MAR]Cows in a Skyscraper G 预处理出每种状态的体积和,然后枚举子集转移。 时间复杂度 \(O\left(3^n\right)\)。 code: #include<bits/stdc++.h> using namespace std; #defin ...
分类:
其他好文 时间:
2021-02-05 10:29:05
阅读次数:
0
暴力朴素无优化写法: #include<bits/stdc++.h> using namespace std; const int maxn=1e3+5; int dp[maxn][maxn]; int v[maxn],w[maxn]; int main(){ int n,m;scanf("%d%d ...
分类:
其他好文 时间:
2021-02-04 12:02:33
阅读次数:
0
修改一座山可能同时改变其两侧山的类型。贪心地考虑,要么是修改成其左侧山的高度要么是修改成其右侧山的高度,这样能够在使得当前山不成为山峰和山谷的同时让两侧的山尽可能不成为山峰和山谷。 时间复杂度 \(O\left(\sum n\right)\)。 #include<bits/stdc++.h> usi ...
分类:
其他好文 时间:
2021-02-03 10:39:38
阅读次数:
0
在一个平面直角坐标系的第一象限内,如果一个点(x,y)与原点(0,0)的连线中没有通过其他任何点,则称该点在原点处是可见的。 编写一个程序,计算给0<x,y<=n定整数N的情况下,满足的可见点(x,y)的数量(可见点不包括原点)。 #include<bits/stdc++.h> #define N ...
链接 : https://codeforces.com/contest/1475/problem/D 排序 + 双指针 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.t ...
分类:
其他好文 时间:
2021-01-28 12:04:58
阅读次数:
0