# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151532 | edenooo | Organizing the Best Squad (FXCUP4_squad) | C++17 | 984 ms | 56832 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<vector>
#include<algorithm>
using namespace std;
#define INF 9'000'000'000'000'000'000LL
#define ll long long
struct Fraction {
ll a, b; // a/b
bool operator< (Fraction &n)
{
if (a == -INF) return true; //틀린 이유
if (n.a == -INF) return false;
ll ta, tb, tc, td;
ta = a; tb = b; tc = n.a; td = n.b;
if (tb < 0) { ta *= -1; tb *= -1; }
if (td < 0) { tc *= -1; td *= -1; }
return ta * td < tb * tc;
}
bool operator<= (Fraction &n)
{
if (a == -INF) return true;
if (n.a == -INF) return false;
ll ta, tb, tc, td;
ta = a; tb = b; tc = n.a; td = n.b;
if (tb < 0) { ta *= -1; tb *= -1; }
if (td < 0) { tc *= -1; td *= -1; }
return ta * td <= tb * tc;
}
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... |