Submission #914091

#TimeUsernameProblemLanguageResultExecution timeMemory
9140911075508020060209tcSenior Postmen (BOI14_postmen)C++14
100 / 100
424 ms68464 KiB
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; //#define int long long #define X first #define Y second #define SZ(x) (int)(x).size() int n;int m; int ar[500005]; vector<int>e[500005]; int eit[500005]; //bool vis[500005]; //bool visv[500005]; bitset<500005>vis; bitset<500005>visv; int id; int ssz; int stk[500005]; void dfs(int nw){ for(;eit[nw]<e[nw].size();eit[nw]++){ id=e[nw][eit[nw]]; if(vis[id]){continue;} vis[id]=1; int v=ar[id]^nw; dfs(v); } int v=nw; if(visv[v]){ while(1){ cout<<stk[ssz-1]; if(stk[ssz-1]==v){cout<<'\n';break;}else{ cout<<' '; } visv[stk[ssz-1]]=0; ssz--; } }else{ visv[v]=1; stk[ssz++]=v; } } signed main(){ cin.tie(0); ios_base::sync_with_stdio(0); cin>>n>>m; for(int i=1;i<=m;i++){ int b; cin>>ar[i]>>b; e[ar[i]].push_back(i); e[b].push_back(i); ar[i]^=b; } dfs(1); return 0; }

Compilation message (stderr)

postmen.cpp: In function 'void dfs(int)':
postmen.cpp:23:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 | for(;eit[nw]<e[nw].size();eit[nw]++){
      |      ~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...