| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1086411 | hahahaha | Political Development (BOI17_politicaldevelopment) | C++17 | 1000 ms | 309332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int mxN = 50000;
using S = bitset<mxN>;
S g[mxN];
int ans = 0;
void find_max(S can, int has) {
ans = max(has, ans);
while (can.any()) {
int cur = (int)can._Find_first();
can.reset(cur);
S nxt_s = can & g[cur];
if ((int)nxt_s.count()+has+1 > ans) {
find_max(nxt_s, has+1);
}
}
}
int main() {
ios::sync_with_stdio(0);cin.tie(0);
int n, k; cin >> n >> k;
for (int i = 0; i < n; ++i) {
int s; cin >> s;
g[i].set(i);
for (int ss = 0; ss < s; ++ss) {
int j; cin >> j;
g[i].set(j);
}
}
/*
for (int i = 0; i < n; ++i)
cerr << g[i] << '\n'; // */
S init;
for (int i = 0; i < n; ++i) init.set(i);
find_max(init, 0);
cout << ans << '\n';
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
