Submission #869360

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8693602023-11-04 07:55:42vjudge1Commuter Pass (JOI18_commuter_pass)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define ll long long int
const int mxn=1e5+5;
ll n,m,dis[mxn],s,t,u,v,ans=1e18,mark[mxn];
pair<int,int>par2[mxn];
vector<int>par[mxn];
set<pair<ll,ll> >st,yal[mxn];
void dfs(int z){
mark[z]=1;
dis[z]=0;
for(auto i:par[z]){
if(!mark[i]){
dfs(i);
}
}
}
void dij(){
while(st.size()){
auto x=*st.begin();
st.erase({x.fr,x.sc});
for(auto i:yal[x.sc]){
if(dis[i.fr]>x.fr+i.sc){
st.erase({dis[i.fr],i.fr});
dis[i.fr]=x.fr+i.sc;
st.insert({dis[i.fr],i.fr});
par2[i.fr].fr=x.sc;
par2[i.fr].sc=i.sc;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

commuter_pass.cpp: In function 'void dij()':
commuter_pass.cpp:39:11: error: a function-definition is not allowed here before '{' token
   39 | int main(){
      |           ^
commuter_pass.cpp:75:1: error: expected '}' at end of input
   75 | }
      | ^
commuter_pass.cpp:20:11: note: to match this '{'
   20 | void dij(){
      |           ^