QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#23816#1833. DeletingLeiLeiKunLeCompile Error//C997b2022-03-19 16:16:192022-05-18 04:14:37

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:37]
  • 评测
  • [2022-03-19 16:16:19]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
using pii = pair<int, int>;

const int N = 4e3 + 10, inf = 1e18;

int cost[N][N];
bitset<2005> dp[N];

void solve() {

	int n;
	cin >> n;
	int l(inf), r(0);
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j += 2) {
			int x;
			cin >> x;
			l = min(l, x);
			r = max(r, x);
			cost[i][j] = x;
		}
	}
	while (l < r) {
		int mid = l + r >> 1;
		for (int i = 0; i < n; i++) dp[i].reset();
		for (int i = n - 1; i >= 0; i--) {
			for (int j = i + 1; j + 1 <= n; j += 2) {
				if (cost[i][j] <= mid && (i + 1 == j || dp[i + 1][j - 1 >> 1]))
					dp[i][j >> 1] = 1;
				if (dp[i][j >> 1])
					dp[i] |= dp[j + 1];
			}
		}
		if (dp[0][n - 1 >> 1]) r = mid;
		else l = mid + 1;

	}
	cout << l << endl;
}
signed main() {

	cin.tie(0) -> ios::sync_with_stdio(false);
	int tt = 1;
//	cin >> tt;
	while (tt--) {
		solve();
	}
}
/*
6
2 1 3
4 5
6 7
8
9
*/

详细

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