# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1115909 | nathan4690 | Toll (BOI17_toll) | C++17 | 142 ms | 14408 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>
#define ll long long
#define ld long double
#define el cout << '\n'
#define f1(i,n) for(int i=1;i<=n;i++)
#define __file_name ""
using namespace std;
const ll maxn = 5e4+5, inf=1e18;
struct Matrix{
int r, c;
vector<vector<ll>> data;
Matrix(){};
Matrix(int r, int c): r(r), c(c), data(r, vector<ll>(c, 1e9)){};
Matrix(vector<vector<ll>> a): r(a.size()), c(a.empty() ? 0 : a[0].size()), data(a){};
Matrix operator*(const Matrix &rhs) const{
assert(c == rhs.r);
Matrix res(r, rhs.c);
// cout << (*this) << "TIMES\n" << rhs;el;
for(int i=0;i<r;i++){
for(int j=0;j<rhs.c;j++){
for(int k=0;k<c;k++){
res.data[i][j] = min(res.data[i][j], data[i][k] + rhs.data[k][j]);
}
}
}
return res;
}
Matrix operator^(const long long &e) const{
assert(r == c);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |