This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <functional>
#include <algorithm>
#include <utility>
using namespace std;
using pi = pair<int,int>;
#define S first
#define F second
int main() {
int s = 301, e = 1130;
int n; cin >> n;
pi flowers[n];
for (auto& s : flowers) {
int a, b, c, d;
cin >> a >> b >> c >> d;
s = {100*c+d, 100*a+b};
}
sort(flowers, flowers+n, greater<pi>());
int cnt = 0; bool chk = false;
for (int i = s; i <= e; chk = false) {
for (auto& f : flowers) {
if (f.F <= i) {
i = f.S;
chk = true;
f = {1232, 1232};
break;
}
}
if (!chk) {cout << 0; return 0;}
++cnt;
}
cout << cnt;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |