# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
150915 | gs18103 | Organizing the Best Squad (FXCUP4_squad) | C++17 | 597 ms | 56320 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 "squad.h"
#include <bits/stdc++.h>
#define g(tp, x) get<x>(tp)
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef tuple <ll, ll, int> tp3;
vector <tp3> p1, p2, ch1, chs1, ch2, chs2, temp;
bool chk1[303030], chk2[303030];
bool ccw(tp3 a, tp3 b, tp3 c) {
return (g(b, 0) - g(a, 0)) * (g(c, 1) - g(a, 1)) -
(g(c, 0) - g(a, 0)) * (g(b, 1) - g(a, 1)) >= 0;
}
void Init(vector<int> A, vector<int> D, vector<int> P){
int n = A.size();
for(int i = 0; i < n; i++) {
p1.eb((ll)A[i], (ll)P[i], i);
p2.eb((ll)D[i], (ll)P[i], i);
}
sort(all(p1), [](tp3 a, tp3 b) {
if(g(a, 0) == g(b, 0)) return g(a, 1) > g(b, 1);
else return a < b;
});
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |