QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#545365#8780. Training, Round 2kmiaoWA 10ms4432kbC++20775b2024-09-03 10:45:472024-09-03 10:45:47

Judging History

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

  • [2024-09-03 10:45:47]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:4432kb
  • [2024-09-03 10:45:47]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const int maxN = 5050;
set<int> s[maxN];

int main() {
	cin.tie(0)->sync_with_stdio(0);
	int n, x, y;
	cin >> n >> x >> y;
	s[0].insert(0);
	for (int i = 0; i < n; i++) {
		int l, r, l1, r1;
		cin >> l >> r >> l1 >> r1;
		l -= x;
		r -= x;
		l1 -= y;
		r1 -= y;
		for (int j = i; j >= 0; j--) {
			if (r < j || l > j) continue;
			if (s[j].empty()) continue;
			auto it = s[j].upper_bound(r1);
			if (it != s[j].begin()) {
				it--;
				if (*it >= l1) {
					s[j+1].insert(*it);
					s[j].insert(*it + 1);
				}
			}
		}
	}
	int ans = 0;
	for (int i = 0; i <= n; i++) {
		if (!s[i].empty())
			ans = max(ans, i + *s[i].rbegin());
	}
	cout << ans << '\n';
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3900kb

input:

3 0 0
0 1 0 1
1 1 0 1
1 1 1 1

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 8ms
memory: 4376kb

input:

5000 801577551 932138594
801577551 801577551 932138594 932138594
801577552 801577552 932138594 932138594
801577552 801577552 932138595 932138595
801577552 801577552 932138596 932138596
801577553 801577553 932138596 932138596
801577553 801577553 932138597 932138597
801577553 801577553 932138598 93213...

output:

5000

result:

ok single line: '5000'

Test #3:

score: 0
Accepted
time: 8ms
memory: 4432kb

input:

5000 932138594 801577551
932138594 932138594 801577551 801577551
932138594 932138594 801577552 801577552
932138595 932138595 801577552 801577552
932138596 932138596 801577552 801577552
932138596 932138596 801577553 801577553
932138597 932138597 801577553 801577553
932138598 932138598 801577553 80157...

output:

5000

result:

ok single line: '5000'

Test #4:

score: 0
Accepted
time: 7ms
memory: 4416kb

input:

5000 76836128 716580777
76836128 76836128 716580777 716580777
76836129 76836129 716580777 716580777
76836130 76836130 716580777 716580777
76836131 76836131 716580777 716580777
76836131 76836131 716580778 716580778
76836131 76836131 716580779 716580779
76836131 76836131 716580780 716580780
76836128 7...

output:

4994

result:

ok single line: '4994'

Test #5:

score: 0
Accepted
time: 10ms
memory: 4296kb

input:

5000 716580777 76836128
716580777 716580777 76836128 76836128
716580777 716580777 76836129 76836129
716580777 716580777 76836130 76836130
716580777 716580777 76836131 76836131
716580778 716580778 76836131 76836131
716580779 716580779 76836131 76836131
716580780 716580780 76836131 76836131
716580778 ...

output:

4994

result:

ok single line: '4994'

Test #6:

score: 0
Accepted
time: 3ms
memory: 3888kb

input:

5000 774827789 700294316
774827790 774827791 700294315 700294317
774827789 774827790 700294317 700294318
774827789 774827790 700294316 700294316
774827787 774827787 700294315 700294316
774827789 774827791 700294315 700294318
774827787 774827789 700294317 700294318
774827787 774827788 700294314 70029...

output:

5

result:

ok single line: '5'

Test #7:

score: 0
Accepted
time: 6ms
memory: 3908kb

input:

5000 700294316 774827789
700294315 700294317 774827790 774827791
700294317 700294318 774827789 774827790
700294316 700294316 774827789 774827790
700294315 700294316 774827787 774827787
700294315 700294318 774827789 774827791
700294317 700294318 774827787 774827789
700294314 700294318 774827787 77482...

output:

5

result:

ok single line: '5'

Test #8:

score: 0
Accepted
time: 3ms
memory: 3884kb

input:

5000 256309650 340081224
256309647 256309649 340081224 340081227
256309645 256309650 340081226 340081229
256309652 256309652 340081219 340081220
256309645 256309655 340081222 340081226
256309646 256309648 340081221 340081225
256309651 256309654 340081219 340081221
256309651 256309653 340081219 34008...

output:

11

result:

ok single line: '11'

Test #9:

score: 0
Accepted
time: 6ms
memory: 3828kb

input:

5000 340081224 256309650
340081224 340081227 256309647 256309649
340081226 340081229 256309645 256309650
340081219 340081220 256309652 256309652
340081222 340081226 256309645 256309655
340081221 340081225 256309646 256309648
340081219 340081221 256309651 256309654
340081219 340081226 256309651 25630...

output:

11

result:

ok single line: '11'

Test #10:

score: 0
Accepted
time: 6ms
memory: 3892kb

input:

5000 490966735 218892297
490966732 490966733 218892303 218892305
490966741 490966741 218892298 218892301
490966733 490966735 218892291 218892297
490966729 490966734 218892296 218892301
490966742 490966745 218892287 218892303
490966726 490966738 218892301 218892305
490966726 490966730 218892292 21889...

output:

21

result:

ok single line: '21'

Test #11:

score: 0
Accepted
time: 6ms
memory: 3960kb

input:

5000 218892297 490966735
218892303 218892305 490966732 490966733
218892298 218892301 490966741 490966741
218892291 218892297 490966733 490966735
218892296 218892301 490966729 490966734
218892287 218892303 490966742 490966745
218892301 218892305 490966726 490966738
218892292 218892300 490966726 49096...

output:

21

result:

ok single line: '21'

Test #12:

score: 0
Accepted
time: 6ms
memory: 3856kb

input:

5000 619930859 159808007
619930853 619930854 159808007 159808017
619930840 619930856 159808013 159808025
619930848 619930864 159807995 159808009
619930844 619930847 159808008 159808022
619930848 619930856 159807995 159808001
619930850 619930852 159808020 159808022
619930853 619930871 159807992 15980...

output:

41

result:

ok single line: '41'

Test #13:

score: 0
Accepted
time: 6ms
memory: 3856kb

input:

5000 159808007 619930859
159808007 159808017 619930853 619930854
159808013 159808025 619930840 619930856
159807995 159808009 619930848 619930864
159808008 159808022 619930844 619930847
159807995 159808001 619930848 619930856
159808020 159808022 619930850 619930852
159807992 159808024 619930853 61993...

output:

41

result:

ok single line: '41'

Test #14:

score: 0
Accepted
time: 9ms
memory: 4012kb

input:

5000 974187020 583788009
974186973 974187017 583788001 583788028
974187035 974187052 583788011 583788027
974187016 974187037 583787973 583787981
974187036 974187046 583788012 583788028
974187046 974187066 583788042 583788056
974186994 974187016 583788013 583788044
974186986 974186989 583787969 58378...

output:

100

result:

ok single line: '100'

Test #15:

score: -100
Wrong Answer
time: 8ms
memory: 3956kb

input:

5000 583788009 974187020
583788001 583788028 974186973 974187017
583788011 583788027 974187035 974187052
583787973 583787981 974187016 974187037
583788012 583788028 974187036 974187046
583788042 583788056 974187046 974187066
583788013 583788044 974186994 974187016
583787969 583787994 974186986 97418...

output:

99

result:

wrong answer 1st lines differ - expected: '100', found: '99'