Submission #992635

#TimeUsernameProblemLanguageResultExecution timeMemory
992635MarwenElarbiTwo Transportations (JOI19_transportations)C++17
0 / 100
236 ms1320 KiB
//Azer #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long #define pb push_back vector<pair<int,int>> adja[2005]; int n; vector<bool> ans; void SendA(bool y); void InitA(int N, int A, std::vector<int> U, std::vector<int> V,std::vector<int> C){ return; } void ReceiveA(bool x) { ans.pb(x); } std::vector<int> Answer() { vector<int> res; for (int i = 0; i < ans.size(); i+=20) { int cur=0; for (int j = 0; j < 20; ++j) { cur+=((ans[i+j]&1)<<j); } res.pb(cur); } return res; }
//Baijan #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long #define pb push_back vector<pair<int,int>> adjb[2005]; int n; void SendB(bool x); void InitB(int N, int B, std::vector<int> S, std::vector<int> T,std::vector<int> D){ n=N; int dis[n]; for (int i = 0; i < B; ++i) { dis[i]=1e9; adjb[S[i]].pb({T[i],D[i]}); adjb[T[i]].pb({S[i],D[i]}); } priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq; pq.push({0,0}); dis[0]=0; while(!pq.empty()){ int node=pq.top().se; int d=pq.top().fi; pq.pop(); if(d!=dis[node]) continue; for(auto u:adjb[node]){ int newd=d+u.se; if(newd>dis[u.fi]) continue; dis[u.fi]=newd; pq.push({newd,u.fi}); } } for (int i = 0; i < n; ++i) { for (int j = 0; j < 20; ++j) { if((1<<j)&dis[i]) SendB(1); else SendB(0); } } } void ReceiveB(bool y){ return; }

Compilation message (stderr)

Azer.cpp: In function 'std::vector<int> Answer()':
Azer.cpp:24:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for (int i = 0; i < ans.size(); i+=20)
      |                   ~~^~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...