제출 #772792

#제출 시각아이디문제언어결과실행 시간메모리
772792Abrar_Al_SamitSplit the Attractions (IOI19_split)C++17
0 / 100
57 ms9116 KiB
#include "split.h" #include <bits/stdc++.h> using namespace std; const int nax = 1e5 + 3; //subtask 2 vector<int>g[nax]; int m; bool vis[nax]; int a, b, c; vector<int>stk; void dfs(int v) { if(vis[v]) return; stk.push_back(v); vis[v] = 1; if(stk.size()==b) return; for(int u : g[v]) { dfs(u); } } vector<int> find_split(int n, int A, int B, int C, vector<int> p, vector<int> q) { a = A, b = B, c = C; m = p.size(); for(int i=0; i<m; ++i) { g[p[i]].push_back(q[i]); g[q[i]].push_back(p[i]); } dfs(0); int cnt = 0; vector<int>res(n, 0); for(int x : stk) { res[x] = 2; } for(int i=0; i<n; ++i) if(res[i]==0) { if(cnt<c) { ++cnt; res[i] = 3; } else { res[i] = 1; } } return res; }

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

split.cpp: In function 'void dfs(int)':
split.cpp:19:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   19 |  if(stk.size()==b) return;
      |     ~~~~~~~~~~^~~
#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...