Submission #226476

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2264762020-04-23 23:11:37thebesOlympic Bus (JOI20_ho_t4)C++14
100 / 100
364 ms162656 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
#define pb push_back
const int MN = 202, MM = 5e4+5;
int N, M, i, j, x, y, w[MM], c[MM], u[MM], vs[MN], ban[MM], par[MN]; ll ans, dis[MN], a[MM][MN], b[MM][MN], cost[MM];
vector<pii> adj[MN], rev[MN];
vi tree; pii ed[MM];
void dij(int src,bool dir){
memset(par,-1,sizeof(par));
memset(vs,0,sizeof(vs));
for(i=1;i<=N;i++)
dis[i]=1LL<<55;
dis[src]=0;
int cur=src; ll mn;
while(cur!=-1){
vs[cur]=1;
if(dir==1){
for(auto v : adj[cur]){
if(ban[v.second]) continue;
if(dis[cur]+w[v.second]<dis[v.first]){
dis[v.first]=dis[cur]+w[v.second];
par[v.first]=v.second;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from ho_t4.cpp:1:
ho_t4.cpp: In function 'int main()':
ho_t4.cpp:79:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         assert(tree.size()<=N);
                ~~~~~~~~~~~^~~
ho_t4.cpp:97:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         assert(tree.size()<=N);
                ~~~~~~~~~~~^~~
ho_t4.cpp:58:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(scanf("%d%d",&N,&M),i=1;i<=M;i++){
         ~~~~~~~~~~~~~~~~~~~^~~~
ho_t4.cpp:59:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d%d",&x,&y,&w[i],&c[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...