commuter_pass.cpp: In function 'long long int solve(int, int, int, int, int)':
commuter_pass.cpp:33:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for(int i=0;i<v[in].size();i++)
| ~^~~~~~~~~~~~~
commuter_pass.cpp:55:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
55 | for(int i=0;i<v[in].size();i++)
| ~^~~~~~~~~~~~~
commuter_pass.cpp:76:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
76 | if(vis[in]==1)
| ^~
commuter_pass.cpp:78:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
78 | mval[in]=mi;
| ^~~~
commuter_pass.cpp:5:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
5 | #define rep(a,b) for(int i=a;i<b;i++)
| ~^~~~~~~
6 | vector<ll>v[200000],co[200000];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 | ll solve(int n,int a,int b,int c,int d)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | {
| ~
9 | int vis[n];
| ~~~~~~~~~~~
10 | ll val[n],val2[n],mval[n],val3[n],mval2[n],val4[n];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 | rep(0,n)
| ~~~~~~~~
12 | {
| ~
13 | val3[i]=1e18;
| ~~~~~~~~~~~~~
14 | val4[i]=1e18;
| ~~~~~~~~~~~~~
15 | mval2[i]=1e18;
| ~~~~~~~~~~~~~~
16 | vis[i]=0;
| ~~~~~~~~~
17 | val[i]=0;
| ~~~~~~~~~
18 | mval[i]=1e18;
| ~~~~~~~~~~~~~
19 |
|
20 | }
| ~
21 | priority_queue<pair<ll,ll> >q;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 | q.push({0,c});
| ~~~~~~~~~~~~~~
23 | //cout<<1<<endl;
| ~~~~~~~~~~~~~~~~
24 | while(!q.empty())
| ~~~~~~~~~~~~~~~~~
25 | {
| ~
26 | ll sum=-q.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~
27 | ll in=q.top().second;
| ~~~~~~~~~~~~~~~~~~~~~
28 | q.pop();
| ~~~~~~~~
29 | if(vis[in])
| ~~~~~~~~~~~
30 | continue;
| ~~~~~~~~~
31 | vis[in]=1;
| ~~~~~~~~~~
32 | val[in]=sum;
| ~~~~~~~~~~~~
33 | for(int i=0;i<v[in].size();i++)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | {
| ~
35 |
|
36 | q.push({-sum-co[in][i],v[in][i]});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | }
| ~
38 | }
| ~
39 |
|
40 | for(int i=0;i<n;i++)
| ~~~~~~~~~~~~~~~~~~~~
41 | {
| ~
42 | vis[i]=0;
| ~~~~~~~~~
43 | }
| ~
44 | q.push({0,d});
| ~~~~~~~~~~~~~~
45 | // cout<<2<<endl;
| ~~~~~~~~~~~~~~~~~
46 | while(!q.empty())
| ~~~~~~~~~~~~~~~~~
47 | {
| ~
48 | q.pop();
| ~~~~~~~~
49 | ll sum=-q.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~
50 | ll in=q.top().second;
| ~~~~~~~~~~~~~~~~~~~~~
51 | if(vis[in])
| ~~~~~~~~~~~
52 | continue;
| ~~~~~~~~~
53 | vis[in]=1;
| ~~~~~~~~~~
54 | val2[in]=sum;
| ~~~~~~~~~~~~~
55 | for(int i=0;i<v[in].size();i++)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | {
| ~
57 |
|
58 | q.push({-sum-co[in][i],v[in][i]});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 | }
| ~
60 | }
| ~
61 | rep(0,n)
| ~~~~~~~~
62 | vis[i]=0;
| ~~~~~~~~~
63 | priority_queue<pair<ll,pair<ll,ll> > >pq;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 | pq.push({0,{-val[a],a}});
| ~~~~~~~~~~~~~~~~~~~~~~~~~
65 | // cout<<3<<endl;
| ~~~~~~~~~~~~~~~~~
66 | val3[a]=0;
| ~~~~~~~~~~
67 | while(!pq.empty())
| ~~~~~~~~~~~~~~~~~~
68 | {
| ~
69 | ll sum=-pq.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~~
70 |
|
71 | ll mi=-pq.top().second.first;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | int in=pq.top().second.second;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | pq.pop();
| ~~~~~~~~~
74 |
|
75 | // cout<<pq.size()<<' '<<vis[in]<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76 | if(vis[in]==1)
| ~~~~~~~~~~~~~~
77 | continue;
| ~~~~~~~~~
78 | mval[in]=mi;
| ~~~~~~~~~~~~
79 | vis[in]=1;
| ~~~~~~~~~~
80 | //pq.pop();
| ~~~~~~~~~~~
81 | rep(0,v[in].size())
| ~~~~~~~~~~~~~~~~~~
commuter_pass.cpp:81:9: note: in expansion of macro 'rep'
81 | rep(0,v[in].size())
| ^~~
commuter_pass.cpp:113:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
113 | if(vis[in]==1)
| ^~
commuter_pass.cpp:115:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
115 | mval2[in]=mi;
| ^~~~~
commuter_pass.cpp:5:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
5 | #define rep(a,b) for(int i=a;i<b;i++)
| ~^~~~~~~
6 | vector<ll>v[200000],co[200000];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 | ll solve(int n,int a,int b,int c,int d)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | {
| ~
9 | int vis[n];
| ~~~~~~~~~~~
10 | ll val[n],val2[n],mval[n],val3[n],mval2[n],val4[n];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 | rep(0,n)
| ~~~~~~~~
12 | {
| ~
13 | val3[i]=1e18;
| ~~~~~~~~~~~~~
14 | val4[i]=1e18;
| ~~~~~~~~~~~~~
15 | mval2[i]=1e18;
| ~~~~~~~~~~~~~~
16 | vis[i]=0;
| ~~~~~~~~~
17 | val[i]=0;
| ~~~~~~~~~
18 | mval[i]=1e18;
| ~~~~~~~~~~~~~
19 |
|
20 | }
| ~
21 | priority_queue<pair<ll,ll> >q;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 | q.push({0,c});
| ~~~~~~~~~~~~~~
23 | //cout<<1<<endl;
| ~~~~~~~~~~~~~~~~
24 | while(!q.empty())
| ~~~~~~~~~~~~~~~~~
25 | {
| ~
26 | ll sum=-q.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~
27 | ll in=q.top().second;
| ~~~~~~~~~~~~~~~~~~~~~
28 | q.pop();
| ~~~~~~~~
29 | if(vis[in])
| ~~~~~~~~~~~
30 | continue;
| ~~~~~~~~~
31 | vis[in]=1;
| ~~~~~~~~~~
32 | val[in]=sum;
| ~~~~~~~~~~~~
33 | for(int i=0;i<v[in].size();i++)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | {
| ~
35 |
|
36 | q.push({-sum-co[in][i],v[in][i]});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | }
| ~
38 | }
| ~
39 |
|
40 | for(int i=0;i<n;i++)
| ~~~~~~~~~~~~~~~~~~~~
41 | {
| ~
42 | vis[i]=0;
| ~~~~~~~~~
43 | }
| ~
44 | q.push({0,d});
| ~~~~~~~~~~~~~~
45 | // cout<<2<<endl;
| ~~~~~~~~~~~~~~~~~
46 | while(!q.empty())
| ~~~~~~~~~~~~~~~~~
47 | {
| ~
48 | q.pop();
| ~~~~~~~~
49 | ll sum=-q.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~
50 | ll in=q.top().second;
| ~~~~~~~~~~~~~~~~~~~~~
51 | if(vis[in])
| ~~~~~~~~~~~
52 | continue;
| ~~~~~~~~~
53 | vis[in]=1;
| ~~~~~~~~~~
54 | val2[in]=sum;
| ~~~~~~~~~~~~~
55 | for(int i=0;i<v[in].size();i++)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | {
| ~
57 |
|
58 | q.push({-sum-co[in][i],v[in][i]});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 | }
| ~
60 | }
| ~
61 | rep(0,n)
| ~~~~~~~~
62 | vis[i]=0;
| ~~~~~~~~~
63 | priority_queue<pair<ll,pair<ll,ll> > >pq;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 | pq.push({0,{-val[a],a}});
| ~~~~~~~~~~~~~~~~~~~~~~~~~
65 | // cout<<3<<endl;
| ~~~~~~~~~~~~~~~~~
66 | val3[a]=0;
| ~~~~~~~~~~
67 | while(!pq.empty())
| ~~~~~~~~~~~~~~~~~~
68 | {
| ~
69 | ll sum=-pq.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~~
70 |
|
71 | ll mi=-pq.top().second.first;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | int in=pq.top().second.second;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | pq.pop();
| ~~~~~~~~~
74 |
|
75 | // cout<<pq.size()<<' '<<vis[in]<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76 | if(vis[in]==1)
| ~~~~~~~~~~~~~~
77 | continue;
| ~~~~~~~~~
78 | mval[in]=mi;
| ~~~~~~~~~~~~
79 | vis[in]=1;
| ~~~~~~~~~~
80 | //pq.pop();
| ~~~~~~~~~~~
81 | rep(0,v[in].size())
| ~~~~~~~~~~~~~~~~~~~
82 | {
| ~
83 | int k=v[in][i];
| ~~~~~~~~~~~~~~~
84 | ll newval=sum+co[in][i];
| ~~~~~~~~~~~~~~~~~~~~~~~~
85 | if(newval<val3[k])
| ~~~~~~~~~~~~~~~~~~
86 | {
| ~
87 | val3[k]=newval;
| ~~~~~~~~~~~~~~~
88 | mval[k]=min(mval[in],val[k]);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 | pq.push({-newval,{-mval[k],k}});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90 | }
| ~
91 | if(newval==val3[k])
| ~~~~~~~~~~~~~~~~~~~
92 | {
| ~
93 | mval[k]=min(mval[k],mval[in]);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94 | pq.push({-newval,{-mval[k],k}});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95 |
|
96 | }
| ~
97 | }
| ~
98 |
|
99 | }
| ~
100 | rep(0,n)
| ~~~~~~~~
101 | vis[i]=0;
| ~~~~~~~~~
102 | val4[b]=0;
| ~~~~~~~~~~
103 | pq.push({0,{-val2[b],b}});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | while(!pq.empty())
| ~~~~~~~~~~~~~~~~~~
105 | {
| ~
106 | ll sum=-pq.top().first;
| ~~~~~~~~~~~~~~~~~~~~~~~
107 |
|
108 | ll mi=-pq.top().second.first;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109 | int in=pq.top().second.second;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110 | pq.pop();
| ~~~~~~~~~
111 |
|
112 | // cout<<pq.size()<<' '<<vis[in]<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113 | if(vis[in]==1)
| ~~~~~~~~~~~~~~
114 | continue;
| ~~~~~~~~~
115 | mval2[in]=mi;
| ~~~~~~~~~~~~~
116 | vis[in]=1;
| ~~~~~~~~~~
117 | //pq.pop();
| ~~~~~~~~~~~
118 | rep(0,v[in].size())
| ~~~~~~~~~~~~~~~~~~
commuter_pass.cpp:118:9: note: in expansion of macro 'rep'
118 | rep(0,v[in].size())
| ^~~