# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
551459 | Ai7081 | Travelling Merchant (APIO17_merchant) | C++17 | 48 ms | 2016 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>
using namespace std;
#define long long long
const bool debug = 0;
const int N = 105;
const int K = 1005;
const long inf = 1e18;
struct item{
long x, t=inf;
item() {}
item(long x, long t) : x(x), t(t) {}
bool operator < (const item &o) const {
if (!t) return true;
if (!o.t) return false;
if (x == 0 && o.x == 0) return t < o.t;
return x*o.t < t*o.x;
}
bool operator > (const item &o) const {return !(*this < o);}
item operator + (const item &o) {return item(x+o.x, t+o.t);}
void operator += (const item &o) {x+=o.x; t+=o.t;}
};
long n, m, k, b[N][K], s[N][K];
item dis[N][N], out;
int main() {
scanf(" %lld %lld %lld", &n, &m, &k);
for (int i=1; i<=n; i++) {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |