# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
990868 | prvocislo | Port Facility (JOI17_port_facility) | C++17 | 5344 ms | 765104 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 <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 1e9 + 7;
int mul(int a, int b) { return (a * 1ll * b) % mod; }
struct bod
{
int x, y, i;
};
vector<bod> a;
vector<int> in;
vector<int> col;
struct segment_tree2d
{
int n2 = 1; bool sw = false;
vector<vector<int> > st;
vector<int> l, r;
void run(const vector<int>& b, int vr = 1)
{
for (int i : b) if ((!sw && l[vr] <= a[i].x && a[i].x <= r[vr]) || (sw && l[vr] <= a[i].y && a[i].y <= r[vr])) st[vr].push_back(i);
if (vr < n2) run(st[vr], vr * 2), run(st[vr], vr * 2 + 1);
# | 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... |