제출 #1117526

#제출 시각아이디문제언어결과실행 시간메모리
1117526stefanneaguPolitical Development (BOI17_politicaldevelopment)C++17
0 / 100
6 ms32632 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int nmax = 5e4 + 1; vector<int> adj[nmax]; bitset<nmax> f[nmax]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, k; cin >> n >> k; for(int i = 1; i <= n; i++) { int d; cin >> d; f[i][i] = 1; while(d--) { int j; cin >> j; j++; adj[i].push_back(j); f[i][j] = 1; } } int ans = 0; for(int i = 1; i <= n; i++) { if(adj[i].size() <= k) { for(int bit = 1; bit < (1 << adj[i].size()); bit++) { vector<int> v; for(int x = 0; (1 << x) <= bit; x++) { if(bit & (1 << x)) { v.push_back(adj[i][x]); } } v.push_back(i); bool ok = 1; for(auto it : v) { for(auto it2 : v) { if(f[it][it2] == 0) { ok = 0; } } } if(ok) { ans = max(ans, (int) v.size()); } } } } cout << ans; return 0; }

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

politicaldevelopment.cpp: In function 'int32_t main()':
politicaldevelopment.cpp:30:22: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   30 |     if(adj[i].size() <= k) {
      |        ~~~~~~~~~~~~~~^~~~
#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...