제출 #293754

#제출 시각아이디문제언어결과실행 시간메모리
293754egekabasSplit the Attractions (IOI19_split)C++14
11 / 100
118 ms12664 KiB
#include "split.h" #include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ff first #define ss second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<ull, ull> pull; typedef pair<int, int> pii; typedef pair<ld, ld> pld; using namespace std; int lft; vector<int> ans; vector<int> g[100009]; void dfssp(int v){ if(lft <= 0) return; --lft; ans[v] = 2; for(auto u : g[v]) if(ans[u] == 0) dfssp(u); } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { for(int i = 0; i < p.size(); ++i){ g[p[i]].pb(q[i]); g[q[i]].pb(p[i]); } ans.resize(n); if(a == 1){ lft = b; dfssp(0); for(int i = 0; i < n; ++i) if(ans[i] == 0){ ans[i] = 1; break; } for(int i = 0; i < n; ++i) if(ans[i] == 0) ans[i] = 3; return ans; } }

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

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:30:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for(int i = 0; i < p.size(); ++i){
      |                 ~~^~~~~~~~~~
split.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
   48 | }
      | ^
#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...