QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#23517#1833. Deletinghht2005Compile Error//C639b2022-03-17 11:19:022022-05-18 04:14:24

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-18 04:14:24]
  • 评测
  • [2022-03-17 11:19:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=4010;
int a[N][N],n;
bitset<N>f[N];
int check(int x) {
	for(int i=1;i<=n;i++)f[i].reset();
	for(int i=1;i<=n+1;i++)f[i][i-1]=1;
	for(int L=n;L>=1;L--)
		for(int R=L+1;R<=n;R+=2) {
			if(f[L+1][R-1]&&a[L][R]<=x)f[L][R]=1;
			if(f[L][R])f[L]|=f[R+1];
		}
	return f[1][n];
}
int main() {
	int l=1e9,r=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j+=2) {
			scanf("%d",a[i]+j);
			l=min(l,a[i][j]);
			r=max(r,a[i][j]);
		}
	while(l<=r) {
		int mid=(l+r)>>1;
		if(check(mid))r=mid-1;
		else l=mid+1;
	}
	printf("%d\n",r+1);
	return 0;
}

Details

answer.code:1:9: fatal error: bits/stdc++.h: No such file or directory
 #include<bits/stdc++.h>
         ^~~~~~~~~~~~~~~
compilation terminated.