| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1035668 | vjudge1 | Political Development (BOI17_politicaldevelopment) | C++17 | 350 ms | 337908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math,inline")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,lzcnt,mmx,abm,avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
const int N = 5e4;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, k, c, ans;
vector<int> vt, adj[N];
set<int> st[N];
bitset<N> bt[N], r, toTake;
void clean(int x) {
for (int i = 0; i < n; i++) {
if (adj[i].size()+1 < x) r[i] = 1;
}
}
void dfs(int x) {
c++;
if (c > ans) {
ans = c;
clean(c+1);
}
vector<int> opt;
for (int y = toTake._Find_first(); y < n; y = toTake._Find_next(y)) {
if (r[y]) continue;
opt.push_back(y);
}
int sz = opt.size();
if (!sz) return;
int y = opt[rng() % sz];
toTake &= bt[y];
dfs(y);
}
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
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;
st[i].insert(y);
if (st[y].find(i) != st[y].end()) {
bt[i][y] = 1;
adj[i].push_back(y);
bt[y][i] = 1;
adj[y].push_back(i);
}
}
}
ans = 1;
for (int i = 0; i < n; i++) {
c = 0;
toTake = bt[i];
dfs(i);
}
cout << ans << "\n";
}컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
