제출 #1115837

#제출 시각아이디문제언어결과실행 시간메모리
1115837adaawfPolitical Development (BOI17_politicaldevelopment)C++17
4 / 100
8 ms31740 KiB
#include <iostream> #include <bitset> #include <vector> using namespace std; bitset<50005> b[50005], bb; vector<vector<int>> v[11]; vector<int> va; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k, res = 1; cin >> n >> k; for (int i = 0; i < n; i++) { int x; cin >> x; for (int j = 0; j < x; j++) { int y; cin >> y; if (y > i) { b[i][y] = 1; v[2].push_back({i, y}); } } } for (int i = 2; i <= k; i++) { if (v[i].empty()) break; res = i; if (i == k) break; for (auto w : v[i]) { bb = b[w[0]]; for (int i = 1; i < w.size(); i++) { bb &= b[w[i]]; } for (int i = bb._Find_first(); i <= n; i = bb._Find_next(i)) { va = w; va.push_back(i); v[i + 1].push_back(va); } } } cout << res; }

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

politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:31:31: 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 = 1; i < w.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...