제출 #153724

#제출 시각아이디문제언어결과실행 시간메모리
153724redaSplit the Attractions (IOI19_split)C++14
18 / 100
129 ms12904 KiB
#include<bits/stdc++.h> using namespace std ; vector<int> s; vector<int> g[100001]; bool visited[100001]; void topo (int a) { if(visited[a])return ; visited[a]=1; for(int i=0;i<g[a].size();i++) { topo(g[a][i]); } s.push_back(a); } vector<int> find_split(int n , int a , int b ,int c ,vector<int>p , vector<int>q) { int m = p.size(); for(int i = 0 ;i < m ;i++ ) { g[p[i]].push_back(q[i]); g[q[i]].push_back(p[i]); } topo(0); vector<int> ans(n,0); for(int i = 0 ;i<a;i++) { ans[s[i]]=1; } for(int i = a;i<a+b;i++) { ans[s[i]]=2; } for(int i = a+b;i<n;i++) { ans[s[i]]=3; } return ans; }

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

split.cpp: In function 'void topo(int)':
split.cpp:10:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<g[a].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...