제출 #145424

#제출 시각아이디문제언어결과실행 시간메모리
145424JovanK26Split the Attractions (IOI19_split)C++14
0 / 100
2 ms376 KiB
#include "split.h" #include<bits/stdc++.h> using namespace std; vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { vector<int> rez(n); vector<int> v[n]; for(int i=0;i<p.size();i++) { v[p[i]].push_back(q[i]); v[q[i]].push_back(p[i]); } if(a==1) { queue<int> q; bool vis[n]; for(int i=0;i<n;i++) { rez[i]=0; vis[i]=0; } rez[0]=1; int br=0; q.push(0); vis[0]=1; while(!q.empty()) { int node=q.front(); q.pop(); rez[node]=2; br++; if(br==b)break; for(int i=0;i<v[node].size();i++) { if(!vis[v[node][i]]) { vis[v[node][i]]=1; q.push(v[node][i]); } } } for(int i=0;i<n;i++) { if(!rez[i])rez[i]=3; } } return rez; }

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

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:8:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<p.size();i++)
              ~^~~~~~~~~
split.cpp:33:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i=0;i<v[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...