Submission #1087592

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10875922024-09-13 02:13:07shiori_chanCommuter Pass (JOI18_commuter_pass)C++17
15 / 100
2075 ms262144 KiB
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#define int long long
using namespace std;
const int nd = 1e5 + 5 , INF = 1e18;
vector<pair<int,int> > adj[nd];
vector<int> dis[4] , g[nd] , in(nd , 0) , topo , f(nd , INF) , par[nd];
priority_queue< pair<int , int> , vector< pair<int,int> > , greater< pair<int,int> > >q;
bool vs[nd];
void dijs(int r , int p){
q.push({0 , r});
dis[p][r] = 0;
memset(vs , false , nd);
while(!q.empty()){
int u = q.top().second , h = q.top().first;
q.pop();
if(vs[u])continue;
//cout << r << " " << h << " " << u <<" " << '\n';
vs[u] = true;
for(auto v : adj[u])if(!vs[v.first]){
//cout << v.first << '\n';
if(h + v.second < dis[p][v.first]){
dis[p][v.first] = h + v.second , q.push({dis[p][v.first] , v.first});
}
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

commuter_pass.cpp: In function 'void solve()':
commuter_pass.cpp:80:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |     for(int i = 1;i < topo.size(); ++i){
      |                   ~~^~~~~~~~~~~~~
commuter_pass.cpp:92:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   92 |     for(int i = 1;i < topo.size(); ++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...