#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) {
if (t[j].a < t[i].a and t[j].b < t[i].b and t[j].c < t[i].c and t[j].d < t[i].d) {
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 |
3 ms |
340 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
8 ms |
364 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
17 ms |
388 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
29 ms |
404 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
50 ms |
416 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
193 ms |
468 KB |
Unexpected end of file - int32 expected |
10 |
Execution timed out |
695 ms |
696 KB |
Time limit exceeded |
11 |
Execution timed out |
1075 ms |
984 KB |
Time limit exceeded |
12 |
Execution timed out |
1085 ms |
1224 KB |
Time limit exceeded |
13 |
Execution timed out |
1090 ms |
1536 KB |
Time limit exceeded |
14 |
Execution timed out |
1090 ms |
1688 KB |
Time limit exceeded |
15 |
Execution timed out |
1085 ms |
1760 KB |
Time limit exceeded |
16 |
Execution timed out |
1092 ms |
1732 KB |
Time limit exceeded |
17 |
Execution timed out |
1081 ms |
1844 KB |
Time limit exceeded |
18 |
Execution timed out |
1087 ms |
1932 KB |
Time limit exceeded |
19 |
Execution timed out |
1073 ms |
2120 KB |
Time limit exceeded |
20 |
Execution timed out |
1083 ms |
2168 KB |
Time limit exceeded |