# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1115891 | vjudge1 | Political Development (BOI17_politicaldevelopment) | C++17 | 652 ms | 333040 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define pll pair<long long, long long>
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
const ll N = 1e6 + 100;
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll block = 1e3;
bitset<50005>b[50005], cur;
ll n,k;
void to_thic_cau(){
cin >> n >> k;
vector<vector<ll>>prv;
for(ll i = 0; i < n;i++){
prv.pb({i});
ll sz; cin >> sz;
while(sz--){
ll v; cin >> v;
b[min(i, v)][max(i, v)] = 1;
}
}
for(int i = 2; i <= k + 1;i++){
vector<vector<ll>>nxt;
for(auto vec : prv){
cur = b[vec[0]];
for(int j = 1; j < vec.size();j++) cur &= b[vec[j]];
for(int j = cur._Find_first(); j < n; j = cur._Find_next(j)){
vector<ll>tmp = vec;
tmp.pb(j);
nxt.pb(tmp);
}
}
prv.clear(); prv = nxt;
if(!prv.size()){
cout << i - 1 << "\n";
return;
}
}
}
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int tc = 1;
//cin >> tc;
while(tc--) to_thic_cau();
}
컴파일 시 표준 에러 (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... |