제출 #411573

#제출 시각아이디문제언어결과실행 시간메모리
411573ioiSplit the Attractions (IOI19_split)C++14
7 / 100
89 ms12760 KiB
#include "split.h" #include<bits/stdc++.h> using namespace std; int N ; vector<int> adj[100005]; int vis[100005]; int A , B , C ; vector<int> res ; void dfs(int node){ vis[node] ++ ; if(A)A -- , res[node] = 1 ; else if(B)B -- , res[node] = 2 ; else C -- , res[node] = 3 ; for(auto f : adj[node]){ if(!vis[f])dfs(f); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { res.resize(n); A = a , B = b , C = c ; for(int i = 0 ; i < p.size() ; i ++) adj[p[i]].push_back(q[i]) , adj[q[i]].push_back(p[i]); dfs(0); return res; }

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

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:31:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     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...