제출 #169932

#제출 시각아이디문제언어결과실행 시간메모리
169932sochoSplit the Attractions (IOI19_split)C++14
7 / 100
120 ms12608 KiB
#include "bits/stdc++.h" #include "split.h" using namespace std; int A, B, C, N; const int MXN = 100005; vector<int> adj[MXN]; int res[MXN]; vector<int> order; void dfsord(int node, int last) { order.push_back(node); for (int i=0; i<adj[node].size(); i++) { int ot = adj[node][i]; if (ot == last) continue; dfsord(ot, node); return; } } void line(int end) { dfsord(end, -1); } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { A = a; B = b; C = c; N = n; for (int i=0; i<n-1; i++) { adj[p[i]].push_back(q[i]); adj[q[i]].push_back(p[i]); } int mn = 0; for (int i=0; i<n; i++) { if (adj[i].size() < adj[mn].size()) { mn = i; } } line(mn); vector<int> re(n); for (int i=0; i<n; i++) { if (i < a) re[order[i]] = 1; else if (i - a < b) re[order[i]] = 2; else re[order[i]] = 3; } return re; }

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

split.cpp: In function 'void dfsord(int, int)':
split.cpp:13:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0; i<adj[node].size(); i++) {
                ~^~~~~~~~~~~~~~~~~
#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...