제출 #235306

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2353062020-05-27 16:15:38eohomegrownappsToll (BOI17_toll)C++14
100 / 100
602 ms16632 KiB
#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int,int>>> adjlist;
int k,n,num;
int INF = 1e9;
pair<int,int> toCoord(int x){
return {x/k,x%k};
}
vector<vector<int>> combine(vector<vector<int>> a, vector<vector<int>> b, int m){
//cout<<m<<endl;
//x - index of rightmost connector
vector<vector<int>> ans(k,vector<int>(k,INF));
for (int i = 0; i<k; i++){
for (int j = 0; j<k; j++){
//get from a[i][_] to b[_][j]
int mindist = INF;
for (int x = 0; x<k; x++){
if (a[i][x]==INF){continue;}
for (auto v : adjlist[m*k+x]){
//cout<<v.first<<" "<<v.second<<endl;
int node = (v.first)%k;
int dist = v.second;
//cout<<node<<endl;
if (b[node][j]==INF){continue;}
mindist=min(mindist,a[i][x]+b[node][j]+dist);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...