Submission #6083

#TimeUsernameProblemLanguageResultExecution timeMemory
6083baneling100Senior Postmen (BOI14_postmen)C++98
0 / 100
16 ms12288 KiB
#include <stdio.h> #include <algorithm> #include <vector> using namespace std; typedef pair <int,int> ppair; vector <ppair> A[500001]; int N, M, Ban[500001], Ans[500001], Top; void input(void) { int i, u, v; scanf("%d %d",&N,&M); for(i=1 ; i<=M ; i++) { scanf("%d %d",&u,&v); A[u].push_back(make_pair(v,i)); A[v].push_back(make_pair(u,i)); } } void process(int now) { int i, j=A[now].size(); for(i=0 ; i<j ; i++) if(Ban[A[now][i].second]==0) { Ban[A[now][i].second]=1; process(A[now][i].first); } Ans[++Top]=now; } void output(void) { int i; for(i=1 ; i<Top ; i++) printf("%d ",Ans[i]); } int main(void) { input(); process(1); output(); return 0; }

Compilation message (stderr)

postmen.cpp: In function 'void input()':
postmen.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&N,&M);
     ~~~~~^~~~~~~~~~~~~~~
postmen.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&u,&v);
         ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...