제출 #227168

#제출 시각아이디문제언어결과실행 시간메모리
227168tushar_2658어르신 집배원 (BOI14_postmen)C++14
0 / 100
23 ms23808 KiB
#include "bits/stdc++.h" using namespace std; const int maxn = 500005; multiset<int> edges[maxn]; vector<int> path; void dfs(int x){ while(!edges[x].empty()){ int i = *edges[x].begin(); edges[x].erase(edges[x].find(i)); edges[i].erase(edges[i].find(x)); dfs(i); } path.push_back(x); } int main(int argc, char const *argv[]) { // freopen("in.txt", "r", stdin); int n, m; scanf("%d %d", &n, &m); for(int i = 0; i < m; ++i){ int x, y; scanf("%d %d", &x, &y); edges[x].insert(y); edges[y].insert(x); } dfs(1); path.pop_back(); int sz = path.size(); for(int i = 0; i < sz; ++i){ printf("%d ", path[i]); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

postmen.cpp: In function 'int main(int, const char**)':
postmen.cpp:22:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m); 
  ~~~~~^~~~~~~~~~~~~~~~~
postmen.cpp:25:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &x, &y); 
   ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...