# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
579905 | leeh18 | Harbingers (CEOI09_harbingers) | C++17 | 66 ms | 20568 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>
template<class Fun>
class y_combinator_result {
Fun fun_;
public:
template<class T>
explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}
template<class ...Args>
decltype(auto) operator()(Args &&...args) {
return fun_(std::ref(*this), std::forward<Args>(args)...);
}
};
template<class Fun>
decltype(auto) y_combinator(Fun &&fun) {
return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
}
using namespace std;
using ll = long long;
struct line {
ll a, b;
line(ll a_, ll b_) : a(a_), b(b_) {}
line() : a(0LL), b(0LL) {}
ll operator()(ll x) const {
return a * x + b;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |