제출 #420808

#제출 시각아이디문제언어결과실행 시간메모리
420808QCFiumSplit the Attractions (IOI19_split)C++14
0 / 100
3 ms332 KiB
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } static std::vector<std::vector<int> > hen; std::vector<int> find_split(int n, int a, int b, int c, std::vector<int> p, std::vector<int> q) { hen.resize(n); for (int i = 0; i < (int) p.size(); i++) { hen[p[i]].push_back(q[i]); hen[q[i]].push_back(p[i]); } std::vector<int> res(n, -1); if (a == 1) { std::vector<bool> visited(n); std::queue<int> que; que.push(0); visited[0] = true; std::vector<int> group2; while (que.size()) { auto i = que.front(); que.pop(); group2.push_back(i); if ((int) group2.size() == b) break; for (auto j : hen[i]) if (!visited[j]) visited[j] = true, que.push(j); } for (auto i : group2) res[i] = 2; *std::find(res.begin(), res.end(), -1) = 1; for (auto &i : res) if (i == -1) i = 3; } } #ifdef LOCAL int main() { return 0; } #endif

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

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
   36 | }
      | ^
split.cpp: In function 'int ri()':
split.cpp:5:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...