# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1005777 | omsincoconut | Boat (APIO16_boat) | C++17 | 156 ms | 8020 KiB |
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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7, MAXN = 505;
ll n, a[MAXN], b[MAXN];
vector<ll> dis;
ll disz;
ll dp[MAXN][2*MAXN] = {0}, qdp[MAXN][2*MAXN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for (ll i = 1; i <= n; i++) cin >> a[i] >> b[i];
for (ll i = 1; i <= n; i++) dis.push_back(a[i]), dis.push_back(b[i]);
dis.push_back(0);
sort(dis.begin(), dis.end());
dis.resize(unique(dis.begin(), dis.end()) - dis.begin());
disz = dis.size();
for (ll i = 1; i <= n; i++) {
ll beg = lower_bound(dis.begin(), dis.end(), a[i]) - dis.begin();
ll lst = lower_bound(dis.begin(), dis.end(), b[i]) - dis.begin();
for (ll j = beg; j < lst; j++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |