# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532103 | fhvirus | Naan (JOI19_naan) | C++17 | 2965 ms | 7884 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.
// Knapsack DP is harder than FFT.
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll; typedef pair<int, int> pii;
#define pb emplace_back
#define AI(x) begin(x),end(x)
#define ff first
#define ss second
#ifdef OWO
#define debug(args...) LKJ("\033[1;32m[ " + string(#args) + " ]\033[0m", args)
template <class I> void LKJ(I&&x) { cerr << x << endl; }
template <class I, class...T> void LKJ(I&&x, T&&...t) { cerr << x << ", "; LKJ(t...); }
template <class I> void OI(I a, I b) { while (a != b) cerr << *a << " \n"[(a = next(a)) == b]; }
#else
#define debug(...) 0
#define OI(...) 0
#endif
struct Frac {
ll a, b;
Frac () = default;
Frac (ll _a, ll _b): a(_a), b(_b) { shrink(); }
void shrink() { ll g = gcd(a, b); a /= g; b /= g; }
const ll toi() const { return a / b; }
const Frac operator + (const Frac& o) const
{ return Frac(a * o.b + o.a * b, b * o.b); }
const Frac operator - (const Frac& o) const
{ return Frac(a * o.b - o.a * b, b * o.b); }
const Frac operator * (const ll& val) const
{ return Frac(a * val, 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... |