제출 #232704

#제출 시각아이디문제언어결과실행 시간메모리
232704UserIsUndefinedSplit the Attractions (IOI19_split)C++14
0 / 100
7 ms2688 KiB
#include <bits/stdc++.h> //#include "split.h" using namespace std; vector<int> adj[100005]; int ok; map<int,int> visited; map<int,int> good; int sz; int now; void dfs(int v){ visited[v] = true; sz--; good[v] = now; if (sz == 0) return; for (int i : adj[v]){ if (visited[i] == false){ dfs(i); } } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { vector<int> res(n, 0); for (int i = 0 ; i < p.size() ; i++){ int x = p[i]; int y = q[i]; adj[x].push_back(y); adj[y].push_back(x); } sz = a; now = 1; dfs(0); sz = b; now = 2; for (int i = 0 ; i < n ; i++){ if (visited[i] == 0)dfs(i); } for (int i = 0 ; i < n ; i++){ res[i] = (good[i] == 0 ? 3 : good[i]); } return res; }

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

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:36:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0 ; i < p.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...