답안 #1093942

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1093942 2024-09-28T06:27:37 Z stdfloat Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
8 / 100
3000 ms 58960 KB
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);

	int n, q;
	cin >> n >> q;

	vector<int> a(n);
	for (auto &i : a)
		cin >> i;

	while (q--) {
		int l, r, k;
		cin >> l >> r >> k; l--; r--;

		set<int> s;
		bool tr = true;
		for (int i = r; i >= l && tr; i--) {
			tr = (s.empty() || a[i] <= *s.begin() || a[i] + *--lower_bound(s.begin(), s.end(), a[i]) <= k);
			s.insert(a[i]);
		}

		cout << tr << '\n';
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 46 ms 464 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 46 ms 464 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 25 ms 348 KB Output is correct
12 Correct 141 ms 604 KB Output is correct
13 Correct 109 ms 656 KB Output is correct
14 Correct 304 ms 604 KB Output is correct
15 Correct 104 ms 604 KB Output is correct
16 Execution timed out 3017 ms 600 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 374 ms 35924 KB Output is correct
2 Correct 379 ms 39100 KB Output is correct
3 Correct 376 ms 38996 KB Output is correct
4 Correct 363 ms 38992 KB Output is correct
5 Execution timed out 3022 ms 58960 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3060 ms 1372 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 46 ms 464 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 25 ms 348 KB Output is correct
12 Correct 141 ms 604 KB Output is correct
13 Correct 109 ms 656 KB Output is correct
14 Correct 304 ms 604 KB Output is correct
15 Correct 104 ms 604 KB Output is correct
16 Execution timed out 3017 ms 600 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 46 ms 464 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 25 ms 348 KB Output is correct
12 Correct 141 ms 604 KB Output is correct
13 Correct 109 ms 656 KB Output is correct
14 Correct 304 ms 604 KB Output is correct
15 Correct 104 ms 604 KB Output is correct
16 Execution timed out 3017 ms 600 KB Time limit exceeded
17 Halted 0 ms 0 KB -