#include <bits/stdc++.h>
using namespace std; using ii = pair<int,int>; using ll = long long;
void o_o(){ cerr << endl; }
template <class H, class...T> void o_o(H h,T...t) { cerr << ' ' << h; o_o(t...); }
#define debug(...) cerr<<'['<<#__VA_ARGS__<<"]:",o_o(__VA_ARGS__)
#define rep(i,a,b) for (auto i = (a); i <= (b); ++i)
#define all(x) (x).begin(), (x).end()
#define size(x) int((x).size())
#define fi first
#define se second
#define Mup(x,y) x = max(x,y)
const int N = 1e5+3;
int n;
int lis[N], answer;
struct X { int a, b, c, d; } t[N];
bool byA(X &x, X &y){ return x.a < y.a; }
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n;
rep(i,1,n) {
cin >> t[i].a >> t[i].b >> t[i].c >> t[i].d;
}
sort(t+1,t+n+1,byA);
rep(i,1,n) rep(j,1,i-1) {
lis[i] = 1;
if (t[j].b < t[i].a and t[j].d < t[i].c) {
Mup(answer, Mup(lis[i], lis[j]+1));
}
}
cout << answer;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
1 ms |
340 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
2 ms |
340 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
6 ms |
340 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
14 ms |
340 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
15 ms |
340 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
32 ms |
340 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
109 ms |
620 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
345 ms |
700 KB |
Unexpected end of file - int32 expected |
11 |
Execution timed out |
646 ms |
980 KB |
Time limit exceeded |
12 |
Execution timed out |
1094 ms |
1324 KB |
Time limit exceeded |
13 |
Execution timed out |
1067 ms |
1352 KB |
Time limit exceeded |
14 |
Execution timed out |
1089 ms |
1548 KB |
Time limit exceeded |
15 |
Execution timed out |
1097 ms |
1596 KB |
Time limit exceeded |
16 |
Execution timed out |
1088 ms |
1792 KB |
Time limit exceeded |
17 |
Execution timed out |
1086 ms |
1836 KB |
Time limit exceeded |
18 |
Execution timed out |
1087 ms |
1848 KB |
Time limit exceeded |
19 |
Execution timed out |
1094 ms |
2028 KB |
Time limit exceeded |
20 |
Execution timed out |
1095 ms |
2012 KB |
Time limit exceeded |