# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
683385 | MtSaka | Toll (BOI17_toll) | C++17 | 251 ms | 14184 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;
int k,n,m,o;
constexpr int inf=1000000000;
struct Mat{
vector<vector<int>>a;
Mat(){
a.assign(k,vector<int>(k,inf));
}
Mat(const vector<vector<int>>&b):a(b){}
friend Mat operator*(const Mat&a,const Mat&b){
Mat c=Mat();
for(int i=0;i<k;i++)for(int j=0;j<k;j++)for(int l=0;l<k;l++)c.a[i][j]=min(c.a[i][j],a.a[i][l]+b.a[l][j]);
return c;
}
static const Mat e(){
Mat c=Mat();
for(int i=0;i<k;i++)c.a[i][i]=0;
return c;
}
};
struct segtree{
private:
int n;
vector<Mat>seg;
public:
segtree(int n):n(n){seg.assign(2*n,Mat::e());}
segtree(const vector<Mat>&v){
n=v.size();
seg.assign(2*n,Mat::e());
# | 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... |