版本比较
题解:P14307 【MX-J27-T4】点灯
正文
增加 7 行删除 7 行
71 行未改动7273747576767778787980818256 行未改动13914014114214314314414514614614714814915017 行未改动16816917017117217217317417517617717817817918018018118218318421 行未改动71 行未改动 auto [d , u , opt] = que.top(); que.pop(); for(ll i = first[u];i;i = edge[i].next){ ll v = edge[i].to , w = edge[i].w;
ll t = 0; // 存储到达时间
if (w <= d + 1) t = d + 1; else { if ((w & 1) == (d & 1)) t = w + 1; else t = w;56 行未改动priority_queue<p, vector<p> , greater<p> > que;
int main() {
ios::sync_with_stdio(0); cin.tie(0),cout.tie(0);
ll c,T; cin >> c >> T; while(T--){ ll n,m,o;17 行未改动 continue; } dis[1][0] = 0; que.emplace(dis[1][0] , 1 , 0);
while(!que.empty()){ auto [d , u , opt] = que.top(); que.pop(); for(ll i = first[u];i;i = edge[i].next){ ll v = edge[i].to , w = edge[i].w;
ll t = 0; // 存储到达时间
if (w <= d + 1) t = d + 1; else { if ((w & 1) == (d & 1)) t = w + 1; else t = w;21 行未改动